mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Improve generic event typing [voip] (#114738)
This commit is contained in:
parent
fdef3ece13
commit
082af6e0ae
@ -84,7 +84,7 @@ class VoIPDevices:
|
|||||||
)
|
)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_device_removed(ev: Event) -> None:
|
def async_device_removed(ev: Event[dr.EventDeviceRegistryUpdatedData]) -> None:
|
||||||
"""Handle device removed."""
|
"""Handle device removed."""
|
||||||
removed_id = ev.data["device_id"]
|
removed_id = ev.data["device_id"]
|
||||||
self.devices = {
|
self.devices = {
|
||||||
@ -97,7 +97,7 @@ class VoIPDevices:
|
|||||||
self.hass.bus.async_listen(
|
self.hass.bus.async_listen(
|
||||||
dr.EVENT_DEVICE_REGISTRY_UPDATED,
|
dr.EVENT_DEVICE_REGISTRY_UPDATED,
|
||||||
async_device_removed,
|
async_device_removed,
|
||||||
callback(lambda event_data: event_data.get("action") == "remove"),
|
callback(lambda event_data: event_data["action"] == "remove"),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user