diff --git a/custom_components/aqara_gateway/binary_sensor.py b/custom_components/aqara_gateway/binary_sensor.py index 04bb969..d3bd224 100755 --- a/custom_components/aqara_gateway/binary_sensor.py +++ b/custom_components/aqara_gateway/binary_sensor.py @@ -714,9 +714,15 @@ 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()