From 3abee80090ed158861d7e424b260aa65734e1662 Mon Sep 17 00:00:00 2001 From: Aalian Khan Date: Tue, 4 Apr 2023 02:33:17 -0400 Subject: [PATCH] add condition --- dist/mushroom-strategy.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/dist/mushroom-strategy.js b/dist/mushroom-strategy.js index 429ac61..ea10b14 100644 --- a/dist/mushroom-strategy.js +++ b/dist/mushroom-strategy.js @@ -361,15 +361,19 @@ class MushroomStrategy { } else { const weatherEntity = entities.find(entity => entity.entity_id.startsWith("weather.") && entity.disabled_by == null) - chips.push - ( - { - type: "weather", - entity: weatherEntity.entity_id, - show_temperature: true, - show_conditions: true - } - ) + if (weatherEntity != null) + { + chips.push + ( + { + type: "weather", + entity: weatherEntity.entity_id, + show_temperature: true, + show_conditions: true + } + ) + } + }