HASwitchPlate / HASPone

DIY LCD touchscreen for Home Automation
MIT License
414 stars 46 forks source link

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

Open drthanwho opened 2 years ago

drthanwho commented 2 years ago

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
aderusha commented 2 years ago

Addressed in dev-1.06

aderusha commented 2 years ago

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