mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
REST binary sensor value_template optional (#8596)
According to the documentation, the `value_template` for the REST binary_sensor is not required. However, if you don't provide this when setting up a binary sensor, the component fails. Looks like a variable was not being set, which I've now included. This should make the REST binary sensor act the same way as the REST sensor now.
This commit is contained in:
parent
486bcc4cae
commit
5d810dae86
@ -107,6 +107,8 @@ class RestBinarySensor(BinarySensorDevice):
|
||||
if self.rest.data is None:
|
||||
return False
|
||||
|
||||
response = self.rest.data
|
||||
|
||||
if self._value_template is not None:
|
||||
response = self._value_template.\
|
||||
async_render_with_possible_json_value(self.rest.data, False)
|
||||
|
Loading…
x
Reference in New Issue
Block a user