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

Method emitDeviceLeave

lib/eventBus.ts:158–168  ·  view source on GitHub ↗
(data: eventdata.DeviceLeave)

Source from the content-addressed store, hash-verified

156 }
157
158 public emitDeviceLeave(data: eventdata.DeviceLeave): void {
159 this.emitter.emit("deviceLeave", data);
160
161 const device = this.stats.devices.get(data.ieeeAddr);
162
163 if (device) {
164 device.leaveCounts += 1;
165 } else {
166 this.stats.devices.set(data.ieeeAddr, {leaveCounts: 1, networkAddressChanges: 0});
167 }
168 }
169 public onDeviceLeave(key: ListenerKey, callback: (data: eventdata.DeviceLeave) => void): void {
170 this.on("deviceLeave", callback, key);
171 }

Callers 1

startMethod · 0.80

Calls 2

getMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected