Add native Python types support to templates (#41227)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
Franck Nijhof 2020-10-07 00:05:52 +02:00 committed by GitHub
parent cbb4324c84
commit ee914366a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 349 additions and 282 deletions

View file

@ -458,7 +458,10 @@ def async_template(
_LOGGER.error("Error during template condition: %s", ex)
return False
return value.lower() == "true"
if isinstance(value, bool):
return value
return str(value).lower() == "true"
def async_template_from_config(