mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Use async_write_ha_state in generic hygrostat (#91331)
This commit is contained in:
parent
4a0988eb5d
commit
208a44e437
@ -270,7 +270,7 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity):
|
|||||||
return
|
return
|
||||||
self._state = True
|
self._state = True
|
||||||
await self._async_operate(force=True)
|
await self._async_operate(force=True)
|
||||||
await self.async_update_ha_state()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
async def async_turn_off(self, **kwargs):
|
async def async_turn_off(self, **kwargs):
|
||||||
"""Turn hygrostat off."""
|
"""Turn hygrostat off."""
|
||||||
@ -279,7 +279,7 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity):
|
|||||||
self._state = False
|
self._state = False
|
||||||
if self._is_device_active:
|
if self._is_device_active:
|
||||||
await self._async_device_turn_off()
|
await self._async_device_turn_off()
|
||||||
await self.async_update_ha_state()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
async def async_set_humidity(self, humidity: int) -> None:
|
async def async_set_humidity(self, humidity: int) -> None:
|
||||||
"""Set new target humidity."""
|
"""Set new target humidity."""
|
||||||
@ -288,12 +288,12 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity):
|
|||||||
|
|
||||||
if self._is_away and self._away_fixed:
|
if self._is_away and self._away_fixed:
|
||||||
self._saved_target_humidity = humidity
|
self._saved_target_humidity = humidity
|
||||||
await self.async_update_ha_state()
|
self.async_write_ha_state()
|
||||||
return
|
return
|
||||||
|
|
||||||
self._target_humidity = humidity
|
self._target_humidity = humidity
|
||||||
await self._async_operate()
|
await self._async_operate()
|
||||||
await self.async_update_ha_state()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def min_humidity(self):
|
def min_humidity(self):
|
||||||
@ -329,7 +329,7 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity):
|
|||||||
|
|
||||||
await self._async_update_humidity(new_state.state)
|
await self._async_update_humidity(new_state.state)
|
||||||
await self._async_operate()
|
await self._async_operate()
|
||||||
await self.async_update_ha_state()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
async def _async_sensor_not_responding(self, now=None):
|
async def _async_sensor_not_responding(self, now=None):
|
||||||
"""Handle sensor stale event."""
|
"""Handle sensor stale event."""
|
||||||
@ -471,4 +471,4 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity):
|
|||||||
)
|
)
|
||||||
await self._async_operate(force=True)
|
await self._async_operate(force=True)
|
||||||
|
|
||||||
await self.async_update_ha_state()
|
self.async_write_ha_state()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user