async def _async_service_get_link_peers(hass: HomeAssistant, service: ServiceCall) -> ServiceResponse:
    """Service to call the getLinkPeers method on a Homematic(IP) Local connection."""
    channel_no = service.data.get(CONF_CHANNEL)

    if hm_device := _async_get_hm_device_by_service_data(hass=hass, service=service):
        address = f"{hm_device.address}:{channel_no}" if channel_no is not None else hm_device.address
        try:
            return cast(ServiceResponse, {address: await hm_device.client.get_link_peers(address=address)})
        except BaseHomematicException as ex:
            raise HomeAssistantError(ex) from ex
    return None
Service to call the getLinkPeers method on a Homematic(IP) Local connection.
custom_components/homematicip_local/services.py