Skip to content

Commit

Permalink
Air Humidifier CA1: Fix led brightness command (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi authored Jan 7, 2019
1 parent 05f55bc commit 2774aa5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions miio/airhumidifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ def set_mode(self, mode: OperationMode):
)
def set_led_brightness(self, brightness: LedBrightness):
"""Set led brightness."""
if self.model == MODEL_HUMIDIFIER_CA1:
return self.send("set_led_b", [str(brightness.value)])

return self.send("set_led_b", [brightness.value])

@command(
Expand Down
2 changes: 1 addition & 1 deletion miio/tests/test_airhumidifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def __init__(self, *args, **kwargs):
'get_prop': self._get_state,
'set_power': lambda x: self._set_state("power", x),
'set_mode': lambda x: self._set_state("mode", x),
'set_led_b': lambda x: self._set_state("led_b", x),
'set_led_b': lambda x: self._set_state("led_b", [int(x[0])]),
'set_buzzer': lambda x: self._set_state("buzzer", x),
'set_child_lock': lambda x: self._set_state("child_lock", x),
'set_limit_hum': lambda x: self._set_state("limit_hum", x),
Expand Down

0 comments on commit 2774aa5

Please sign in to comment.