Fix Xiaomi-miio humidifier write the state back when turning on or off (#53771)

This commit is contained in:
Jan Bouwhuis
2021-07-30 21:47:55 +02:00
committed by Paulus Schoutsen
parent 0aee659ee9
commit 958df580a9

View File

@@ -139,6 +139,7 @@ class XiaomiGenericHumidifier(XiaomiCoordinatedMiioEntity, HumidifierEntity):
) )
if result: if result:
self._state = True self._state = True
self.async_write_ha_state()
async def async_turn_off(self, **kwargs) -> None: async def async_turn_off(self, **kwargs) -> None:
"""Turn the device off.""" """Turn the device off."""
@@ -148,6 +149,7 @@ class XiaomiGenericHumidifier(XiaomiCoordinatedMiioEntity, HumidifierEntity):
if result: if result:
self._state = False self._state = False
self.async_write_ha_state()
def translate_humidity(self, humidity): def translate_humidity(self, humidity):
"""Translate the target humidity to the first valid step.""" """Translate the target humidity to the first valid step."""