Skip to content

Commit

Permalink
Merge branch 'master' of github.com:xaviml/controllerx
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviml committed Feb 18, 2020
2 parents a1d8866 + 9a9b28b commit 016f672
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
24 changes: 24 additions & 0 deletions apps/controllerx/devices/aqara.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,27 @@ def get_z2m_actions_mapping(self):
"hold": Light.HOLD_BRIGHTNESS_TOGGLE,
"release": Light.RELEASE,
}


class MFKZQ01LMLightController(LightController):
"""
This controller allows movement actions for Xiaomi Aqara Smart Cube as
shake, wakeup, fall, slide, flip180 or 90 and rotate_left or right.
Then from the apps.yaml the needed actions can be included and create
different instances for different lights.
"""

# Different states reported from the controller:
# shake, wakeup, fall, tap, slide, flip180
# flip90, rotate_left and rotate_right

def get_z2m_actions_mapping(self):
return {
"shake": Light.ON_MIN_BRIGHTNESS,
"tap": Light.TOGGLE,
"slide": Light.ON_FULL_BRIGHTNESS,
"flip180": Light.CLICK_COLOR_UP,
"flip90": Light.CLICK_COLOR_DOWN,
"rotate_left": Light.CLICK_BRIGHTNESS_DOWN,
"rotate_right": Light.CLICK_BRIGHTNESS_UP,
}
23 changes: 23 additions & 0 deletions docs/_data/controllers/MFKZQ01LM.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: MFKZQ01LM Xiaomi Smart Cube (Aqara)
device_support:
- Light (MFKZQ01LMLightController; 350ms delay)
integrations:
- name: Zigbee2mqtt
codename: z2m
actions:
- "shake 🠖 Shake the cube"
- "wakeup 🠖 Cube automatically wakeup"
- "fall 🠖 From up to down acceleration"
- "tap 🠖 Doble tap in a surface"
- "slide 🠖 Swipe horizontal direction"
- "flip180 🠖 Flip cube 180 degrees"
- "flip90 🠖 Flip cube 90 degrees"
- "rotate_left 🠖 Rotate cube to left"
- "rotate_right 🠖 Rotate cube to right"
note: >-
This controller does not have a self-explained way to use it since its main
purpose is to customize it, this is why we recommend to customize it with
<a href="/controllerx/how-to/custom-controllers">Custom controllers</a>.
However, we gave a default behaviour to this controller. When tapped, it toggles the light.
When shaked it turns the light to minium brightness. When slides it turns the light to maximum brigthness.
When flipped 180/90 if changes the light color. When rotate, it changes the brightness.
Binary file added docs/assets/img/MFKZQ01LM.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/controllers/MFKZQ01LM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: controller
title: Xiaomi Cube (Aqara)
device: MFKZQ01LM
---

0 comments on commit 016f672

Please sign in to comment.