Skip to content

Commit

Permalink
Merge branch 'dev' into feature/predefined-actions-with-parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviml authored Jan 9, 2021
2 parents 9c01a8f + 3ab7d9b commit 04c7c08
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
14 changes: 12 additions & 2 deletions apps/controllerx/cx_devices/ikea.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ def get_deconz_actions_mapping(self) -> DefaultActionsMapping:
2003: MediaPlayer.RELEASE,
3001: MediaPlayer.HOLD_VOLUME_DOWN,
3003: MediaPlayer.RELEASE,
4001: MediaPlayer.PREVIOUS_SOURCE,
5001: MediaPlayer.NEXT_SOURCE,
}

def get_zha_actions_mapping(self) -> DefaultActionsMapping:
Expand All @@ -126,6 +128,8 @@ def get_zha_actions_mapping(self) -> DefaultActionsMapping:
"stop": MediaPlayer.RELEASE,
"move_1_83": MediaPlayer.HOLD_VOLUME_DOWN,
"move_1_84": MediaPlayer.HOLD_VOLUME_DOWN, # ZigBee 3.0 firmware
"hold_3329_0": MediaPlayer.PREVIOUS_SOURCE,
"hold_3328_0": MediaPlayer.NEXT_SOURCE,
"release": MediaPlayer.RELEASE,
}

Expand Down Expand Up @@ -440,7 +444,6 @@ def get_deconz_actions_mapping(self) -> DefaultActionsMapping:
1002: Light.ON,
1003: Light.ON_FULL_BRIGHTNESS,
2002: Light.OFF,
2003: Light.ON_MIN_BRIGHTNESS,
}

def get_zha_actions_mapping(self) -> DefaultActionsMapping:
Expand All @@ -462,13 +465,20 @@ def get_zha_actions_mapping(self) -> DefaultActionsMapping:


class E1766CoverController(CoverController):

def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
return {"open": Cover.TOGGLE_OPEN, "close": Cover.TOGGLE_CLOSE}
return {
"open": Cover.TOGGLE_OPEN,
"close": Cover.TOGGLE_CLOSE,
"stop": Cover.STOP,
}

def get_deconz_actions_mapping(self) -> DefaultActionsMapping:
return {
1002: Cover.TOGGLE_OPEN,
1003: Cover.STOP,
2002: Cover.TOGGLE_CLOSE,
2003: Cover.STOP,
}

def get_zha_actions_mapping(self) -> DefaultActionsMapping:
Expand Down
13 changes: 6 additions & 7 deletions docs/_data/controllers/E1766.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ device_support:
mapping:
- "Click up → Turn on"
- "Click down → Turn off"
- "Hold up → Full brightness"
- "Hold down → Minimum brightness"
- "Released (after being held) up → Full brightness"
- type: Switch
domain: switch
controller: E1766SwitchController
Expand All @@ -21,24 +20,24 @@ device_support:
mapping:
- "Click up → Open/Stop cover"
- "Click down → Close/Stop cover"
- "Hold up → Open cover"
- "Hold down → Close cover"
- "Released (after being held) up/down → Stop cover"
integrations:
- name: Zigbee2MQTT
codename: z2m
actions:
- "open → Click up"
- "close → Click down"
- "stop → Released (after being held) up/down"
- name: deCONZ
codename: deconz
actions:
- "1002 → Click up"
- "2002 → Click down"
- "1003 → Hold up"
- "2003 → Hold down"
- "1003 → Released (after being held) up"
- "2003 → Released (after being held) down"
- name: ZHA
codename: zha
actions:
- "up_open → Click up"
- "down_close → Click down"
- "stop → Release up or down"
- "stop → Released (after being held) up/down"

0 comments on commit 04c7c08

Please sign in to comment.