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
|
@ -103,7 +103,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 username and password:
|
||||
if config.get(CONF_AUTHENTICATION) == HTTP_DIGEST_AUTHENTICATION:
|
||||
|
@ -202,7 +202,7 @@ class RestSensor(Entity):
|
|||
async def async_update(self):
|
||||
"""Get the latest data from REST API and update 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