Skip to content

Commit

Permalink
feat(device): add Z2M support for E1E-G7F
Browse files Browse the repository at this point in the history
related to #355
  • Loading branch information
xaviml committed Sep 8, 2021
1 parent 6e93dda commit e3b3d1c
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 3 deletions.
4 changes: 1 addition & 3 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ PRERELEASE_NOTE

- Refactor some internal code to allow feature #204

<!--
## :video_game: New devices

- [ZS230002](https://xaviml.github.io/controllerx/controllers/ZS230002) - add Z2M support [ #347 ] @kloodhu
-->
- [E1E-G7F](https://xaviml.github.io/controllerx/controllers/E1EG7F) - add Z2M support [ #355 ]
1 change: 1 addition & 0 deletions apps/controllerx/controllerx.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from cx_devices.osram import *
from cx_devices.phillips import *
from cx_devices.rgb_genie import *
from cx_devices.sengled import *
from cx_devices.smartthings import *
from cx_devices.sonoff import *
from cx_devices.terncy import *
Expand Down
18 changes: 18 additions & 0 deletions apps/controllerx/cx_devices/sengled.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from cx_const import DefaultActionsMapping, Light
from cx_core import LightController


class E1EG7FLightController(LightController):
def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
return {
"on": Light.ON,
"on_long": Light.CLICK_COLOR_UP,
"on_double": Light.ON_FULL_COLOR_TEMP,
"up": Light.CLICK_BRIGHTNESS_UP,
"up_long": Light.ON_FULL_BRIGHTNESS,
"down": Light.CLICK_BRIGHTNESS_DOWN,
"down_long": Light.ON_MIN_BRIGHTNESS,
"off": Light.OFF,
"off_long": Light.CLICK_COLOR_DOWN,
"off_double": Light.ON_MIN_COLOR_TEMP,
}
31 changes: 31 additions & 0 deletions docs/_data/controllers/E1EG7F.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: E1E-G7F (Sengled)
device_support:
- type: Light
domain: light
controller: E1EG7FLightController
delay: 350
mapping:
- 'Click "ON" → Turn on'
- 'Hold "ON" → Color temp up / Right color wheel (1 step)'
- 'Double click "ON" → Full color temp'
- "Click 🔆 → Brighten up (1 step)"
- "Hold 🔆→ Full brightness"
- "Click 🔅 → Dim down (1 step)"
- "Hold 🔅 → Min brightness"
- 'Click "OFF" → Turn off'
- 'Hold "OFF" → Color temp down / Left color wheel (1 step)'
- 'Double click "OFF" → Min color temp'
integrations:
- name: Zigbee2MQTT
codename: z2m
actions:
- '"on" → Click "ON"'
- 'on_long → Hold "ON"'
- 'on_double → Double click "ON"'
- 'up → Click 🔆'
- 'up_long → Hold 🔆'
- 'down → Click 🔅'
- 'down_long → Hold 🔅'
- '"off" → Click "OFF"'
- 'off_long → Hold "OFF"'
- 'off_double → Double click "OFF"'
Binary file added docs/assets/img/E1EG7F.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/E1EG7F.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: controller
title: E1E-G7F (Sengled)
device: E1EG7F
---

0 comments on commit e3b3d1c

Please sign in to comment.