From dff4af94f573111dcce16cf97903168c4e991652 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 14 Apr 2021 20:22:26 +0200 Subject: [PATCH] Home Assistant: fix device_automation not published when homeassistant is in device options. https://github.com/Koenkk/zigbee2mqtt/issues/7074 --- lib/extension/homeassistant.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/extension/homeassistant.js b/lib/extension/homeassistant.js index 01fa302b..f3950c80 100644 --- a/lib/extension/homeassistant.js +++ b/lib/extension/homeassistant.js @@ -905,8 +905,9 @@ class HomeAssistant extends Extension { } async publishDeviceTriggerDiscover(entity, key, value, force=false) { - if (entity.settings.hasOwnProperty('homeassistant') && - (entity.settings.homeassistant == null || entity.settings.homeassistant.device_automation == null)) { + const haConfig = entity.settings.homeassistant; + if (entity.settings.hasOwnProperty('homeassistant') && (haConfig == null || + (haConfig.hasOwnProperty('device_automation') && haConfig.device_automation == null))) { return; }