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

Zigbee2mqtt: Add Xiaomi WXKG01LM button #1853

Merged
merged 1 commit into from Aug 25, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion front/src/config/i18n/en.json
Expand Up @@ -2158,7 +2158,11 @@
"14": "Left arrow held",
"15": "Right arrow held",
"16": "Left arrow release",
"17": "Right arrow release"
"17": "Right arrow release",
"18": "Triple click",
"19": "Quadruple click",
"20": "Click released",
"21": "Many clicks"
}
},
"opening-sensor": {
Expand Down
6 changes: 5 additions & 1 deletion front/src/config/i18n/fr.json
Expand Up @@ -2159,7 +2159,11 @@
"14": "Flèche gauche maintenue",
"15": "Flèche droite maintenue",
"16": "Flèche gauche relâchée",
"17": "Flèche droite relâchée"
"17": "Flèche droite relâchée",
"18": "Clic triple",
"19": "Clic quadruple",
"20": "Clic relâché",
"21": "Plein de clics"
}
},
"opening-sensor": {
Expand Down
7 changes: 7 additions & 0 deletions server/services/zigbee2mqtt/exposes/enumType.js
Expand Up @@ -22,18 +22,25 @@ addMapping('action', BUTTON_STATUS.CLICK, 'single');
addMapping('action', BUTTON_STATUS.DOUBLE_CLICK, 'double');
addMapping('action', BUTTON_STATUS.HOLD_CLICK, 'hold');
addMapping('action', BUTTON_STATUS.LONG_CLICK, 'long');

addMapping('action', BUTTON_STATUS.ON, 'on');
addMapping('action', BUTTON_STATUS.OFF, 'off');
addMapping('action', BUTTON_STATUS.BRIGHTNESS_MOVE_DOWN, 'brightness_move_down');
addMapping('action', BUTTON_STATUS.BRIGHTNESS_MOVE_UP, 'brightness_move_up');
addMapping('action', BUTTON_STATUS.BRIGHTNESS_STOP, 'brightness_stop');

addMapping('action', BUTTON_STATUS.ARROW_LEFT_CLICK, 'arrow_left_click');
addMapping('action', BUTTON_STATUS.ARROW_RIGHT_CLICK, 'arrow_right_click');
addMapping('action', BUTTON_STATUS.ARROW_LEFT_HOLD, 'arrow_left_hold');
addMapping('action', BUTTON_STATUS.ARROW_RIGHT_HOLD, 'arrow_right_hold');
addMapping('action', BUTTON_STATUS.ARROW_LEFT_RELEASE, 'arrow_left_release');
addMapping('action', BUTTON_STATUS.ARROW_RIGHT_RELEASE, 'arrow_right_release');

addMapping('action', BUTTON_STATUS.TRIPLE, 'triple');
addMapping('action', BUTTON_STATUS.QUADRUPLE, 'quadruple');
addMapping('action', BUTTON_STATUS.RELEASE, 'release');
addMapping('action', BUTTON_STATUS.MANY, 'many');

addMapping('state', COVER_STATE.OPEN, 'OPEN');
addMapping('state', COVER_STATE.CLOSE, 'CLOSE');
addMapping('state', COVER_STATE.STOP, 'STOP');
Expand Down
4 changes: 4 additions & 0 deletions server/utils/constants.js
Expand Up @@ -21,6 +21,10 @@ const BUTTON_STATUS = {
ARROW_RIGHT_HOLD: 15,
ARROW_LEFT_RELEASE: 16,
ARROW_RIGHT_RELEASE: 17,
TRIPLE: 18,
QUADRUPLE: 19,
RELEASE: 20,
MANY: 21,
};

const COVER_STATE = {
Expand Down