This commit is contained in:
Koen Kanters
2019-10-09 19:40:46 +02:00
parent f2132f6c50
commit ba92f73961
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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',
+1 -1
View File
@@ -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);