diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 0251344c..8253a593 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -26,8 +26,6 @@ PRERELEASE_NOTE - Refactor some internal code to allow feature #204 - +- [E1E-G7F](https://xaviml.github.io/controllerx/controllers/E1EG7F) - add Z2M support [ #355 ] diff --git a/apps/controllerx/controllerx.py b/apps/controllerx/controllerx.py index 2bb41c5e..04ed6f78 100644 --- a/apps/controllerx/controllerx.py +++ b/apps/controllerx/controllerx.py @@ -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 * diff --git a/apps/controllerx/cx_devices/sengled.py b/apps/controllerx/cx_devices/sengled.py new file mode 100644 index 00000000..fa76b56f --- /dev/null +++ b/apps/controllerx/cx_devices/sengled.py @@ -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, + } diff --git a/docs/_data/controllers/E1EG7F.yml b/docs/_data/controllers/E1EG7F.yml new file mode 100644 index 00000000..ce11fcac --- /dev/null +++ b/docs/_data/controllers/E1EG7F.yml @@ -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"' diff --git a/docs/assets/img/E1EG7F.jpeg b/docs/assets/img/E1EG7F.jpeg new file mode 100644 index 00000000..d54277d5 Binary files /dev/null and b/docs/assets/img/E1EG7F.jpeg differ diff --git a/docs/controllers/E1EG7F.md b/docs/controllers/E1EG7F.md new file mode 100644 index 00000000..5581a2e5 --- /dev/null +++ b/docs/controllers/E1EG7F.md @@ -0,0 +1,5 @@ +--- +layout: controller +title: E1E-G7F (Sengled) +device: E1EG7F +---