From a1d7db328a2b25b86dac11250c5c359a6ebd6c0c Mon Sep 17 00:00:00 2001 From: Martin Svoboda Date: Sun, 19 May 2024 16:09:59 +0200 Subject: [PATCH] Remove redundant condition --- src/tracker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tracker.ts b/src/tracker.ts index 2707de2f..f0fa5bda 100644 --- a/src/tracker.ts +++ b/src/tracker.ts @@ -20,7 +20,7 @@ export class Tracker extends EventEmitter { this.hook(); } - public get Devices(): IDevice[] { + public get Devices(): Device[] { return Array.from(this.deviceMap?.values() || []); } @@ -65,7 +65,7 @@ export class Tracker extends EventEmitter { map.set(d.id, currentDevice); - if (currentDevice && d.state !== currentDevice.state) { + if (d.state !== currentDevice.state) { (currentDevice as IDevice).state = d.state; this.emit('change', currentDevice); return map;