Skip to content

Commit

Permalink
Make sure Ring binary_sensor state will update only if device_id mat…
Browse files Browse the repository at this point in the history
  • Loading branch information
tchellomello authored and pvizeli committed Sep 1, 2017
1 parent 0af4f89 commit a55895b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions homeassistant/components/binary_sensor/ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def update(self):
self._data.check_alerts()

if self._data.alert:
self._state = (self._sensor_type ==
self._data.alert.get('kind'))
if self._sensor_type == self._data.alert.get('kind') and \
self._data.account_id == self._data.alert.get('doorbot_id'):
self._state = True
else:
self._state = False
2 changes: 1 addition & 1 deletion tests/fixtures/ring_ding_active.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"audio_jitter_buffer_ms": 0,
"device_kind": "lpd_v1",
"doorbot_description": "Front Door",
"doorbot_id": 12345,
"doorbot_id": 987652,
"expires_in": 180,
"id": 123456789,
"id_str": "123456789",
Expand Down

0 comments on commit a55895b

Please sign in to comment.