Esempio n. 1
0
def hscp_service_handler(
    mdns_service: mdns.Service, response: mdns.Response
) -> Optional[ScanHandlerReturn]:
    """Parse and return a new HSCP service."""
    name = mdns_service.properties.get("Machine Name", "Unknown")
    service = MutableService(
        get_unique_id(mdns_service.type, mdns_service.name, mdns_service.properties),
        Protocol.DMAP,
        port=mdns_service.port,
        properties=mdns_service.properties,
    )
    service.credentials = mdns_service.properties.get("hG")
    return name, service
Esempio n. 2
0
def homesharing_service_handler(
    mdns_service: mdns.Service, response: mdns.Response
) -> Optional[ScanHandlerReturn]:
    """Parse and return a new DMAP (Home Sharing) service."""
    name = mdns_service.properties.get("Name", "Unknown")
    service = MutableService(
        get_unique_id(mdns_service.type, mdns_service.name, mdns_service.properties),
        Protocol.DMAP,
        mdns_service.port,
        mdns_service.properties,
    )
    service.credentials = mdns_service.properties.get("hG")
    return name, service