Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds TS0044F Tuya device #385

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ PRERELEASE_NOTE
## :wrench: Refactor
-->

<!--
## :video_game: New devices

- [WXKG06LM](https://xaviml.github.io/controllerx/controllers/WXKG06LM) - add Z2M and deCONZ support
- [W2049](https://xaviml.github.io/controllerx/controllers/W2049) - add ZHA support @patrezp [#375]
-->
- [TS0044F](https://xaviml.github.io/controllerx/controllers/TS0044F) - add Z2M support
10 changes: 10 additions & 0 deletions apps/controllerx/cx_devices/tuya.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,13 @@ def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
"4_double": Light.CLICK_BRIGHTNESS_UP,
"4_hold": Light.CLICK_BRIGHTNESS_DOWN,
}


class TS0044FLightController(LightController):
def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
return {
"on": Light.TOGGLE,
"off": Light.TOGGLE,
"brightness_step_up": Light.CLICK_BRIGHTNESS_UP,
"brightness_step_down": Light.CLICK_BRIGHTNESS_DOWN,
}
28 changes: 28 additions & 0 deletions docs/_data/controllers/TS0044F.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: TS0044F (TuYa)
device_support:
- type: Light
domain: light
controller: TS0044FLightController
delay: 350
mapping:
- "Click top left → Toggle"
- "Click top right → Brighten up (1 step)"
- "Click bottom left → Toggle"
- "Click bottom right → Dim down (1 step)"
integrations:
- name: Zigbee2MQTT
codename: z2m
actions:
- on → Click top left
- brightness_step_up → Click top right
- off → Click bottom left
- brightness_step_down → Click top right
note: >-
This device is very similar to the TS0044 Tuya, except that it doesn't hold action, double clicks.
Note that each button perform the same actions.
This is because ControllerX is design to control just one entity (light or media player).
So you can include the `actions` parameter to include the actions needed,
or use the `mapping` attribute to define a <a href="/controllerx/advanced/custom-controllers">custom mapping</a>.
You can check <a href="https://github.com/xaviml/controllerx/issues/18#issuecomment-582535634">here</a> for reference.
Also, this controller doesn't support hold action. This means that there is not
smooth brightness changes when holding, just step by step everytime it's pressed.
Binary file added docs/assets/img/TS0044F.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/TS0044F.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: controller
title: TS0044F (TuYa)
device: TS0044F
---