Skip to content

Commit

Permalink
Fix motion event in heartbeat of motion sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Dec 28, 2020
1 parent d25af44 commit 9f6d7f5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/xiaomi_gateway3/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ def _set_no_motion(self, *args):
self.async_write_ha_state()

def update(self, data: dict = None):
# fix 1.4.7_0115 heartbeat error (has motion in heartbeat)
if 'voltage' in data:
return

# https://github.com/AlexxIT/XiaomiGateway3/issues/135
if 'illumination' in data and len(data) == 1:
data[self._attr] = 1
Expand Down

0 comments on commit 9f6d7f5

Please sign in to comment.