Skip to content

Commit

Permalink
fix: Fix operation_mode not working for Xiaomi Opple Koenkk/zigbee2…
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Dec 6, 2023
1 parent 7fafc43 commit 0659817
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/converters/toZigbee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2498,9 +2498,8 @@ const converters2 = {
xiaomi_switch_operation_mode_opple: {
key: ['operation_mode'],
convertSet: async (entity, key, value, meta) => {
utils.assertObject(value);
// Support existing syntax of a nested object just for the state field. Though it's quite silly IMO.
const targetValue = value.hasOwnProperty('state') ? value.state : value;
const targetValue = utils.isObject(value) && value.hasOwnProperty('state') ? value.state : value;
// Switches using aqaraOpple 0x0200 on the same endpoints as the onOff clusters.
const lookupState = {control_relay: 0x01, decoupled: 0x00};
await entity.write('aqaraOpple', {0x0200:
Expand Down

0 comments on commit 0659817

Please sign in to comment.