Cleanup broken switch entities for Hue automations - #177671
Conversation
There was a problem hiding this comment.
Pull request overview
Filters non-user-facing Hue behavior instances and removes their stale switches.
Changes:
- Excludes accessory and entertainment behavior scripts.
- Cleans up previously registered entities.
- Adds coverage for filtering and cleanup.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
homeassistant/components/hue/switch.py |
Filters internal automations and removes stale entities. |
tests/components/hue/test_switch.py |
Tests filtering and registry cleanup. |
tests/components/hue/const.py |
Adds behavior resource fixtures. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
tests/components/hue/test_switch.py:181
- Remove these comments because they only restate the assertions immediately below them.
# the internal instance is not exposed
assert hass.states.get("switch.philips_hue_automation_wall_switch_hallway") is None
# while a regular automation still is
assert hass.states.get("switch.philips_hue_automation_timer_test") is not None
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
tests/components/hue/test_switch.py:163
- Specify the metadata mapping types as
dict[str, str]; the baredictleaves its contents asAny, contrary to the concrete test-parameter typing convention inAGENTS.md:31-32.
metadata: dict,
d217ca2 to
71d2ed1
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
tests/components/hue/test_switch.py:163
- Specify the metadata element types as
dict[str, str]; the baredictleaves its keys and values asAny, contrary to the test typing convention inAGENTS.md:31-32.
metadata: dict,
Check requirementsChecked at commit No tracked requirement changes detected. ✅
|
Bridges that do not report a script category ended up with a switch again, which is the useless switch this change is removing. Require the automation category instead, so an unknown or missing category means no switch.
71d2ed1 to
e23bdf8
Compare
Proposed change
Home Assistant adds an "Automation: " switch for every automation stored
on the Hue bridge. Most of those are not automations you can find in the Hue
app, but the button settings of your dimmer switches, wall switches and tap
dials, plus some internal entertainment settings. The bridge refuses to switch
those off, and when it does accept the change the accessory simply keeps
working, so those switches never did anything.
Note that I deliberatly did not mark this as a breaking change although we are removing entities because these entities were non functional anyways and deeply hidden behind the hue bridge device. It is a fix to cleanup some (long overdue) wrong state.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: