Skip to content

Commit

Permalink
fix: Fix Expected one of: 1, 2, got: '29146' error Koenkk/zigbee2mq…
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Jul 2, 2023
1 parent b4e5a28 commit 3fba669
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/xiaomi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ const numericAttributes2Payload = async (msg: Fz.Message, meta: Fz.Meta, model:
}
break;
case '10':
if (['SSM-U01', 'DLKZMK11LM', 'SSM-U02', 'DLKZMK12LM'].includes(model.model)) {
// Value 29146 is received for SSM-U02 sometimes here:
// https://github.com/Koenkk/zigbee2mqtt/issues/17961#issuecomment-1616170548
if (['SSM-U01', 'DLKZMK11LM', 'SSM-U02', 'DLKZMK12LM'].includes(model.model) && (value === 1 || value === 2)) {
payload.switch_type = getFromLookup(value, {1: 'toggle', 2: 'momentary'});
}
break;
Expand Down

0 comments on commit 3fba669

Please sign in to comment.