Fix string representation of template result wrappers (#42494)
This commit is contained in:
parent
ce51286c53
commit
e21e28e49f
5 changed files with 26 additions and 12 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue