Set TURN_ON and TURN_OFF feature on MQTT climate entities (#109146)
This commit is contained in:
parent
7d2c6a1bb6
commit
6023980c2e
2 changed files with 12 additions and 1 deletions
|
@ -703,7 +703,7 @@ class MqttClimate(MqttTemperatureControlEntity, ClimateEntity):
|
|||
config.get(key), entity=self
|
||||
).async_render
|
||||
|
||||
support = ClimateEntityFeature(0)
|
||||
support = ClimateEntityFeature.TURN_ON | ClimateEntityFeature.TURN_OFF
|
||||
if (self._topic[CONF_TEMP_STATE_TOPIC] is not None) or (
|
||||
self._topic[CONF_TEMP_COMMAND_TOPIC] is not None
|
||||
):
|
||||
|
|
|
@ -121,6 +121,17 @@ async def test_setup_params(
|
|||
assert state.attributes.get("max_temp") == DEFAULT_MAX_TEMP
|
||||
assert state.attributes.get("min_humidity") == DEFAULT_MIN_HUMIDITY
|
||||
assert state.attributes.get("max_humidity") == DEFAULT_MAX_HUMIDITY
|
||||
assert (
|
||||
state.attributes.get("supported_features")
|
||||
== ClimateEntityFeature.TARGET_TEMPERATURE
|
||||
| ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
|
||||
| ClimateEntityFeature.TARGET_HUMIDITY
|
||||
| ClimateEntityFeature.FAN_MODE
|
||||
| ClimateEntityFeature.PRESET_MODE
|
||||
| ClimateEntityFeature.SWING_MODE
|
||||
| ClimateEntityFeature.TURN_OFF
|
||||
| ClimateEntityFeature.TURN_ON
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
Loading…
Add table
Reference in a new issue