Skip to content

Commit

Permalink
Merge pull request #162 from kitprice/kitprice-patch-warning
Browse files Browse the repository at this point in the history
Fix warning message for implicitly supporting turn_on/off methods in HVACModes
  • Loading branch information
natekspencer authored Dec 19, 2024
2 parents d6734c1 + 587d356 commit fcde0d0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions custom_components/vivint/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ class VivintClimate(VivintEntity, ClimateEntity):
ClimateEntityFeature.TARGET_TEMPERATURE
| ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
| ClimateEntityFeature.FAN_MODE
| ClimateEntityFeature.TURN_ON
| ClimateEntityFeature.TURN_OFF
)
_attr_temperature_unit = UnitOfTemperature.CELSIUS
_enable_turn_on_off_backwards_compatibility = False

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

async def async_turn_on(self) -> None:
"""Turn the entity on."""
await self.async_set_hvac_mode(HVACMode.HEAT_COOL)

async def async_turn_off(self) -> None:
"""Turn the entity off."""
await self.async_set_hvac_mode(HVACMode.OFF)

async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
temp = kwargs.get(ATTR_TEMPERATURE)
Expand Down

0 comments on commit fcde0d0

Please sign in to comment.