def _async_homematic_callback(self, event_type: EventType, event_data: dict[str, Any]) -> None:
        """Execute the callback used for device related events."""

        interface_id = event_data[EventKey.INTERFACE_ID]
        if event_type == EventType.INTERFACE:
            interface_event_type = event_data[EventKey.TYPE]
            issue_id = f"{interface_event_type}-{interface_id}"
            event_data = cast(dict[str, Any], INTERFACE_EVENT_SCHEMA(event_data))
            data = event_data[EventKey.DATA]
            if interface_event_type == InterfaceEventType.CALLBACK:
                if not self._enable_system_notifications:
                    _LOGGER.debug("SYSTEM NOTIFICATION disabled for CALLBACK")
                    return
                if data[EventKey.AVAILABLE]:
                    async_delete_issue(hass=self._hass, domain=DOMAIN, issue_id=issue_id)
                else:
                    async_create_issue(
                        hass=self._hass,
                        domain=DOMAIN,
                        issue_id=issue_id,
                        is_fixable=False,
                        learn_more_url=LEARN_MORE_URL_XMLRPC_SERVER_RECEIVES_NO_EVENTS,
                        severity=IssueSeverity.WARNING,
                        translation_key="xmlrpc_server_receives_no_events",
                        translation_placeholders={
                            EventKey.INTERFACE_ID: interface_id,
                            EventKey.SECONDS_SINCE_LAST_EVENT: data[EventKey.SECONDS_SINCE_LAST_EVENT],
                        },
                    )
            elif interface_event_type == InterfaceEventType.PENDING_PONG:
                if not self._enable_system_notifications:
                    _LOGGER.debug("SYSTEM NOTIFICATION disabled for PENDING_PONG")
                    return
                if data[EventKey.PONG_MISMATCH_COUNT] == 0:
                    async_delete_issue(
                        hass=self._hass,
                        domain=DOMAIN,
                        issue_id=issue_id,
                    )
                else:
                    async_create_issue(
                        hass=self._hass,
                        domain=DOMAIN,
                        issue_id=issue_id,
                        is_fixable=False,
                        learn_more_url=LEARN_MORE_URL_PONG_MISMATCH,
                        severity=IssueSeverity.WARNING,
                        translation_key="pending_pong_mismatch",
                        translation_placeholders={
                            CONF_INSTANCE_NAME: self._instance_name,
                            EventKey.INTERFACE_ID: interface_id,
                        },
                    )
            elif interface_event_type == InterfaceEventType.PROXY:
                if data[EventKey.AVAILABLE]:
                    async_delete_issue(hass=self._hass, domain=DOMAIN, issue_id=issue_id)
                else:
                    async_create_issue(
                        hass=self._hass,
                        domain=DOMAIN,
                        issue_id=issue_id,
                        is_fixable=False,
                        severity=IssueSeverity.WARNING,
                        translation_key="interface_not_reachable",
                        translation_placeholders={
                            EventKey.INTERFACE_ID: interface_id,
                        },
                    )
            elif interface_event_type == InterfaceEventType.FETCH_DATA:
                async_create_issue(
                    hass=self._hass,
                    domain=DOMAIN,
                    issue_id=issue_id,
                    is_fixable=False,
                    severity=IssueSeverity.WARNING,
                    translation_key="fetch_data",
                    translation_placeholders={
                        EventKey.INTERFACE_ID: interface_id,
                    },
                )
        else:
            device_address = event_data[EventKey.ADDRESS]
            name: str | None = None
            if device_entry := self._async_get_device_entry(device_address=device_address):
                name = device_entry.name_by_user or device_entry.name
                event_data.update({EVENT_DEVICE_ID: device_entry.id, EVENT_NAME: name})
            if event_type in (EventType.IMPULSE, EventType.KEYPRESS):
                event_data = cleanup_click_event_data(event_data=event_data)
                if is_valid_event(event_data=event_data, schema=CLICK_EVENT_SCHEMA):
                    self._hass.bus.fire(
                        event_type=event_type.value,
                        event_data=event_data,
                    )
            elif event_type == EventType.DEVICE_AVAILABILITY:
                parameter = event_data[EventKey.PARAMETER]
                unavailable = event_data[EventKey.VALUE]
                if parameter in (Parameter.STICKY_UN_REACH, Parameter.UN_REACH):
                    title = f"{DOMAIN.upper()} Device not reachable"
                    event_data.update(
                        {
                            EVENT_IDENTIFIER: f"{device_address}_DEVICE_AVAILABILITY",
                            EVENT_TITLE: title,
                            EVENT_MESSAGE: f"{name}/{device_address} on interface {interface_id}",
                            EVENT_UNAVAILABLE: unavailable,
                        }
                    )
                    if is_valid_event(
                        event_data=event_data,
                        schema=DEVICE_AVAILABILITY_EVENT_SCHEMA,
                    ):
                        self._hass.bus.fire(
                            event_type=event_type.value,
                            event_data=event_data,
                        )
            elif event_type == EventType.DEVICE_ERROR:
                error_parameter = event_data[EventKey.PARAMETER]
                if error_parameter in FILTER_ERROR_EVENT_PARAMETERS:
                    return
                error_parameter_display = error_parameter.replace("_", " ").title()
                title = f"{DOMAIN.upper()} Device Error"
                error_message: str = ""
                error_value = event_data[EventKey.VALUE]
                display_error: bool = False
                if isinstance(error_value, bool):
                    display_error = error_value
                    error_message = f"{name}/{device_address} on interface {interface_id}: {error_parameter_display}"
                if isinstance(error_value, int):
                    display_error = error_value != 0
                    error_message = (
                        f"{name}/{device_address} on interface {interface_id}: {error_parameter_display} {error_value}"
                    )
                event_data.update(
                    {
                        EVENT_IDENTIFIER: f"{device_address}_{error_parameter}",
                        EVENT_TITLE: title,
                        EVENT_MESSAGE: error_message,
                        EVENT_ERROR_VALUE: error_value,
                        EVENT_ERROR: display_error,
                    }
                )
                if is_valid_event(event_data=event_data, schema=DEVICE_ERROR_EVENT_SCHEMA):
                    self._hass.bus.fire(
                        event_type=event_type.value,
                        event_data=event_data,
                    )
Execute the callback used for device related events.
custom_components/homematicip_local/control_unit.py