-
-
Notifications
You must be signed in to change notification settings - Fork 36k
Refactor Shelly number platform to use upstream set_thermostat_state #157527
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 @bieniu, @chemelli74, @bdraco, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
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 refactors the Shelly number platform to use the upstream library's set_thermostat_state method instead of making direct HTTP requests. This simplifies the code by leveraging functionality already provided by the aioshelly library.
Key changes:
- Replaced direct HTTP requests (
http_request) with the upstream library'sset_thermostat_statemethod - Removed now-unnecessary
rest_pathandrest_argfields fromBlockNumberDescriptiondataclass - Simplified
async_set_native_valuemethod by removing the_set_state_full_pathhelper function
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
homeassistant/components/shelly/number.py |
Refactored to use upstream set_thermostat_state method, removed HTTP request-related fields from description class, simplified error handling flow |
tests/components/shelly/test_number.py |
Updated test assertions and mocks to verify calls to set_thermostat_state instead of http_request |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
bieniu
left a comment
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.
Looks good 👍
|
Thanks @bieniu @chemelli74 👍 |
Proposed change
SSIA
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: