示例#1
0
def test_service_merge_password(password1, password2, expected):
    service1 = ManualService("id1", Protocol.DMAP, 0, {})
    service2 = ManualService("id2", Protocol.DMAP, 0, {})

    service1.password = password1
    service2.password = password2

    service1.merge(service2)

    assert service1.password == expected
示例#2
0
def _manual_device(args):
    config = AppleTV(IPv4Address(args.address), args.name)
    service = ManualService(args.id, args.protocol, args.port, {})
    service.credentials = getattr(args, f"{args.protocol.name.lower()}_credentials")
    service.password = args.raop_password
    config.add_service(service)
    return config