From 550432b4735b7c6f4e58997800e46b0f680969f7 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 26 Oct 2020 17:27:18 +0100 Subject: [PATCH] Adjust rest integration --- homeassistant/components/rest/binary_sensor.py | 4 ++-- homeassistant/components/rest/notify.py | 2 +- homeassistant/components/rest/sensor.py | 4 ++-- homeassistant/components/rest/switch.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/rest/binary_sensor.py b/homeassistant/components/rest/binary_sensor.py index c25750e2a2e..ec8b3ba0122 100644 --- a/homeassistant/components/rest/binary_sensor.py +++ b/homeassistant/components/rest/binary_sensor.py @@ -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() + resource = resource_template.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()) + self.rest.set_url(self._resource_template.render(parse_result=False)) await self.rest.async_update() diff --git a/homeassistant/components/rest/notify.py b/homeassistant/components/rest/notify.py index d7ee57b4f8e..b8f81b19e92 100644 --- a/homeassistant/components/rest/notify.py +++ b/homeassistant/components/rest/notify.py @@ -163,7 +163,7 @@ class RestNotificationService(BaseNotificationService): key: _data_template_creator(item) for key, item in value.items() } value.hass = self._hass - return value.async_render(kwargs) + return value.async_render(kwargs, parse_result=False) data.update(_data_template_creator(self._data_template)) diff --git a/homeassistant/components/rest/sensor.py b/homeassistant/components/rest/sensor.py index e9783e3fea3..323447ba1b3 100644 --- a/homeassistant/components/rest/sensor.py +++ b/homeassistant/components/rest/sensor.py @@ -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() + resource = resource_template.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()) + self.rest.set_url(self._resource_template.render(parse_result=False)) await self.rest.async_update() diff --git a/homeassistant/components/rest/switch.py b/homeassistant/components/rest/switch.py index 865f4d01b3a..1b980e12b75 100644 --- a/homeassistant/components/rest/switch.py +++ b/homeassistant/components/rest/switch.py @@ -162,7 +162,7 @@ class RestSwitch(SwitchEntity): async def async_turn_on(self, **kwargs): """Turn the device on.""" - body_on_t = self._body_on.async_render() + body_on_t = self._body_on.async_render(parse_result=False) try: req = await self.set_device_state(body_on_t) @@ -178,7 +178,7 @@ class RestSwitch(SwitchEntity): async def async_turn_off(self, **kwargs): """Turn the device off.""" - body_off_t = self._body_off.async_render() + body_off_t = self._body_off.async_render(parse_result=False) try: req = await self.set_device_state(body_off_t)