async def setUpAsync(self): await super().setUpAsync() self.conf = AppleTV('127.0.0.1', 'Test device') self.conf.add_service(MrpService('mrp_id', self.fake_atv.port)) self.conf.add_service( AirPlayService('airplay_id', self.server.port, DEVICE_CREDENTIALS)) self.atv = await self.get_connected_device()
def setUp(self): AioHTTPTestCase.setUp(self) self.pairing = None self.service = AirPlayService('airplay_id', port=self.server.port) self.conf = AppleTV('127.0.0.1', 'Apple TV') self.conf.add_service(self.service)
def setUp(self): AioHTTPTestCase.setUp(self) self.pairing = None self.service = AirPlayService("airplay_id", port=self.server.port) self.conf = AppleTV("127.0.0.1", "Apple TV") self.conf.add_service(self.service)
async def get_connected_device(self, hsgid): self.dmap_service = DmapService("dmapid", hsgid, port=self.server.port) self.airplay_service = AirPlayService("airplay_id", self.server.port, DEVICE_CREDENTIALS) self.conf = AppleTV(ipaddress.IPv4Address("127.0.0.1"), "Apple TV") self.conf.add_service(self.dmap_service) self.conf.add_service(self.airplay_service) return await connect(self.conf, self.loop)
async def setUpAsync(self): await super().setUpAsync() self.conf = AppleTV(IPv4Address("127.0.0.1"), "Test device") self.conf.add_service( MrpService("mrp_id", self.fake_atv.get_port(Protocol.MRP))) self.conf.add_service( AirPlayService("airplay_id", self.server.port, DEVICE_CREDENTIALS)) self.atv = await self.get_connected_device()
async def get_connected_device(self, hsgid): self.dmap_service = DmapService('dmap_id', hsgid, port=self.server.port) self.airplay_service = AirPlayService('airplay_id', self.server.port, DEVICE_CREDENTIALS) self.conf = AppleTV('127.0.0.1', 'Apple TV') self.conf.add_service(self.dmap_service) self.conf.add_service(self.airplay_service) return await pyatv.connect(self.conf, self.loop)
def _manual_device(args): config = AppleTV(args.address, args.name) if args.dmap_credentials or args.protocol == const.Protocol.DMAP: config.add_service( DmapService(args.id, args.dmap_credentials, port=args.port)) if args.mrp_credentials or args.protocol == const.Protocol.MRP: config.add_service( MrpService(args.id, args.port, credentials=args.mrp_credentials)) if args.airplay_credentials: config.add_service( AirPlayService(args.id, credentials=args.airplay_credentials)) return config
def _manual_device(args): config = AppleTV(IPv4Address(args.address), args.name) if args.dmap_credentials or args.protocol == const.Protocol.DMAP: config.add_service( DmapService(args.id, args.dmap_credentials, port=args.port)) if args.mrp_credentials or args.protocol == const.Protocol.MRP: config.add_service( MrpService(args.id, args.port, credentials=args.mrp_credentials)) if args.airplay_credentials or args.protocol == const.Protocol.AirPlay: config.add_service( AirPlayService(args.id, credentials=args.airplay_credentials)) if args.companion_credentials or args.protocol == const.Protocol.Companion: config.add_service( CompanionService(args.port, credentials=args.companion_credentials)) if args.raop_credentials or args.protocol == const.Protocol.RAOP: config.add_service( RaopService(args.id, args.port, credentials=args.raop_credentials)) return config
def get_connected_device(self, port): conf = AppleTV('127.0.0.1', 'Test device') conf.add_service(MrpService(port)) conf.add_service(AirPlayService(self.server.port)) return connect_to_apple_tv(conf, loop=self.loop)
def get_connected_device(self, identifier): conf = AppleTV('127.0.0.1', 'Apple TV') conf.add_service(DmapService(identifier, port=self.server.port)) conf.add_service(AirPlayService(self.server.port)) return connect_to_apple_tv(conf, self.loop)
async def test_connect_invalid_protocol(self): conf = AppleTV("1.2.3.4", "Apple TV") conf.add_service(AirPlayService("airplay_id")) with self.assertRaises(exceptions.UnsupportedProtocolError): await pyatv.connect(conf, self.loop, protocol=Protocol.AirPlay)
def get_connected_device(self, identifier): details = AppleTV('127.0.0.1', 'Apple TV') details.add_service(DmapService(identifier, port=self.app.port)) details.add_service(AirPlayService(self.app.port)) return connect_to_apple_tv(details, self.loop)
def airplay_conf_fixture(airplay_device): service = AirPlayService("airplay_id", port=airplay_device.get_port(Protocol.AirPlay)) conf = AppleTV("127.0.0.1", "Apple TV") conf.add_service(service) yield conf