Skip to content

Commit

Permalink
💦 improve for humidifier (#1761)
Browse files Browse the repository at this point in the history
* 🔧 fix humidifier mode setting when power is off

* 🔧 allow mode sanity check before turning on
  • Loading branch information
whc2001 authored Jul 14, 2024
1 parent 9c97aa7 commit 390a486
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/xiaomi_miot/humidifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,7 @@ def set_mode(self, mode: str):
val = self._prop_mode.list_value(mode)
if val is None:
return False
if mode != MODE_OFF and not self.is_on:
if not self.turn_on():
return False
return self.set_property(self._prop_mode, val)

0 comments on commit 390a486

Please sign in to comment.