Fix rest sensors with resource templates (#42818)
This commit is contained in:
parent
b71e28dfac
commit
9e0043fb17
4 changed files with 6 additions and 6 deletions
|
@ -84,7 +84,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||
|
||||
if resource_template is not None:
|
||||
resource_template.hass = hass
|
||||
resource = resource_template.render(parse_result=False)
|
||||
resource = resource_template.async_render(parse_result=False)
|
||||
|
||||
if value_template is not None:
|
||||
value_template.hass = hass
|
||||
|
@ -189,6 +189,6 @@ class RestBinarySensor(BinarySensorEntity):
|
|||
async def async_update(self):
|
||||
"""Get the latest data from REST API and updates the state."""
|
||||
if self._resource_template is not None:
|
||||
self.rest.set_url(self._resource_template.render(parse_result=False))
|
||||
self.rest.set_url(self._resource_template.async_render(parse_result=False))
|
||||
|
||||
await self.rest.async_update()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue