add condition

This commit is contained in:
Aalian Khan
2023-04-04 02:33:17 -04:00
committed by GitHub
parent 870165951c
commit 3abee80090

View File

@@ -361,6 +361,8 @@ class MushroomStrategy {
} else } else
{ {
const weatherEntity = entities.find(entity => entity.entity_id.startsWith("weather.") && entity.disabled_by == null) const weatherEntity = entities.find(entity => entity.entity_id.startsWith("weather.") && entity.disabled_by == null)
if (weatherEntity != null)
{
chips.push chips.push
( (
{ {
@@ -372,6 +374,8 @@ class MushroomStrategy {
) )
} }
}
// Light count // Light count
const lightCountTemplate = "{% set lights = [" + createListOfFilteredStates(entities, devices, definedAreas, "light.") + "] %} {{ lights | selectattr('state','eq','on') | list | count }}"; const lightCountTemplate = "{% set lights = [" + createListOfFilteredStates(entities, devices, definedAreas, "light.") + "] %} {{ lights | selectattr('state','eq','on') | list | count }}";