-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[cover] Update components to use cover_schema(...)
#8770
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
Conversation
Hey there @OttoWinter, mind taking a look at this pull request as it has been labeled with an integration ( |
Hey there @djwmarcx, mind taking a look at this pull request as it has been labeled with an integration ( |
Hey there @clydebarrow, mind taking a look at this pull request as it has been labeled with an integration ( |
Hey there @ianchi, mind taking a look at this pull request as it has been labeled with an integration ( |
Hey there @ti-mo, mind taking a look at this pull request as it has been labeled with an integration ( |
Hey there @buxtronix, mind taking a look at this pull request as it has been labeled with an integration ( |
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.
Pull Request Overview
This PR migrates existing cover components to use the new cover.cover_schema(...)
helper and the cover.new_cover(config)
API, removing the older cover.COVER_SCHEMA
, manual ID generation, and explicit register_cover
calls.
- Replace
cover.COVER_SCHEMA.extend(...)
withcover.cover_schema(ComponentClass).extend(...)
- Swap manual
cg.new_Pvariable
+cover.register_cover
into_code
forawait cover.new_cover(config)
- Clean up unused imports and streamline schema definitions
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
esphome/components/tuya/cover/init.py | Switched to cover.cover_schema and new_cover API |
esphome/components/tormatic/cover.py | Same migration to new schema and new_cover |
esphome/components/time_based/cover.py | Updated to use cover.cover_schema and new_cover |
esphome/components/template/cover/init.py | Aligned to new schema helper and codegen API |
esphome/components/he60r/cover.py | Migrated to cover.cover_schema and new_cover |
esphome/components/feedback/cover.py | Refactored base schema to use new cover_schema API |
esphome/components/endstop/cover.py | Updated schema and to_code to use new_cover |
esphome/components/current_based/cover.py | Switched to cover.cover_schema and new_cover |
esphome/components/copy/cover/init.py | Migrated to new schema helper and removed old ID API |
esphome/components/am43/cover/init.py | Refactored to use cover.cover_schema and new_cover |
Comments suppressed due to low confidence (1)
esphome/components/tuya/cover/init.py:59
- Add or update unit tests for the new
to_code
path usingcover.new_cover(config)
to ensure the migration fromcg.new_Pvariable
andcover.register_cover
behaves as expected.
var = await cover.new_cover(config)
What does this implement/fix?
Followup to #8747 and #8748
Types of changes
Related issue or feature (if applicable):
Pull request in esphome-docs with documentation (if applicable):
Test Environment
Example entry for
config.yaml
:# Example config.yaml
Checklist:
tests/
folder).If user exposed functionality or configuration variables are added/changed: