Skip to content

Commit

Permalink
Zigbee2mqtt: Hide Coordinator in discovery (#2155)
Browse files Browse the repository at this point in the history
  • Loading branch information
cicoub13 authored Nov 4, 2024
1 parent 19445e5 commit 216f637
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
2 changes: 2 additions & 0 deletions server/services/zigbee2mqtt/lib/handleMqttMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ async function handleMqttMessage(topic, message) {

devices
// Remove Coordinator
.filter((d) => d.type !== 'Coordinator')
// Keep only supported devices from zigbee2mqtt library
.filter((d) => d.supported)
.forEach((device) => {
this.discoveredDevices[device.friendly_name] = device;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('zigbee2mqtt handleMqttMessage', () => {
});
});

it('should receive devices', async () => {
it('should receive devices, exclude unsupported and coordinator', async () => {
// PREPARE
stateManagerGetStub = sinon.stub();
stateManagerGetStub
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"interview_completed": true,
"interviewing": false,
"network_address": 0,
"supported": false,
"supported": true,
"type": "Coordinator"
},
{
Expand Down Expand Up @@ -319,5 +319,36 @@
"software_build_id": "3000-0001",
"supported": true,
"type": "EndDevice"
},
{
"date_code": "20181129",
"definition": null,
"endpoints": {
"1": {
"bindings": [],
"clusters": {
"input": [
"genBasic",
"genIdentify",
"msTemperatureMeasurement",
"msPressureMeasurement",
"msRelativeHumidity"
],
"output": ["genBasic", "genGroups"]
},
"configured_reportings": []
}
},
"friendly_name": "0x23158d00045b2740",
"ieee_address": "0x23158d00045b2740",
"interview_completed": true,
"interviewing": false,
"manufacturer": "Lidl",
"model_id": "ZNCZ02LM",
"network_address": 23007,
"power_source": "Battery",
"software_build_id": "3000-0001",
"supported": false,
"type": "EndDevice"
}
]

0 comments on commit 216f637

Please sign in to comment.