You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/src/data/tools.json
+16-4Lines changed: 16 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -699,11 +699,11 @@
699
699
"default": false
700
700
},
701
701
"theme": {
702
-
"type": "Annotated[str | None, Field(description=\"Installed Home Assistant frontend theme name, applied to this render. The engine user's saved theme preference is restored after the capture (best effort).\")]",
702
+
"type": "Annotated[str | None, Field(description=\"Installed Home Assistant frontend theme name, applied to this render. The engine persists this on the engine account's profile; this tool reports the change in warnings but does not undo it (see ha_manage_theme action='set_engine_theme').\")]",
703
703
"default": null
704
704
},
705
705
"dark_mode": {
706
-
"type": "Annotated[bool, Field(description=\"Render the requested theme in dark mode, applied to this render. The engine user's saved theme preference is restored after the capture (best effort).\")]",
706
+
"type": "Annotated[bool, Field(description=\"Render the requested theme in dark mode, applied to this render. The engine persists this on the engine account's profile; this tool reports the change in warnings but does not undo it (see ha_manage_theme action='set_engine_theme').\")]",
707
707
"default": false
708
708
},
709
709
"language": {
@@ -3415,16 +3415,28 @@
3415
3415
{
3416
3416
"name": "ha_manage_theme",
3417
3417
"title": "Manage Frontend Themes",
3418
-
"description": "Manage Home Assistant frontend themes.\n\nWhen NOT to use: themes are YAML files - Home Assistant has no API to\ncreate or edit them. Installing community themes goes through HACS\n(ha_manage_hacs); editing custom theme files goes through\nha_config_set_yaml (beta, edits themes/<name>.yaml keyed by theme name\nand attempts an automatic theme reload).\n\nWhen to use: action='list' discovers installed theme names and the\ncurrent defaults; action='set' selects the backend default theme\n(optionally per light/dark mode).\n\nCaveats: action='set' changes the backend-selected default only -\nusers who explicitly picked a theme in their profile keep their\nchoice. Theme names are validated by Home Assistant at call time.\n\nEXAMPLES:\n- List themes: ha_manage_theme(action=\"list\")\n- Set default theme: ha_manage_theme(action=\"set\", theme_name=\"nord\")\n- Set dark-mode theme: ha_manage_theme(\n action=\"set\", theme_name=\"nord\", mode=\"dark\")\n- Restore built-in default: ha_manage_theme(\n action=\"set\", theme_name=\"default\")",
3418
+
"description": "Manage Home Assistant frontend themes.\n\nWhen NOT to use: themes are YAML files - Home Assistant has no API to\ncreate or edit them. Installing community themes goes through HACS\n(ha_manage_hacs); editing custom theme files goes through\nha_config_set_yaml (beta, edits themes/<name>.yaml keyed by theme name\nand attempts an automatic theme reload).\n\nWhen to use: action='list' discovers installed theme names and the\ncurrent defaults; action='set' selects the backend default theme\n(optionally per light/dark mode).\n\nSCREENSHOT-ENGINE ACTIONS (per-user, not the backend default):\nTaking a dashboard screenshot makes the Puppet engine write the saved\ntheme of the Home Assistant user its token belongs to, which also\nflips that user's live web and mobile sessions. The screenshot tools\nare read-only and only *report* this; use action='set_engine_theme'\nwith the value quoted in their warning to put it back, and\naction='get_engine_theme' to inspect it. These act on that engine\naccount's per-user profile via frontend/set_user_data, which is a\ndifferent layer from the backend default that action='set' changes.\nGiving the engine its own dedicated user and token avoids the issue\nentirely.\n\nCaveats: action='set' changes the backend-selected default only -\nusers who explicitly picked a theme in their profile keep their\nchoice. Theme names are validated by Home Assistant at call time.\n\nEXAMPLES:\n- List themes: ha_manage_theme(action=\"list\")\n- Set default theme: ha_manage_theme(action=\"set\", theme_name=\"nord\")\n- Set dark-mode theme: ha_manage_theme(\n action=\"set\", theme_name=\"nord\", mode=\"dark\")\n- Restore built-in default: ha_manage_theme(\n action=\"set\", theme_name=\"default\")\n- Inspect the engine account's theme: ha_manage_theme(\n action=\"get_engine_theme\")\n- Undo a screenshot's theme change (pass BOTH values from the\n warning, so a theme changed since then is not overwritten):\n ha_manage_theme(action=\"set_engine_theme\",\n value={\"theme\": \"\", \"dark\": False},\n expected_current={\"theme\": \"default\", \"dark\": True})",
3419
3419
"inputSchema": {
3420
3420
"properties": {
3421
3421
"action": {
3422
-
"type": "Annotated[ThemeAction, Field(description='Theme operation: list installed themes or set the default theme.')]"
3422
+
"type": "Annotated[ThemeAction, Field(description=\"Theme operation: 'list' installed themes, 'set' the backend default theme, or read/restore the screenshot engine account's own per-user theme with 'get_engine_theme' / 'set_engine_theme' (a different layer from the backend default).\")]"
3423
3423
},
3424
3424
"theme_name": {
3425
3425
"type": "Annotated[str | None, Field(description=\"Theme name when action='set'. Must be an installed theme; 'default' restores the built-in theme, 'none' resets the chosen mode to the built-in default.\", default=None)]",
3426
3426
"default": null
3427
3427
},
3428
+
"expected_current": {
3429
+
"type": "Annotated[dict[str, Any] | None, JSON_STRING_COERCION, Field(description=\"Guard for action='set_engine_theme': the stored theme is read immediately before the write and the write is skipped if it no longer equals this. Omitting this value or passing null both mean 'expect no stored theme', enforced like any other value; the guard is always applied unless force is set. Best-effort, not atomic -- Home Assistant exposes no conditional write, so a change landing between that read and the write is not caught. Pass the expected_current value quoted in the screenshot tool's warning.\", default=None)]",
3430
+
"default": null
3431
+
},
3432
+
"force": {
3433
+
"type": "Annotated[bool, Field(description=\"action='set_engine_theme' only: skip the expected_current guard and overwrite unconditionally. Leave false unless you intend to discard whatever is stored.\", default=False)]",
3434
+
"default": false
3435
+
},
3436
+
"value": {
3437
+
"type": "Annotated[dict[str, Any] | None, JSON_STRING_COERCION, Field(description=\"Frontend user-data theme object when action='set_engine_theme', e.g. {'theme': '', 'dark': False}. An empty dict restores default/auto behavior. Take this verbatim from the warning a screenshot tool emitted.\", default=None)]",
3438
+
"default": null
3439
+
},
3428
3440
"mode": {
3429
3441
"type": "Annotated[Literal['light', 'dark'] | None, Field(description=\"Which mode the theme applies to when action='set'. Defaults to light.\", default=None)]",
0 commit comments