Skip to content

Commit

Permalink
💦 add mode_property option for humidifier (#1421)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Dec 16, 2023
1 parent 9cf54b4 commit c1a4d7d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions custom_components/xiaomi_miot/humidifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,11 @@ def __init__(self, config: dict, miot_service: MiotService):
self._prop_target_humi = self._environment.get_property('target_humidity') or self._prop_target_humi
self._prop_humidity = self._environment.get_property('relative_humidity', 'humidity') or self._prop_humidity

self._prop_mode = None
self._mode_props = list(filter(lambda x: x, [
miot_service.get_property('mode'),
miot_service.get_property('fan_level'),
]))
if self._mode_props:
self._prop_mode = self._mode_props.pop(0)
self._prop_mode = self._mode_props[0] if self._mode_props else None
if prop := self.custom_config('mode_property'):
if prop := self._miot_service.spec.get_property(prop):
self._prop_mode = prop
Expand Down

0 comments on commit c1a4d7d

Please sign in to comment.