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:
Phil Hawthorne authored and Pascal Vizeli committed 2017-07-23 22:42:41 +02:00
1 parent 486bcc4cae
commit 5d810dae86
1 file changed
+2
@@ -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)