Skip to content

Commit 629ca54

Browse files
authored
Handle button idle state (#36)
1 parent e554e0b commit 629ca54

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

custom_components/flichub/binary_sensor.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,12 @@ def _event_callback(self, event: core.Event):
199199
name = event.data[EVENT_DATA_NAME]
200200
click_type: Event = event.data[EVENT_DATA_CLICK_TYPE]
201201
_LOGGER.debug(f"Button {name} clicked: {click_type}")
202-
if click_type == 'single':
203-
self._click_type = click_type
204-
elif click_type == 'double':
202+
if click_type in ['single', 'double', 'hold', 'idle']:
205203
self._click_type = click_type
206204

207205
if click_type == 'down':
208206
self._is_on = True
209207
if click_type == 'hold':
210-
self._click_type = click_type
211208
self._is_on = True
212209
if click_type == 'up':
213210
self._is_on = False

0 commit comments

Comments
 (0)