-
-
Notifications
You must be signed in to change notification settings - Fork 197
Register service actions in async_setup for Bronze tier compliance #1403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted this change.
README.md
Outdated
| | `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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you make it a required attribute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Addresses a point from #1195.