Skip to content

Commit

Permalink
👕 improve for minij.washer.v20 (#1862)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Sep 17, 2024
1 parent f7988a8 commit 5166dc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions custom_components/xiaomi_miot/core/device_customizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,10 @@
'miio_cloud_props': 'Status,Position',
'miio_cloud_props_template': 'midr_rv_mirror_cloud_props',
},
'minij.washer.v20': {
'descriptions_for_on': 'Busy,Delay,Run',
'descriptions_for_off': 'Off,Standby,Idle,Pause,Paused,Completed,Fault,END,E6',
},
'mmgg.feeder.fi1': {
'chunk_properties': 1,
'state_property': 'pet_food_left_level',
Expand Down
7 changes: 5 additions & 2 deletions custom_components/xiaomi_miot/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,11 @@ def __init__(self, parent, miot_property: MiotProperty, option=None):
self._name = self.format_name_by_property(miot_property)
self._miot_property = miot_property
self._miot_service = miot_property.service
self._values_on = miot_property.list_search('Busy', 'Delay')
self._values_off = miot_property.list_search('Off', 'Idle', 'Pause', 'Paused', 'Completed', 'Fault')

descriptions_on = self.custom_config_list('descriptions_for_on') or ['Busy', 'Delay']
self._values_on = miot_property.list_search(*descriptions_on)
descriptions_off = self.custom_config_list('descriptions_for_off') or ['Off', 'Idle', 'Pause', 'Paused', 'Completed', 'Fault']
self._values_off = miot_property.list_search(*descriptions_off)

def update(self, data=None):
super().update(data)
Expand Down

0 comments on commit 5166dc3

Please sign in to comment.