Skip to content

Commit dd66232

Browse files
kingpanther13claude
andcommitted
fix(themes): coerce the engine-theme dict params from JSON strings
Container params carry JSON_STRING_COERCION so a stringified dict from an MCP client is parsed rather than rejected. The two new engine-theme dict params, value and expected_current, were missing it, which test_container_param_coercion_complete pins repo-wide. Caught by CI's unit leg -- the targeted runs I had been doing did not include that contract test. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Nm7tyA1nfxNCWFXaR3AxV
1 parent 6dd2919 commit dd66232

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/ha_mcp/tools/tools_themes.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
raise_tool_error,
2323
register_tool_methods,
2424
)
25-
from .util_helpers import summarize_theme_listing, websocket_error_message
25+
from .util_helpers import (
26+
JSON_STRING_COERCION,
27+
summarize_theme_listing,
28+
websocket_error_message,
29+
)
2630

2731
logger = logging.getLogger(__name__)
2832

@@ -178,6 +182,7 @@ async def ha_manage_theme(
178182
] = None,
179183
expected_current: Annotated[
180184
dict[str, Any] | None,
185+
JSON_STRING_COERCION,
181186
Field(
182187
description=(
183188
"Compare-and-set guard for action='set_engine_theme': the "
@@ -191,6 +196,7 @@ async def ha_manage_theme(
191196
] = None,
192197
value: Annotated[
193198
dict[str, Any] | None,
199+
JSON_STRING_COERCION,
194200
Field(
195201
description=(
196202
"Frontend user-data theme object when "

0 commit comments

Comments
 (0)