mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Fix Shelly event handling (#67000)
This commit is contained in:
parent
d45921622a
commit
ba2bc975f4
@ -681,19 +681,17 @@ class RpcDeviceWrapper(update_coordinator.DataUpdateCoordinator):
|
||||
ENTRY_RELOAD_COOLDOWN,
|
||||
)
|
||||
self.hass.async_create_task(self._debounced_reload.async_call())
|
||||
elif event_type not in RPC_INPUTS_EVENTS_TYPES:
|
||||
continue
|
||||
|
||||
self.hass.bus.async_fire(
|
||||
EVENT_SHELLY_CLICK,
|
||||
{
|
||||
ATTR_DEVICE_ID: self.device_id,
|
||||
ATTR_DEVICE: self.device.hostname,
|
||||
ATTR_CHANNEL: event["id"] + 1,
|
||||
ATTR_CLICK_TYPE: event["event"],
|
||||
ATTR_GENERATION: 2,
|
||||
},
|
||||
)
|
||||
elif event_type in RPC_INPUTS_EVENTS_TYPES:
|
||||
self.hass.bus.async_fire(
|
||||
EVENT_SHELLY_CLICK,
|
||||
{
|
||||
ATTR_DEVICE_ID: self.device_id,
|
||||
ATTR_DEVICE: self.device.hostname,
|
||||
ATTR_CHANNEL: event["id"] + 1,
|
||||
ATTR_CLICK_TYPE: event["event"],
|
||||
ATTR_GENERATION: 2,
|
||||
},
|
||||
)
|
||||
|
||||
async def _async_update_data(self) -> None:
|
||||
"""Fetch data."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user