Skip to content

Commit

Permalink
Don't handle buttonClickBus event because of duplicate events when do…
Browse files Browse the repository at this point in the history
…ing multi-clicks
  • Loading branch information
Mat931 committed Jan 7, 2025
1 parent e7180c1 commit 21b2660
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions custom_components/digitalstrom/api/apartment.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,22 +199,14 @@ async def event_callback(self, data: dict) -> None:
extra_data["group_id"] = group_id
extra_data["zone_id"] = zone_id
device.button.update("call_group_scene", extra_data)
elif name in ["buttonClick", "buttonClickBus"]:
elif name == "buttonClick":
dsuid = data["source"]["dsid"]
button_index = int(data["properties"]["buttonIndex"])
if (
(device := self.devices.get(dsuid))
and (device.button is not None)
and (button_index == 0)
):
if name == "buttonClickBus":
device.button.bus_event_received = time.time()
elif (device.button.bus_event_received is not None) and (
device.button.bus_event_received
> time.time() - BUTTON_BUS_EVENT_TIMEOUT
):
self.logger.debug(f"Ignoring repeated event")
return
extra_data = {}
extra_data["click_type"] = int(data["properties"]["clickType"])
extra_data["hold_count"] = int(
Expand Down

0 comments on commit 21b2660

Please sign in to comment.