Skip to content

Commit

Permalink
Add indicator led support of the chuangmi.remote.h102a03
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Apr 14, 2019
1 parent 09500e8 commit 4238069
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions miio/chuangmi_ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,27 @@ def play(self, command: str):

return play_method(command, *command_args)

@command(
click.argument("indicator_led", type=bool),
default_output=format_output(
lambda indicator_led: "Turning on indicator LED"
if indicator_led else "Turning off indicator LED"
)
)
def set_indicator_led(self, indicator_led: bool):
"""Set the indicator led on/off."""
if indicator_led:
return self.send("set_indicatorLamp", ["on"])
else:
return self.send("set_indicatorLamp", ["off"])

@command(
default_output=format_output("Indicator LED status: {result}"),
)
def get_indicator_led(self):
"""Get the indicator led status."""
return self.send("get_indicatorLamp")


class ProntoPulseAdapter(Adapter):
def _decode(self, obj, context, path):
Expand Down

0 comments on commit 4238069

Please sign in to comment.