Skip to content

Commit

Permalink
fix: Fix failing commands to Aqara ZNCWWSQ01LM causing a crash Koenkk…
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Feb 3, 2024
1 parent 3818d79 commit 710ab22
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lib/lumi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,7 @@ export const toZigbee = {
};
switch (key) {
case 'feed':
sendAttr(0x04150055, 1, 1);
await sendAttr(0x04150055, 1, 1);
break;
case 'schedule': {
const schedule: string[] = [];
Expand All @@ -1659,25 +1659,25 @@ export const toZigbee = {
});
const val = Buffer.concat([Buffer.from(schedule.join(',')), Buffer.from([0])]);
// @ts-expect-error
sendAttr(0x080008c8, val, val.length);
await sendAttr(0x080008c8, val, val.length);
break;
}
case 'led_indicator':
sendAttr(0x04170055, getFromLookup(value, {'OFF': 0, 'ON': 1}), 1);
await sendAttr(0x04170055, getFromLookup(value, {'OFF': 0, 'ON': 1}), 1);
break;
case 'child_lock':
sendAttr(0x04160055, getFromLookup(value, {'UNLOCK': 0, 'LOCK': 1}), 1);
await sendAttr(0x04160055, getFromLookup(value, {'UNLOCK': 0, 'LOCK': 1}), 1);
break;
case 'mode':
sendAttr(0x04180055, getFromLookup(value, {'manual': 0, 'schedule': 1}), 1);
await sendAttr(0x04180055, getFromLookup(value, {'manual': 0, 'schedule': 1}), 1);
break;
case 'serving_size':
// @ts-expect-error
sendAttr(0x0e5c0055, value, 4);
await sendAttr(0x0e5c0055, value, 4);
break;
case 'portion_weight':
// @ts-expect-error
sendAttr(0x0e5f0055, value, 4);
await sendAttr(0x0e5f0055, value, 4);
break;
default: // Unknown key
meta.logger.warn(`zigbee-herdsman-converters:aqara_feeder: Unhandled key ${key}`);
Expand Down

0 comments on commit 710ab22

Please sign in to comment.