Poll lamps with Philips, Atmel, Gledopto, Mueller-Licht manufacturer codes (#5139)

* Poll lamps with Philips or Atmel manufacturer code

* Fixes incorrect test

Following up on https://github.com/Koenkk/zigbee2mqtt/pull/2122#discussion_r532618336

* Adds GLEDOPTO_CO_LTD and MUELLER_LICHT_INT to lamp polling
This commit is contained in:
Pedro Lamas 2020-11-30 18:21:17 +00:00 committed by GitHub
parent b1b134fbf0
commit 8b508971db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View File

@ -81,8 +81,13 @@ const pollOnMessage = [
}, },
// Read the following attributes // Read the following attributes
read: {cluster: 'genLevelCtrl', attributes: ['currentLevel']}, read: {cluster: 'genLevelCtrl', attributes: ['currentLevel']},
// When the bound devices/members of group have the following manufacturerID // When the bound devices/members of group have the following manufacturerIDs
manufacturerID: ZigbeeHerdsman.Zcl.ManufacturerCode.Philips, manufacturerIDs: [
ZigbeeHerdsman.Zcl.ManufacturerCode.Philips,
ZigbeeHerdsman.Zcl.ManufacturerCode.ATMEL,
ZigbeeHerdsman.Zcl.ManufacturerCode.GLEDOPTO_CO_LTD,
ZigbeeHerdsman.Zcl.ManufacturerCode.MUELLER_LICHT_INT,
],
}, },
{ {
key: 2, key: 2,
@ -98,7 +103,12 @@ const pollOnMessage = [
], ],
}, },
read: {cluster: 'genOnOff', attributes: ['onOff']}, read: {cluster: 'genOnOff', attributes: ['onOff']},
manufacturerID: ZigbeeHerdsman.Zcl.ManufacturerCode.Philips, manufacturerIDs: [
ZigbeeHerdsman.Zcl.ManufacturerCode.Philips,
ZigbeeHerdsman.Zcl.ManufacturerCode.ATMEL,
ZigbeeHerdsman.Zcl.ManufacturerCode.GLEDOPTO_CO_LTD,
ZigbeeHerdsman.Zcl.ManufacturerCode.MUELLER_LICHT_INT,
],
}, },
]; ];
@ -264,7 +274,7 @@ class Report extends Extension {
for (const endpoint of toPoll) { for (const endpoint of toPoll) {
for (const poll of polls) { for (const poll of polls) {
if (poll.manufacturerID !== endpoint.getDevice().manufacturerID) { if (!poll.manufacturerIDs.includes(endpoint.getDevice().manufacturerID)) {
continue; continue;
} }

View File

@ -267,7 +267,7 @@ describe('Report', () => {
expect(zigbeeHerdsman.devices.bulb_color_2.getEndpoint(1).read).toHaveBeenCalledTimes(2); expect(zigbeeHerdsman.devices.bulb_color_2.getEndpoint(1).read).toHaveBeenCalledTimes(2);
// Should only call Hue bulb, not e.g. tradfri // Should only call Hue bulb, not e.g. tradfri
expect(zigbeeHerdsman.devices.bulb.getEndpoint(1).read).toHaveBeenCalledTimes(0); expect(zigbeeHerdsman.devices.bulb_2.getEndpoint(1).read).toHaveBeenCalledTimes(0);
}); });
it('Should not configure reporting for the ZNLDP12LM closuresWindowCovering as it is ignored', async () => { it('Should not configure reporting for the ZNLDP12LM closuresWindowCovering as it is ignored', async () => {