Skip to content

Commit

Permalink
fix rotation directions, add alarm_sound
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Apr 19, 2020
1 parent fff9121 commit 6f3fda7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions miio/chuangmi_camera.py
Expand Up @@ -15,8 +15,8 @@
class Direction(enum.Enum):
"""Rotation direction."""

Right = 1
Left = 2
Left = 1
Right = 2
Up = 3
Down = 4

Expand Down Expand Up @@ -287,4 +287,10 @@ def night_mode_on(self):
default_output=format_output("Rotating to direction '{direction.name}'"),
)
def rotate(self, direction: Direction):
"""Rotate camera to given direction (left, right, up, down)."""
return self.send("set_motor", {"operation": direction.value})

@command()
def alarm(self):
"""Sound a loud alarm for 10 seconds."""
return self.send("alarm_sound")

0 comments on commit 6f3fda7

Please sign in to comment.