From b363e27659d8b0482b2de9f18899d4420d8cecef Mon Sep 17 00:00:00 2001 From: Jason <37859597+zachowj@users.noreply.github.com> Date: Thu, 2 Apr 2020 17:13:29 -0700 Subject: [PATCH] fix: Final fix for NaN ??? --- lib/ha-websocket.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ha-websocket.js b/lib/ha-websocket.js index 2aeccfde41..e269a5d091 100644 --- a/lib/ha-websocket.js +++ b/lib/ha-websocket.js @@ -223,7 +223,7 @@ class HaWebsocket extends EventEmitter { const emitEvent = { event_type: eventType, entity_id: entityId, - event: cloneDeep(msg.data), + event: msg.data, }; if ( @@ -237,19 +237,19 @@ class HaWebsocket extends EventEmitter { // Emit on the event type channel if (emitEvent.event_type) { - this.emit(`ha_events:${msg.event_type}`, emitEvent); + this.emit(`ha_events:${msg.event_type}`, cloneDeep(emitEvent)); // Most specific emit for event_type and entity_id if (emitEvent.entity_id) { this.emit( `ha_events:${msg.event_type}:${emitEvent.entity_id}`, - emitEvent + cloneDeep(emitEvent) ); } } // Emit on all channel - this.emit('ha_events:all', emitEvent); + this.emit('ha_events:all', cloneDeep(emitEvent)); } }