Make sure Ring binary_sensor state will update only if device_id matches (#9247)

This commit is contained in:
Marcelo Moreira de Mello 2017-09-01 03:14:16 -04:00 committed by Pascal Vizeli
parent 0af4f8903d
commit a55895b662
2 changed files with 4 additions and 3 deletions

View File

@ -103,7 +103,8 @@ class RingBinarySensor(BinarySensorDevice):
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

View File

@ -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",