diff --git a/README.md b/README.md index eacf653..d69dea5 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you cannot see templates in your HACS listing, you *may* need to enable 'expe # Availability Test -## `avail([entity1, ...])` +## `avail([entity1, entity2, /])` This expects a list of entities. diff --git a/availability_template.jinja b/availability_template.jinja index 548102f..d042de6 100644 --- a/availability_template.jinja +++ b/availability_template.jinja @@ -13,7 +13,10 @@ {% from 'availability_template.jinja' import avail %} {{- avail(['entity_1','entity_2']) | bool -}} #} - {%- if entity_list is iterable -%} + {# First tests to make sure this is a list #} + {%- if entity_list is iterable and + (entity_list is not string and entity_list is not mapping) + -%} {{- entity_list | map('states') | reject('in', ['unknown','unavailable','','none']) | list | count == entity_list | count -}} {%- else -%}