Fix string representation of template result wrappers (#42494)

This commit is contained in:
Paulus Schoutsen 2020-10-28 09:11:08 +01:00 committed by GitHub
parent ce51286c53
commit e21e28e49f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 12 deletions

View file

@ -33,7 +33,6 @@ from homeassistant.helpers.config_validation import PLATFORM_SCHEMA
from homeassistant.helpers.entity import async_generate_entity_id
from homeassistant.helpers.reload import async_setup_reload_service
from homeassistant.helpers.script import Script
from homeassistant.helpers.template import ResultWrapper
from .const import CONF_AVAILABILITY_TEMPLATE, DOMAIN, PLATFORMS
from .template_entity import TemplateEntity
@ -406,7 +405,7 @@ class LightTemplate(TemplateEntity, LightEntity):
def _update_state(self, result):
"""Update the state from the template."""
if isinstance(result, (TemplateError, ResultWrapper)):
if isinstance(result, TemplateError):
# This behavior is legacy
self._state = False
if not self._availability_template: