Skip to content

Commit

Permalink
STYJ02YM: Add support to switch button LEDs on/off
Browse files Browse the repository at this point in the history
  • Loading branch information
rumpeltux committed Nov 27, 2019
1 parent 399a2bf commit 418e7e2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions miio/viomivacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ class ViomiLanguage(Enum):
EN = 2 # English


class ViomiLedState(Enum):
Off = 0
On = 1


class ViomiVacuumStatus:
def __init__(self, data):
# ["run_state","mode","err_state","battary_life","box_type","mop_type","s_time","s_area",
Expand Down Expand Up @@ -213,3 +218,10 @@ def set_dnd(self, disable: bool, start_hr: int, start_min: int, end_hr: int, end
def set_language(self, language: ViomiLanguage):
"""Set the device's audio language."""
return self.send("set_language", [language.value])

@command(
click.argument('state', type=EnumType(ViomiLedState, False))
)
def led(self, state: ViomiLedState):
"""Switch the button leds on or off."""
return self.send("set_light", [state.value])

0 comments on commit 418e7e2

Please sign in to comment.