MCPcopy
hub / github.com/Koenkk/zigbee2mqtt / emitDeviceNetworkAddressChanged

Method emitDeviceNetworkAddressChanged

lib/eventBus.ts:108–118  ·  view source on GitHub ↗
(data: eventdata.DeviceNetworkAddressChanged)

Source from the content-addressed store, hash-verified

106 }
107
108 public emitDeviceNetworkAddressChanged(data: eventdata.DeviceNetworkAddressChanged): void {
109 this.emitter.emit("deviceNetworkAddressChanged", data);
110
111 const device = this.stats.devices.get(data.device.ieeeAddr);
112
113 if (device) {
114 device.networkAddressChanges += 1;
115 } else {
116 this.stats.devices.set(data.device.ieeeAddr, {leaveCounts: 0, networkAddressChanges: 1});
117 }
118 }
119 public onDeviceNetworkAddressChanged(key: ListenerKey, callback: (data: eventdata.DeviceNetworkAddressChanged) => void): void {
120 this.on("deviceNetworkAddressChanged", callback, key);
121 }

Callers 1

startMethod · 0.80

Calls 2

getMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected