Improve generic event typing [voip] (#114738)

pull/115023/head
Marc Mueller 2024-04-06 13:57:09 +02:00 committed by GitHub
parent fdef3ece13
commit 082af6e0ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -84,7 +84,7 @@ class VoIPDevices:
)
@callback
def async_device_removed(ev: Event) -> None:
def async_device_removed(ev: Event[dr.EventDeviceRegistryUpdatedData]) -> None:
"""Handle device removed."""
removed_id = ev.data["device_id"]
self.devices = {
@ -97,7 +97,7 @@ class VoIPDevices:
self.hass.bus.async_listen(
dr.EVENT_DEVICE_REGISTRY_UPDATED,
async_device_removed,
callback(lambda event_data: event_data.get("action") == "remove"),
callback(lambda event_data: event_data["action"] == "remove"),
)
)