Adjust set_hvac_mode type hint in ClimateEntity (#70658)

* Adjust set_hvac_mode type hint in ClimateEntity

* Remove override
This commit is contained in:
epenet 2022-04-25 13:16:02 +02:00 committed by GitHub
parent d22a679262
commit a75daab33f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View file

@ -463,11 +463,11 @@ class ClimateEntity(Entity):
"""Set new target fan mode.""" """Set new target fan mode."""
await self.hass.async_add_executor_job(self.set_fan_mode, fan_mode) await self.hass.async_add_executor_job(self.set_fan_mode, fan_mode)
def set_hvac_mode(self, hvac_mode: HVACMode | str) -> None: def set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set new target hvac mode.""" """Set new target hvac mode."""
raise NotImplementedError() raise NotImplementedError()
async def async_set_hvac_mode(self, hvac_mode: HVACMode | str) -> None: async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set new target hvac mode.""" """Set new target hvac mode."""
await self.hass.async_add_executor_job(self.set_hvac_mode, hvac_mode) await self.hass.async_add_executor_job(self.set_hvac_mode, hvac_mode)

View file

@ -98,9 +98,7 @@ class GeniusClimateZone(GeniusHeatingZone, ClimateEntity):
return [PRESET_ACTIVITY, PRESET_BOOST] return [PRESET_ACTIVITY, PRESET_BOOST]
return [PRESET_BOOST] return [PRESET_BOOST]
async def async_set_hvac_mode( # type:ignore[override] async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
self, hvac_mode: HVACMode
) -> None:
"""Set a new hvac mode.""" """Set a new hvac mode."""
await self._zone.set_mode(HA_HVAC_TO_GH.get(hvac_mode)) await self._zone.set_mode(HA_HVAC_TO_GH.get(hvac_mode))