Skip to content

Commit

Permalink
Aqara cube fixes (#1893)
Browse files Browse the repository at this point in the history
* Add 'deactivated_face' to aqgl01 FLIP events

* fix typos in aqara cube movement descriptions
  • Loading branch information
travipross authored Nov 5, 2022
1 parent 57ff3d6 commit c2de1b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions zhaquirks/xiaomi/aqara/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@
SLIDE_1_VALUE: "aqara logo on top",
SLIDE_2_VALUE: "aqara logo facing user rotated 90 degrees right",
SLIDE_3_VALUE: "aqara logo facing user upside down",
SLIDE_4_VALUE: "arara logo on bottom",
SLIDE_4_VALUE: "aqara logo on bottom",
SLIDE_5_VALUE: "aqara logo facing user rotated 90 degrees left",
SLIDE_6_VALUE: "aqara logo facing user upright",
KNOCK_1_VALUE: "aqara logo on top",
KNOCK_2_VALUE: "aqara logo facing user rotated 90 degrees right",
KNOCK_3_VALUE: "aqara logo facing user upside down",
KNOCK_4_VALUE: "arara logo on bottom",
KNOCK_4_VALUE: "aqara logo on bottom",
KNOCK_5_VALUE: "aqara logo facing user rotated 90 degrees left",
KNOCK_6_VALUE: "aqara logo facing user upright",
}
Expand Down
6 changes: 4 additions & 2 deletions zhaquirks/xiaomi/aqara/cube_aqgl01.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
)

ACTIVATED_FACE = "activated_face"
DEACTIVATED_FACE = "deactivated_face"
DESCRIPTION = "description"
DROP = "drop"
DROP_VALUE = 3
Expand Down Expand Up @@ -116,13 +117,13 @@
SLIDE_1_VALUE: "aqara logo on top",
SLIDE_2_VALUE: "aqara logo facing user rotated 90 degrees right",
SLIDE_3_VALUE: "aqara logo facing user upside down",
SLIDE_4_VALUE: "arara logo on bottom",
SLIDE_4_VALUE: "aqara logo on bottom",
SLIDE_5_VALUE: "aqara logo facing user rotated 90 degrees left",
SLIDE_6_VALUE: "aqara logo facing user upright",
KNOCK_1_VALUE: "aqara logo on top",
KNOCK_2_VALUE: "aqara logo facing user rotated 90 degrees right",
KNOCK_3_VALUE: "aqara logo facing user upside down",
KNOCK_4_VALUE: "arara logo on bottom",
KNOCK_4_VALUE: "aqara logo on bottom",
KNOCK_5_VALUE: "aqara logo facing user rotated 90 degrees left",
KNOCK_6_VALUE: "aqara logo facing user upright",
}
Expand Down Expand Up @@ -180,6 +181,7 @@ def _update_attribute(self, attrid, value):
event_args[FLIP_DEGREES] = 180
else:
event_args[FLIP_DEGREES] = 90
event_args[DEACTIVATED_FACE] = (value // 8) % 8 + 1
event_args[ACTIVATED_FACE] = int((value % 8) + 1)

self.listener_event(ZHA_SEND_EVENT, action, event_args)
Expand Down

0 comments on commit c2de1b2

Please sign in to comment.