From c80be7bda2ca17973d3f3f5d4aeda126b5c094eb Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 20 Oct 2019 21:17:18 +0200 Subject: [PATCH] Don't provide undefined state. https://github.com/Koenkk/zigbee2mqtt/issues/2164 --- lib/extension/entityPublish.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/extension/entityPublish.js b/lib/extension/entityPublish.js index 0fdd025f..708e7425 100644 --- a/lib/extension/entityPublish.js +++ b/lib/extension/entityPublish.js @@ -106,7 +106,7 @@ class EntityPublish extends BaseExtension { * the color temperature. This would lead to 2 zigbee publishes, where the first one * (state) is probably unecessary. */ - const deviceState = this.state.get(entity.settings.ID); + const deviceState = this.state.get(entity.settings.ID) || {}; if (settings.get().homeassistant) { const hasColorTemp = json.hasOwnProperty('color_temp'); const hasColor = json.hasOwnProperty('color');