mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-29 07:08:56 +00:00
Resolve Coordinator to coordinator. https://github.com/Koenkk/zigbee2mqtt/issues/2100
This commit is contained in:
+1
-1
@@ -129,7 +129,7 @@ class Zigbee extends events.EventEmitter {
|
||||
key = key.toString();
|
||||
}
|
||||
|
||||
if (key === 'coordinator') {
|
||||
if (typeof key === 'string' && key.toLowerCase() === 'coordinator') {
|
||||
const coordinator = this.getDevicesByType('Coordinator')[0];
|
||||
return {
|
||||
type: 'device',
|
||||
|
||||
@@ -75,7 +75,7 @@ describe('Device bind', () => {
|
||||
const endpoint = device.getEndpoint(1);
|
||||
mockClear(device);
|
||||
endpoint.unbind.mockClear();
|
||||
MQTT.events.message('zigbee2mqtt/bridge/unbind/remote', 'coordinator');
|
||||
MQTT.events.message('zigbee2mqtt/bridge/unbind/remote', 'Coordinator');
|
||||
await flushPromises();
|
||||
expect(endpoint.unbind).toHaveBeenCalledTimes(3);
|
||||
expect(endpoint.unbind).toHaveBeenCalledWith("genOnOff", target);
|
||||
|
||||
Reference in New Issue
Block a user