HASPone icon indicating copy to clipboard operation
HASPone copied to clipboard

Some int still need a default value on Temperature with icon blueprint

Open drthanwho opened this issue 3 years ago • 2 comments

I see most ints have been give default values but some have not and HA is catching them

2022-01-30 02:26:24 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'int' got invalid input 'unavailable' when rendering template
'{%- set temp = temperature|int -%} {%- if temp <= thermometer_quarter_threshold|int -%}
  {%- set color = thermometer_empty_color -%}
{%- elif temp < thermometer_half_threshold|int -%}
  {%- set color = thermometer_quarter_color -%}
{%- elif temp < thermometer_three_quarter_threshold|int -%}
  {%- set color = thermometer_half_color -%}
{%- elif temp < thermometer_full_threshold|int -%}
  {%- set color = thermometer_three_quarter_color -%}
{%- else -%}
  {%- set color = thermometer_full_color -%}
{%- endif -%} {%- if color|int < 0 -%}
  {{- selectedfg -}}
{%- else -%}
  {{- color -}}
{%- endif -%}' but no default was specified. Currently 'int' will return '0', however this template will fail to render in Home Assistant core 2022.1

drthanwho avatar Jan 30 '22 00:01 drthanwho

Addressed in dev-1.06

aderusha avatar May 06 '22 12:05 aderusha

whoops, didn't mean to close :D Re-opening until 1.06 is released.

aderusha avatar May 06 '22 12:05 aderusha