8000 [cover] Update components to use ``cover_schema(...)`` by jesserockz · Pull Request #8770 · esphome/esphome · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[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

Merged
merged 1 commit into from
May 13, 2025
Merged

Conversation

jesserockz
Copy link
Member

What does this implement/fix?

Followup to #8747 and #8748

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code quality improvements to existing code or addition of tests
  • Other

Related issue or feature (if applicable):

  • fixes

Pull request in esphome-docs with documentation (if applicable):

  • esphome/esphome-docs#

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx

Example entry for config.yaml:

# Example config.yaml

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@probot-esphome
Copy link

Hey there @OttoWinter, mind taking a look at this pull request as it has been labeled with an integration (copy) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@probot-esphome
Copy link

Hey there @djwmarcx, mind taking a look at this pull request as it has been labeled with an integration (current_based) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@probot-esphome
Copy link

Hey there @clydebarrow, mind taking a look at this pull request as it has been labeled with an integration (he60r) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@probot-esphome
Copy link

Hey there @ianchi, mind taking a look at this pull request as it has been labeled with an integration (feedback) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@probot-esphome
Copy link

Hey there @ti-mo, mind taking a look at this pull request as it has been labeled with an integration (tormatic) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@probot-esphome
Copy link

Hey there @buxtronix, mind taking a look at this pull request as it has been labeled with an integration (am43) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

Copy link
Contributor
@Copilot Copilot AI left a 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(...) with cover.cover_schema(ComponentClass).extend(...)
  • Swap manual cg.new_Pvariable + cover.register_cover in to_code for await 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 using cover.new_cover(config) to ensure the migration from cg.new_Pvariable and cover.register_cover behaves as expected.
var = await cover.new_cover(config)

@kbx81 kbx81 merged commit a36e1aa into dev May 13, 2025
45 checks passed
@kbx81 kbx81 deleted the jesserockz-2025-141 branch May 13, 2025 05:29
@jesserockz jesserockz mentioned this pull request May 13, 2025
@jesserockz jesserockz mentioned this pull request May 21, 2025
sa-crespo pushed a commit to sa-crespo/esphome that referenced this pull request May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0