Skip to content

Commit

Permalink
Merge pull request #278 from EricCorleone/master
Browse files Browse the repository at this point in the history
  • Loading branch information
niceboygithub authored Jul 8, 2024
2 parents c89f90f + b759fe2 commit 3107212
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions custom_components/aqara_gateway/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,12 +589,19 @@ def update(self, data: dict = None):
'entity_id': self.entity_id, 'click_type': self._state
})

time.sleep(.1)
# time.sleep(.1)

self._state = ''
# self._state = ''

# reset the state to empty after 0.1 second
self.hass.loop.call_later(.1, self.reset_state)

self.schedule_update_ha_state()

def reset_state(self):
self._state = ''
self.async_write_ha_state()


class GatewayAction(GatewayBinarySensor, BinarySensorEntity):
""" Xiaomi/Aqara Action Cube """
Expand Down

0 comments on commit 3107212

Please sign in to comment.