Register service actions in async_setup for Bronze tier compliance#1403
Register service actions in async_setup for Bronze tier compliance#1403ademuri wants to merge 8 commits into
Conversation
|
Awesome! Thanks for all the PRs. There seems to be one failing job still (pre-commit). |
999fda6 to
0020cdd
Compare
|
@all-contributors please add @ademuri for code |
|
I've put up a pull request to add @ademuri! 🎉 |
|
Thanks for working on this! Python 3.12 type syntaxThe change from |
| type AdaptiveSwitches = list[AdaptiveSwitch] | ||
| type AdaptiveSwitchMap = dict[AdaptiveSwitch, list[str]] |
There was a problem hiding this comment.
This was a result of running ruff check . --fix. Looks like the Ruff target Python version is currently set to 3.10.
I ran Ruff because Home Assistant core requires it, but I don't see it in either of the READMEs. Should it be used?
There was a problem hiding this comment.
I reverted this change.
| | `entity_id` | The `entity_id` of the switch with the settings to apply. 📝 | ✅ | list of `entity_id`s | | ||
| | `lights` | A light (or list of lights) to apply the settings to. 💡 | ❌ | list of `entity_id`s | | ||
| | `transition` | Duration of transition when lights change, in seconds. 🕑 | ❌ | `float` 0-6553 | | ||
| | `transition` | Duration of transition when lights change, in seconds. 🕑 | ✅ | `float` 0-6553 | |
There was a problem hiding this comment.
Why did you make it a required attribute?
There was a problem hiding this comment.
This was unintentional, I think related to initial_transition not being present for apply_service_schema. The default is now None in the schema - will that cause any issues?
- Move 'apply' and 'set_manual_control' service registration from async_setup_entry to async_setup. - Move service handlers to module-level functions in switch.py. - Update apply_service_schema to support dynamic defaults for transition duration. - Clean up related unused imports and fix Python 3.10 syntax compatibility.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
0020cdd to
d3190be
Compare
d3190be to
9c3f4ab
Compare
|
Sorry it took me so long to get to this. I've been a bit overwhelmed by the number of AI-assisted PRs opened here recently, and I've also been spending nearly every spare hour on my biggest project so far, MindRoom. I'm very supportive of using AI for coding, but many of these PRs still need careful human review because even plausible-looking changes can introduce subtle breakage. That backlog made me postpone reviewing them for a while. I've now done a batch review with Codex / GPT-5.5 (xhigh). This comment is AI-assisted, but I've reviewed it before posting. The Bronze-tier service-action direction is useful, but this branch is conflict-heavy against current I do not want to merge or deeply review this version as-is because the integration setup path has changed since this branch was opened. Please rebase onto current |
|
Follow-up from a deeper Codex / GPT-5.5 (xhigh) pass. The move toward global service-action registration makes sense for Bronze compliance, but the new vol.Optional(CONF_ENTITY_ID): cv.entity_idsFor Please make the target requirement explicit in |
Addresses a point from #1195.