Skip to content

Commit

Permalink
REST binary sensor value_template optional (#8596)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
philhawthorne authored and pvizeli committed Jul 23, 2017
1 parent 486bcc4 commit 5d810da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions homeassistant/components/binary_sensor/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def is_on(self):
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)
Expand Down

0 comments on commit 5d810da

Please sign in to comment.