Climate component: add supported_features (#10658)
* Implement supported_features for the climate component * Test supported features * Convert generic thermostat to supported features * Max / min temperature are not features * Fix lint * Min / max humidity are not features * Linting * Remove current temperature / humidity * Move c-hacker-style constants to boring integers. Booo! * Refactor all the climate platforms to use the new supported_features * Force all climate platforms to implement supported_features * Fix mistakes * Adapt hive platform * Move flags into a constant * Calm the hound
This commit is contained in:
1 parent
59fa4f18e4
commit
373508693a
28 files changed
+370
-34
No files matched your search
@@ -51,6 +51,19 @@ STATE_HIGH_DEMAND = 'high_demand'
|
||||
STATE_HEAT_PUMP = 'heat_pump'
|
||||
STATE_GAS = 'gas'
|
||||
|
||||
SUPPORT_TARGET_TEMPERATURE = 1
|
||||
SUPPORT_TARGET_TEMPERATURE_HIGH = 2
|
||||
SUPPORT_TARGET_TEMPERATURE_LOW = 4
|
||||
SUPPORT_TARGET_HUMIDITY = 8
|
||||
SUPPORT_TARGET_HUMIDITY_HIGH = 16
|
||||
SUPPORT_TARGET_HUMIDITY_LOW = 32
|
||||
SUPPORT_FAN_MODE = 64
|
||||
SUPPORT_OPERATION_MODE = 128
|
||||
SUPPORT_HOLD_MODE = 256
|
||||
SUPPORT_SWING_MODE = 512
|
||||
SUPPORT_AWAY_MODE = 1024
|
||||
SUPPORT_AUX_HEAT = 2048
|
||||
|
||||
ATTR_CURRENT_TEMPERATURE = 'current_temperature'
|
||||
ATTR_MAX_TEMP = 'max_temp'
|
||||
ATTR_MIN_TEMP = 'min_temp'
|
||||
@@ -717,6 +730,11 @@ class ClimateDevice(Entity):
|
||||
"""
|
||||
return self.hass.async_add_job(self.turn_aux_heat_off)
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
"""Return the list of supported features."""
|
||||
raise NotImplementedError()
|
||||
|
||||
@property
|
||||
def min_temp(self):
|
||||
"""Return the minimum temperature."""
|
||||
|
||||
Reference in new issue
Block a user