Skip to content

Commit

Permalink
👕 add support washer action
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Feb 4, 2021
1 parent ba0405c commit 36cf8a4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions custom_components/xiaomi_miot/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 36cf8a4

Please sign in to comment.