Skip to content

Commit

Permalink
Wait until LS21001 is active to change alert_behavior and remove non-…
Browse files Browse the repository at this point in the history
…working battery reporting for SAGE206611 (#2955)

* Wait until sensor is active to change alert_behavior

* Remove non-functional battery reporting from Echostar single gang switch

Co-authored-by: Tediore <tediore.maliwan@gmail.com>
  • Loading branch information
M.J. Wydra and Tediore committed Aug 26, 2021
1 parent e5ce6c5 commit 3e09c1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion converters/toZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ const converters = {
convertSet: async (entity, key, value, meta) => {
const lookup = {'siren_led': 3, 'siren': 2, 'led': 1, 'nothing': 0};
await entity.write('genBasic', {0x400a: {value: lookup[value], type: 32}},
{manufacturerCode: 0x1168, disableDefaultResponse: true});
{manufacturerCode: 0x1168, disableDefaultResponse: true, sendWhenActive: true});
return {state: {alert_behaviour: value}};
},
},
Expand Down
10 changes: 2 additions & 8 deletions devices/echostar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const exposes = require('../lib/exposes');
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
const reporting = require('../lib/reporting');
const e = exposes.presets;

module.exports = [
Expand All @@ -19,13 +18,8 @@ module.exports = [
model: 'SAGE206611',
vendor: 'Echostar',
description: 'SAGE by Hughes single gang light switch',
fromZigbee: [fz.command_on, fz.command_off, fz.battery],
exposes: [e.battery(), e.action(['on', 'off'])],
fromZigbee: [fz.command_on, fz.command_off],
exposes: [e.action(['on', 'off'])],
toZigbee: [],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(18);
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
await reporting.batteryPercentageRemaining(endpoint);
},
},
];

0 comments on commit 3e09c1b

Please sign in to comment.