diff --git a/custom_components/xiaomi_miot/switch.py b/custom_components/xiaomi_miot/switch.py index 4c85042d6..fedf83feb 100644 --- a/custom_components/xiaomi_miot/switch.py +++ b/custom_components/xiaomi_miot/switch.py @@ -111,6 +111,16 @@ async def async_update(self): self._subs[p.name] = MiotWasherSubEntity(self, p) add_fans([self._subs[p.name]]) + add_switches = self._add_entities.get(ENTITY_DOMAIN) + if self._miot_service.get_action('start_wash', 'pause'): + pnm = 'action' + prop = self._miot_service.get_property('status') + if pnm in self._subs: + self._subs[pnm].update() + elif add_switches and prop: + self._subs[pnm] = MiotWasherActionSubEntity(self, prop) + add_switches([self._subs[pnm]]) + class SwitchSubEntity(ToggleSubEntity, SwitchEntity): def update(self):