-
Notifications
You must be signed in to change notification settings - Fork 915
Add Tuya MoesBHT6 thermostat _TZE204_u9bfwha0 #4461
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
Open
0anton
wants to merge
7
commits into
zigpy:dev
Choose a base branch
from
0anton:dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+745
−2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds support for _TZE204_u9bfwha0 Moes BHT-006GBZB electric floor heating thermostat. This variant uses a single mode attribute instead of separate manual/schedule attributes and includes endpoint 242 with GreenPowerProxy support.
Apply ruff formatting and fix linting issues: - Merge multiple attribute comparisons using tuple membership - Fix docstring to use imperative mood - Alphabetize imports
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4461 +/- ##
==========================================
+ Coverage 92.24% 92.32% +0.08%
==========================================
Files 369 369
Lines 12094 12187 +93
==========================================
+ Hits 11156 11252 +96
+ Misses 938 935 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add test coverage for the new MoesBHT6 quirk including: - Temperature and target temperature reporting - Mode reporting (manual/scheduled) - System mode reporting (on/off) - Running state reporting (heating/idle) - Attribute writing (setpoint, system mode, programming mode) These tests follow the same pattern as existing MoesBHT tests and should significantly improve code coverage for the new quirk.
Add test coverage for the custom command() method in MoesBHT6ManufCluster that handles on/off commands. This improves coverage from 70% to 73%.
Adds 6 new test functions to improve coverage from 73% to 82%: - Setpoint rounding with various boundary values (half-steps, extremes) - Error handling for unsupported system modes (Cool, Auto) - Error handling for unsupported programming modes - Error handling for unsupported running states (Cool_State_On) - Error handling for unsupported running modes (Cool) - Program change with various mode strings All error branches now exercised and verified to log errors correctly.
Test child lock on/off reporting through UI cluster to improve coverage to 83%. Verifies child_lock attribute updates correctly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds support for _TZE204_u9bfwha0 Moes BHT-006GBZB electric floor heating thermostat. This variant uses a single mode attribute
instead of separate manual/schedule attributes and includes endpoint 242 with GreenPowerProxy support.
It builds on contribution created in #2627 and follows the successful support
of the same device in z2m with Koenkk/zigbee-herdsman-converters#6369.
Proposed change
This PR adds support for the Tuya electric floor heating thermostat
_TZE204_u9bfwha0(Moes BHT-006GBZB model TS0601) tozhaquirks/tuya/ts0601_electric_heating.py.Implementation details:
The quirk includes four new classes:
MoesBHT6ManufCluster- Manufacturer-specific cluster with custom command handling for on/off operations via command_busMoesBHT6Thermostat- Thermostat cluster that maps ZCL attributes to Tuya-specific valuesMoesBHT6UserInterface- User interface cluster for child lock functionalityMoesBHT6- Main device quirk with signature matching for_TZE204_u9bfwha0Key differences from existing MoesBHT quirk:
Supported features:
Additional information
Fixes #2627
This implementation is based on the successful integration in zigbee2mqtt:
Koenkk/zigbee-herdsman-converters#6369
The device signature shows it presents as a Smart Plug (device_type=81) but is replaced with a Thermostat device type in the quirk
replacement configuration.
Device diagnostics are attached from the original issue report for the _TZE200_u9bfwha0 variant (TZE200 vs TZE204 are typically
firmware variations of the same hardware).
Device diagnostics
zha-01JWS5EQDD5DRF54AD0BCKK3M1-_TZE200_u9bfwha0 TS0601-98e0276de7d342b7d929f0ada449640c.json
Checklist
pre-commitchecks pass / the code has been formatted using Black