Skip to content

Commit fcde0d0

Browse files
authored
Merge pull request #162 from kitprice/kitprice-patch-warning
Fix warning message for implicitly supporting turn_on/off methods in HVACModes
2 parents d6734c1 + 587d356 commit fcde0d0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

custom_components/vivint/climate.py

+11
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,11 @@ class VivintClimate(VivintEntity, ClimateEntity):
123123
ClimateEntityFeature.TARGET_TEMPERATURE
124124
| ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
125125
| ClimateEntityFeature.FAN_MODE
126+
| ClimateEntityFeature.TURN_ON
127+
| ClimateEntityFeature.TURN_OFF
126128
)
127129
_attr_temperature_unit = UnitOfTemperature.CELSIUS
130+
_enable_turn_on_off_backwards_compatibility = False
128131

129132
def __init__(self, device: Thermostat, hub: VivintHub) -> None:
130133
"""Pass coordinator to CoordinatorEntity."""
@@ -216,6 +219,14 @@ async def async_set_hvac_mode(self, hvac_mode: str) -> None:
216219
**{ThermostatAttribute.OPERATING_MODE: VIVINT_HVAC_INV_MODE_MAP[hvac_mode]}
217220
)
218221

222+
async def async_turn_on(self) -> None:
223+
"""Turn the entity on."""
224+
await self.async_set_hvac_mode(HVACMode.HEAT_COOL)
225+
226+
async def async_turn_off(self) -> None:
227+
"""Turn the entity off."""
228+
await self.async_set_hvac_mode(HVACMode.OFF)
229+
219230
async def async_set_temperature(self, **kwargs: Any) -> None:
220231
"""Set new target temperature."""
221232
temp = kwargs.get(ATTR_TEMPERATURE)

0 commit comments

Comments
 (0)