From 2603c2f62ba7a54c69539e12661fb8b74631c0a7 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 31 May 2022 17:18:23 +0200 Subject: [PATCH] 2022.6: Ad missing breaking change on template defaults --- .../_posts/2022-06-01-release-20226.markdown | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/source/_posts/2022-06-01-release-20226.markdown b/source/_posts/2022-06-01-release-20226.markdown index 22e8f78eba1..0ef29d0bd8a 100644 --- a/source/_posts/2022-06-01-release-20226.markdown +++ b/source/_posts/2022-06-01-release-20226.markdown @@ -428,6 +428,48 @@ mqtt: {% enddetails %} +{% details "Template filter/function defaults" %} + +The following template filters and functions will now error instead of returning +the input if the input is invalid and no default value is specified: + +- `acos` +- `as_timestamp` +- `asin` +- `atan` +- `atan2` +- `cos` +- `float` +- `int` +- `log` +- `multiply` +- `round` +- `sin` +- `sqrt` +- `strptime` +- `tan` +- `timestamp_custom` +- `timestamp_local` +- `timestamp_utc` + +Examples: + +{% raw %} + +- `{{ "abc" | float }}`: Will fail to render +- `{{ "abc" | float(default=5) }}`: Will render as -5, no warning will be logged +- `{{ float("abc") }}`: Will fail to render +- `{{ float("abc", default=5) }}`: Will render as -5, no warning will be logged + +{% endraw %} + +([@emontnemery] - [#71687]) ([documentation](/docs/configuration/templating/#numeric-functions-and-filters)) + +[@emontnemery]: https://github.com/emontnemery +[#71687]: https://github.com/home-assistant/core/pull/71687 + +{% enddetails %} + {% details "OAuth2 (re-)authentications" %} Home Assistant will now use My Home Assistant to redirect the OAuth2 callback