Skip to content

Commit

Permalink
Zigbee2mqtt: Add ikea somrig button (#2035)
Browse files Browse the repository at this point in the history
  • Loading branch information
William-De71 authored Mar 8, 2024
1 parent 94fb118 commit 9d50528
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
7 changes: 6 additions & 1 deletion front/src/config/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -2658,7 +2658,12 @@
"43": "Ab-Taste gedrückt",
"44": "Ab-Taste gehalten",
"45": "Aus-Taste gedrückt",
"46": "Aus-Taste gehalten"
"46": "Aus-Taste gehalten",
"47": "Einmaliges Drücken",
"48": "Langer Druck",
"49": "Kurzes Loslassen",
"50": "Langes Loslassen",
"51": "Doppeltes Drücken"
}
},
"opening-sensor": {
Expand Down
7 changes: 6 additions & 1 deletion front/src/config/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2660,7 +2660,12 @@
"43": "Down press",
"44": "Down hold",
"45": "Off press",
"46": "Off hold"
"46": "Off hold",
"47": "Single press",
"48": "Long press",
"49": "Short release",
"50": "Long release",
"51": "Double press"
}
},
"opening-sensor": {
Expand Down
7 changes: 6 additions & 1 deletion front/src/config/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2662,7 +2662,12 @@
"43": "Bouton Moins pressé",
"44": "Bouton Moins maintenu",
"45": "Bouton Off pressé",
"46": "Bouton Off maintenu"
"46": "Bouton Off maintenu",
"47": "Pression unique",
"48": "Pression longue",
"49": "Relâchement court",
"50": "Relâchement long",
"51": "Pression double"
}
},
"opening-sensor": {
Expand Down
6 changes: 6 additions & 0 deletions server/services/zigbee2mqtt/exposes/enumType.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ addMapping('action', BUTTON_STATUS.DOWN_HOLD, 'down-hold');
addMapping('action', BUTTON_STATUS.OFF_PRESS, 'off-press');
addMapping('action', BUTTON_STATUS.OFF_HOLD, 'off-hold');

addMapping('action', BUTTON_STATUS.INITIAL_PRESS, 'initial_press');
addMapping('action', BUTTON_STATUS.LONG_PRESS, 'long_press');
addMapping('action', BUTTON_STATUS.SHORT_RELEASE, 'short_release');
addMapping('action', BUTTON_STATUS.LONG_RELEASE, 'long_release');
addMapping('action', BUTTON_STATUS.DOUBLE_PRESS, 'double_press');

addMapping('state', COVER_STATE.OPEN, 'OPEN');
addMapping('state', COVER_STATE.CLOSE, 'CLOSE');
addMapping('state', COVER_STATE.STOP, 'STOP');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function buildFeatures(deviceName, expose, parentType) {
// Add missing properties
const typeFeaturesIndexes = getFeatureIndexes(values);
const featureIndexes = typeFeaturesIndexes.length === 0 ? [0] : typeFeaturesIndexes;

return featureIndexes.map((suffixIndex) => completeFeature(deviceName, definedFeature, property, suffixIndex));
}

Expand Down
5 changes: 5 additions & 0 deletions server/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ const BUTTON_STATUS = {
DOWN_HOLD: 44,
OFF_PRESS: 45,
OFF_HOLD: 46,
INITIAL_PRESS: 47,
LONG_PRESS: 48,
SHORT_RELEASE: 49,
LONG_RELEASE: 50,
DOUBLE_PRESS: 51,
};

const COVER_STATE = {
Expand Down

0 comments on commit 9d50528

Please sign in to comment.