--- layout: template title: API - pyatv.conf permalink: /api//conf link_group: api ---

Module pyatv.conf

Configuration used when connecting to a device.

A configuration describes a device, e.g. it's name, IP address and credentials. It is possible to manually create a configuration, but generally scanning for devices will provide configurations for you.

For a configuration to be usable ("ready") it must have either a DMAP or MRP configuration (or both), as connecting to plain AirPlay devices it not supported.

Classes

class AirPlayService (identifier: Optional[str], port: int = 7000, credentials: Optional[str] = None, properties: Optional[Mapping[str, str]] = None)

Representation of an AirPlay service.

Initialize a new AirPlayService.

Ancestors

Inherited members

class AppleTV (address: ipaddress.IPv4Address, name: str, deep_sleep: bool = False, model: DeviceModel = DeviceModel.Unknown, properties: Optional[Mapping[str, Mapping[str, str]]] = None)

Representation of an Apple TV configuration.

An instance of this class represents a single device. A device can have several services depending on the protocols it supports, e.g. DMAP or AirPlay.

Initialize a new AppleTV.

Instance variables

var address -> ipaddress.IPv4Address

IP address of device.

var all_identifiers -> List[str]

Return all unique identifiers for this device.

var deep_sleep -> bool

If device is in deep sleep.

var device_info -> DeviceInfo

Return general device information.

var identifier -> Optional[str]

Return the main identifier associated with this device.

var name -> str

Name of device.

var ready -> bool

Return if configuration is ready, (at least one service with identifier).

var services -> List[BaseService]

Return all supported services.

Methods

def add_service(self, service: BaseService) -> NoneType

Add a new service.

If the service already exists, it will be merged.

def get_service(self, protocol: Protocol) -> Optional[BaseService]

Look up a service based on protocol.

If a service with the specified protocol is not available, None is returned.

def main_service(self, protocol: Optional[Protocol] = None) -> BaseService

Return suggested service used to establish connection.

def set_credentials(self, protocol: Protocol, credentials: str) -> bool

Set credentials for a protocol if it exists.

class CompanionService (port: int, credentials: Optional[str] = None, properties: Optional[Mapping[str, str]] = None)

Representation of a Companion link service.

Initialize a new CompaniomService.

Ancestors

Inherited members

class DmapService (identifier: Optional[str], credentials: Optional[str], port: int = 3689, properties: Optional[Mapping[str, str]] = None)

Representation of a DMAP service.

Initialize a new DmapService.

Ancestors

Inherited members

class MrpService (identifier: Optional[str], port: int, credentials: Optional[str] = None, properties: Optional[Mapping[str, str]] = None)

Representation of a MediaRemote Protocol (MRP) service.

Initialize a new MrpService.

Ancestors

Inherited members

class RaopService (identifier: Optional[str], port: int = 7000, credentials: Optional[str] = None, password: Optional[str] = None, properties: Optional[Mapping[str, str]] = None)

Representation of an RAOP service.

Initialize a new RaopService.

Ancestors

Inherited members