Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
drthanwho opened this issue Jan 30, 2022 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@drthanwho
Copy link

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 aderusha added the bug Something isn't working label May 6, 2022
@aderusha aderusha self-assigned this May 6, 2022
@aderusha
Copy link
Collaborator

aderusha commented May 6, 2022

Addressed in dev-1.06

@aderusha aderusha closed this as completed May 6, 2022
@aderusha
Copy link
Collaborator

aderusha commented May 6, 2022

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

@aderusha aderusha reopened this May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants