Repository navigation
Make the HVAC action sensor an enum sensor with options - #1013
Open
zigpy-review-bot wants to merge 1 commit into
Open
zigpy-review-bot wants to merge 1 commit into
zigpy-review-bot wants to merge 1 commit into
Conversation
Set the ENUM device class and expose the HVACAction values as options on ThermostatHVACAction (and SinopeHVACAction), so Home Assistant knows the possible states.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1013 +/- ##
=======================================
Coverage 97.48% 97.49%
=======================================
Files 61 61
Lines 10870 10878 +8
=======================================
+ Hits 10597 10605 +8
Misses 273 273 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
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.
Summary
The thermostat HVAC action sensor (
ThermostatHVACAction, andSinopeHVACActionwhich subclasses it) reportedHVACActionstring states but was a plain sensor, so Home Assistant didn't know the possible states. It is now an enum sensor whose options are theHVACActionvalues (cooling,defrosting,drying,fan,heating,idle,off,preheating).Fixes #1012
Changes
ThermostatHVACActiongetsSensorDeviceClass.ENUMand anoptionsproperty, and exposes them throughEnumSensorState.EnumSensorisn't reused as a base because its options are enum names and its formatter maps ints to names; the options here are the lowercase values.device_class: null → "enum"and the addedoptionslist.Testing
test_climate_hvac_action_running_state.