Module pyatv.interface
Public interface exposed by library.
This module contains all the interfaces that represents a generic Apple TV device and all its features.
Expand source code
"""Public interface exposed by library.
This module contains all the interfaces that represents a generic Apple TV device and
all its features.
"""
import re
import inspect
import hashlib
from typing import (
Any,
Dict,
Optional,
NamedTuple,
Callable,
TypeVar,
Tuple,
Union,
List,
)
import weakref
from abc import ABC, abstractmethod
import aiohttp
from pyatv import const, convert, exceptions
from pyatv.const import (
Protocol,
OperatingSystem,
DeviceModel,
FeatureState,
FeatureName,
)
from pyatv.support import net
__pdoc__ = {}
__pdoc__["feature"] = False
_ALL_FEATURES = {} # type: Dict[int, Tuple[str, str]]
ReturnType = TypeVar("ReturnType", bound=Callable[..., Any])
class ArtworkInfo(NamedTuple):
"""Artwork information."""
bytes: bytes
mimetype: str
width: int
height: int
class FeatureInfo(NamedTuple):
"""Feature state and options."""
state: FeatureState
options: Optional[Dict[str, object]] = {}
class _ListenerProxy:
"""Proxy to call functions in a listener.
A proxy instance maintains a weak reference to a listener object and allows calling
functions in the listener. If no listener is set or the weak reference has expired,
a null-function (doing nothing) is returned so that nothing happens. This makes it
safe to call functions without having to check if either a listener has been set at
all or if the listener implements the called function.
"""
def __init__(self, listener):
"""Initialize a new ListenerProxy instance."""
self.listener = listener
def __getattr__(self, attr):
"""Dynamically find target method in listener."""
if self.listener is not None:
listener = self.listener()
if hasattr(listener, attr):
return getattr(listener, attr)
return lambda *args, **kwargs: None
class StateProducer:
"""Base class for objects announcing state changes to a listener."""
def __init__(self) -> None:
"""Initialize a new StateProducer instance."""
self.__listener: Optional[weakref.ReferenceType[Any]] = None
@property
def listener(self):
"""Return current listener object."""
return _ListenerProxy(self.__listener)
@listener.setter
def listener(self, target) -> None:
"""Change current listener object.
Set to None to remove active listener.
"""
if target is not None:
self.__listener = weakref.ref(target)
else:
self.__listener = None
def feature(index: int, name: str, doc: str) -> Callable[[ReturnType], ReturnType]:
"""Decorate functions and properties as a feature.
Note: This is an internal function.
"""
def _feat_decorator(func: ReturnType) -> ReturnType:
if index in _ALL_FEATURES:
raise Exception(
f"Index {index} collides between {name} and {_ALL_FEATURES[index]}"
)
_ALL_FEATURES[index] = (name, doc)
return func
return _feat_decorator
def _get_first_sentence_in_pydoc(obj):
doc = obj.__doc__
index = doc.find(".")
if index == -1:
# Here we have no leading . so return everything
return doc
# Try to find the first complete sentence and respect
# abbreviations correctly
match = re.findall(r"(.*\.[^A-Z]*)\.(?: [A-Z].*|)", doc)
if len(match) == 1:
return match[0]
return doc[0:index]
def retrieve_commands(obj: object):
"""Retrieve all commands and help texts from an API object."""
commands = {} # type: Dict[str, str]
for func in obj.__dict__:
if not inspect.isfunction(obj.__dict__[func]) and not isinstance(
obj.__dict__[func], property
):
continue
if func.startswith("_") or func == "listener":
continue
commands[func] = _get_first_sentence_in_pydoc(obj.__dict__[func])
return commands
class BaseService:
"""Base class for protocol services."""
def __init__(
self,
identifier: str,
protocol: Protocol,
port: int,
properties: Optional[Dict[str, str]],
) -> None:
"""Initialize a new BaseService."""
self.__identifier = identifier
self.protocol = protocol
self.port = port
self.credentials = None # type: Optional[str]
self.properties = properties or {}
@property
def identifier(self) -> str:
"""Return unique identifier associated with this service."""
return self.__identifier
def merge(self, other) -> None:
"""Merge with other service of same type."""
self.credentials = other.credentials or self.credentials
self.properties.update(other.properties)
def __str__(self) -> str:
"""Return a string representation of this object."""
return "Protocol: {0}, Port: {1}, Credentials: {2}".format(
convert.protocol_str(self.protocol), self.port, self.credentials
)
class PairingHandler(ABC):
"""Base class for API used to pair with an Apple TV."""
def __init__(self, session: aiohttp.ClientSession, service: BaseService) -> None:
"""Initialize a new instance of PairingHandler."""
self.session = session
self._service = service
@property
def service(self) -> BaseService:
"""Return service used for pairing."""
return self._service
async def close(self) -> None:
"""Call to free allocated resources after pairing."""
if net.is_custom_session(self.session):
await self.session.close()
@abstractmethod
def pin(self, pin) -> None:
"""Pin code used for pairing."""
raise exceptions.NotSupportedError()
@property
@abstractmethod
def device_provides_pin(self) -> bool:
"""Return True if remote device presents PIN code, else False."""
raise exceptions.NotSupportedError()
@property
@abstractmethod
def has_paired(self) -> bool:
"""If a successful pairing has been performed.
The value will be reset when stop() is called.
"""
raise exceptions.NotSupportedError()
@abstractmethod
async def begin(self) -> None:
"""Start pairing process."""
raise exceptions.NotSupportedError()
@abstractmethod
async def finish(self) -> None:
"""Stop pairing process."""
raise exceptions.NotSupportedError()
class RemoteControl(ABC): # pylint: disable=too-many-public-methods
"""Base class for API used to control an Apple TV."""
# pylint: disable=invalid-name
@abstractmethod
@feature(0, "Up", "Up button on remote.")
async def up(self) -> None:
"""Press key up."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(1, "Down", "Down button on remote.")
async def down(self) -> None:
"""Press key down."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(2, "Left", "Left button on remote.")
async def left(self) -> None:
"""Press key left."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(3, "Right", "Right button on remote.")
async def right(self) -> None:
"""Press key right."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(4, "Play", "Start playing media.")
async def play(self) -> None:
"""Press key play."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(5, "PlayPause", "Toggle between play/pause.")
async def play_pause(self) -> None:
"""Toggle between play and pause."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(6, "Pause", "Pause playing media.")
async def pause(self) -> None:
"""Press key play."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(7, "Stop", "Stop playing media.")
async def stop(self) -> None:
"""Press key stop."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(8, "Next", "Change to next item.")
async def next(self) -> None:
"""Press key next."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(9, "Previous", "Change to previous item.")
async def previous(self) -> None:
"""Press key previous."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(10, "Select", "Select current option.")
async def select(self) -> None:
"""Press key select."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(11, "Menu", "Go back to previous menu.")
async def menu(self) -> None:
"""Press key menu."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(12, "VolumeUp", "Increase volume.")
async def volume_up(self) -> None:
"""Press key volume up."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(13, "VolumeDown", "Decrease volume.")
async def volume_down(self) -> None:
"""Press key volume down."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(14, "Home", "Home/TV button.")
async def home(self) -> None:
"""Press key home."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(15, "HomeHold", "Long-press home button.")
async def home_hold(self) -> None:
"""Hold key home."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(16, "TopMenu", "Go to main menu.")
async def top_menu(self) -> None:
"""Go to main menu (long press menu)."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(17, "Suspend", "Suspend device (deprecated; use Power.turn_off).")
async def suspend(self) -> None:
"""Suspend the device."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(18, "WakeUp", "Wake up device (deprecated; use Power.turn_on).")
async def wakeup(self) -> None:
"""Wake up the device."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(
36, "SkipForward", "Skip forward a time interval.",
)
async def skip_forward(self) -> None:
"""Skip forward a time interval.
Skip interval is typically 15-30s, but is decided by the app.
"""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(37, "SkipBackward", "Skip backwards a time interval.")
async def skip_backward(self) -> None:
"""Skip backwards a time interval.
Skip interval is typically 15-30s, but is decided by the app.
"""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(19, "SetPosition", "Seek to position.")
async def set_position(self, pos: int) -> None:
"""Seek in the current playing media."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(20, "SetShuffle", "Change shuffle state.")
async def set_shuffle(self, shuffle_state: const.ShuffleState) -> None:
"""Change shuffle mode to on or off."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(21, "SetRepeat", "Change repeat state.")
async def set_repeat(self, repeat_state: const.RepeatState) -> None:
"""Change repeat state."""
raise exceptions.NotSupportedError()
class Playing(ABC):
"""Base class for retrieving what is currently playing."""
def __str__(self) -> str:
"""Convert this playing object to a readable string."""
output = []
output.append(
" Media type: {0}".format(convert.media_type_str(self.media_type))
)
output.append(
"Device state: {0}".format(convert.device_state_str(self.device_state))
)
if self.title is not None:
output.append(" Title: {0}".format(self.title))
if self.artist is not None:
output.append(" Artist: {0}".format(self.artist))
if self.album is not None:
output.append(" Album: {0}".format(self.album))
if self.genre is not None:
output.append(" Genre: {0}".format(self.genre))
position = self.position
total_time = self.total_time
if position is not None and total_time is not None and total_time != 0:
output.append(
" Position: {0}/{1}s ({2:.1%})".format(
position, total_time, float(position) / float(total_time)
)
)
elif position is not None and position != 0:
output.append(" Position: {0}s".format(position))
elif total_time is not None and position != 0:
output.append(" Total time: {0}s".format(total_time))
if self.repeat is not None:
output.append(" Repeat: {0}".format(convert.repeat_str(self.repeat)))
if self.shuffle is not None:
output.append(" Shuffle: {0}".format(convert.shuffle_str(self.shuffle)))
return "\n".join(output)
@property
def hash(self) -> str:
"""Create a unique hash for what is currently playing.
The hash is based on title, artist, album and total time. It should
always be the same for the same content, but it is not guaranteed.
"""
base = "{0}{1}{2}{3}".format(
self.title, self.artist, self.album, self.total_time
)
return hashlib.sha256(base.encode("utf-8")).hexdigest()
@property
@abstractmethod
def media_type(self) -> const.MediaType:
"""Type of media is currently playing, e.g. video, music."""
raise exceptions.NotSupportedError()
@property
@abstractmethod
def device_state(self) -> const.DeviceState:
"""Device state, e.g. playing or paused."""
raise exceptions.NotSupportedError()
@property # type: ignore
@abstractmethod
@feature(22, "Title", "Title of playing media.")
def title(self) -> Optional[str]:
"""Title of the current media, e.g. movie or song name."""
raise exceptions.NotSupportedError()
@property # type: ignore
@abstractmethod
@feature(23, "Artist", "Artist of playing song.")
def artist(self) -> Optional[str]:
"""Artist of the currently playing song."""
raise exceptions.NotSupportedError()
@property # type: ignore
@abstractmethod
@feature(24, "Album", "Album from playing artist.")
def album(self) -> Optional[str]:
"""Album of the currently playing song."""
raise exceptions.NotSupportedError()
@property # type: ignore
@abstractmethod
@feature(25, "Genre", "Genre of playing song.")
def genre(self) -> Optional[str]:
"""Genre of the currently playing song."""
raise exceptions.NotSupportedError()
@property # type: ignore
@abstractmethod
@feature(26, "TotalTime", "Total length of playing media (seconds).")
def total_time(self) -> int:
"""Total play time in seconds."""
raise exceptions.NotSupportedError()
@property # type: ignore
@abstractmethod
@feature(27, "Position", "Current play time position.")
def position(self) -> int:
"""Position in the playing media (seconds)."""
raise exceptions.NotSupportedError()
@property # type: ignore
@abstractmethod
@feature(28, "Shuffle", "Shuffle stat.e")
def shuffle(self) -> const.ShuffleState:
"""If shuffle is enabled or not."""
raise exceptions.NotSupportedError()
@property # type: ignore
@abstractmethod
@feature(29, "Repeat", "Repeat state.")
def repeat(self) -> const.RepeatState:
"""Repeat mode."""
raise exceptions.NotSupportedError()
class App:
"""Information about an app."""
def __init__(self, name: Optional[str], identifier: str) -> None:
"""Initialize a new App instance."""
self._name = name
self._identifier = identifier
@property
def name(self) -> Optional[str]:
"""User friendly name of app."""
return self._name
@property
def identifier(self) -> str:
"""Return a unique bundle id for the app."""
return self._identifier
def __str__(self) -> str:
"""Convert app info to readable string."""
return f"App: {self.name} ({self.identifier})"
class Metadata(ABC):
"""Base class for retrieving metadata from an Apple TV."""
def __init__(self, identifier: str) -> None:
"""Initialize a new instance of Metadata."""
self._identifier = identifier
@property
def device_id(self) -> Optional[str]:
"""Return a unique identifier for current device."""
return self._identifier
@abstractmethod
@feature(30, "Artwork", "Playing media artwork.")
async def artwork(self, width=512, height=None) -> Optional[ArtworkInfo]:
"""Return artwork for what is currently playing (or None).
The parameters "width" and "height" makes it possible to request artwork of a
specific size. This is just a request, the device might impose restrictions and
return artwork of a different size. Set both parameters to None to request
default size. Set one of them and let the other one be None to keep original
aspect ratio.
"""
raise exceptions.NotSupportedError()
@property
@abstractmethod
def artwork_id(self) -> str:
"""Return a unique identifier for current artwork."""
raise exceptions.NotSupportedError()
@abstractmethod
async def playing(self) -> Playing:
"""Return what is currently playing."""
raise exceptions.NotSupportedError()
@property # type: ignore
@abstractmethod
@feature(35, "App", "App playing media.")
def app(self) -> Optional[App]:
"""Return information about current app playing something.
Do note that this property returns which app is currently playing something and
not which app is currently active. If nothing is playing, the corresponding
feature will be unavailable.
"""
raise exceptions.NotSupportedError()
class PushListener(ABC):
"""Listener interface for push updates."""
@abstractmethod
def playstatus_update(self, updater, playstatus: Playing) -> None:
"""Inform about changes to what is currently playing."""
@abstractmethod
def playstatus_error(self, updater, exception: Exception) -> None:
"""Inform about an error when updating play status."""
class PushUpdater(ABC, StateProducer):
"""Base class for push/async updates from an Apple TV.
Listener interface: `pyatv.interface.PushListener`
"""
@property
@abstractmethod
def active(self) -> bool:
"""Return if push updater has been started."""
raise exceptions.NotSupportedError()
@abstractmethod
def start(self, initial_delay: int = 0) -> None:
"""Begin to listen to updates.
If an error occurs, start must be called again.
"""
raise exceptions.NotSupportedError()
@abstractmethod
def stop(self) -> None:
"""No longer forward updates to listener."""
raise exceptions.NotSupportedError()
class Stream(ABC): # pylint: disable=too-few-public-methods
"""Base class for stream functionality."""
@abstractmethod
def close(self) -> None:
"""Close connection and release allocated resources."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(31, "PlayUrl", "Stream a URL on device.")
async def play_url(self, url: str, **kwargs) -> None:
"""Play media from an URL on the device."""
raise exceptions.NotSupportedError()
class DeviceListener(ABC):
"""Listener interface for generic device updates."""
@abstractmethod
def connection_lost(self, exception: Exception) -> None:
"""Device was unexpectedly disconnected."""
raise NotImplementedError()
@abstractmethod
def connection_closed(self) -> None:
"""Device connection was (intentionally) closed."""
raise NotImplementedError()
class PowerListener(ABC): # pylint: disable=too-few-public-methods
"""Listener interface for power updates."""
@abstractmethod
def powerstate_update(
self, old_state: const.PowerState, new_state: const.PowerState
):
"""Device power state was updated."""
raise NotImplementedError()
class Power(ABC, StateProducer):
"""Base class for retrieving power state from an Apple TV.
Listener interface: `pyatv.interfaces.PowerListener`
"""
@property # type: ignore
@abstractmethod
@feature(32, "PowerState", "Current device power state.")
def power_state(self) -> const.PowerState:
"""Return device power state."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(33, "TurnOn", "Turn device on.")
async def turn_on(self) -> None:
"""Turn device on."""
raise exceptions.NotSupportedError()
@abstractmethod
@feature(34, "TurnOff", "Turn off device.")
async def turn_off(self) -> None:
"""Turn device off."""
raise exceptions.NotSupportedError()
class DeviceInfo:
"""General information about device."""
def __init__(
self,
os: const.OperatingSystem,
version: Optional[str],
build_number: Optional[str],
model: const.DeviceModel,
mac: Optional[str],
) -> None: # pylint: disable=too-many-arguments # noqa
"""Initialize a new DeviceInfo instance."""
self._os = os
self._version = version
self._build_number = build_number
self._model = model
self._mac = mac
@property
def operating_system(self) -> const.OperatingSystem:
"""Operating system running on device."""
return self._os
@property
def version(self) -> Optional[str]:
"""Operating system version."""
return self._version
@property
def build_number(self) -> Optional[str]:
"""Operating system build number, e.g. 17K795."""
return self._build_number
@property
def model(self) -> const.DeviceModel:
"""Hardware model name, e.g. 3, 4 or 4K."""
return self._model
@property
def mac(self) -> Optional[str]:
"""Device MAC address."""
return self._mac
def __str__(self) -> str:
"""Convert device info to readable string."""
if self.model != DeviceModel.Unknown:
output = self.model.name.replace("Gen", "")
else:
output = "Unknown Model"
output += " " + {
OperatingSystem.Legacy: "ATV SW",
OperatingSystem.TvOS: "tvOS",
}.get(self.operating_system, "Unknown OS")
if self.version:
output += " " + self.version
if self.build_number:
output += " build " + self.build_number
return output
class Features(ABC):
"""Base class for supported feature functionality."""
@abstractmethod
def get_feature(self, feature: FeatureName) -> FeatureInfo:
"""Return current state of a feature."""
raise NotImplementedError()
def all_features(self, include_unsupported=False) -> Dict[FeatureName, FeatureInfo]:
"""Return state of all features."""
features = {} # type: Dict[FeatureName, FeatureInfo]
for name in FeatureName:
feature = self.get_feature(name)
if feature.state != FeatureState.Unsupported or include_unsupported:
features[name] = feature
return features
def in_state(
self,
states: Union[List[FeatureState], FeatureState],
*feature_names: FeatureName
):
"""Return if features are in a specific state.
This method will return True if all given features are in the state specified
by "states". If "states" is a list of states, it is enough for the feature to be
in one of the listed states.
"""
for name in feature_names:
feature = self.get_feature(name)
expected_states = states if isinstance(states, list) else [states]
if feature.state not in expected_states:
return False
return True
class AppleTV(ABC, StateProducer):
"""Base class representing an Apple TV.
Listener interface: `pyatv.interfaces.DeviceListener`
"""
@abstractmethod
async def connect(self) -> None:
"""Initiate connection to device.
No need to call it yourself, it's done automatically.
"""
raise exceptions.NotSupportedError()
@abstractmethod
def close(self) -> None:
"""Close connection and release allocated resources."""
raise exceptions.NotSupportedError()
@property
@abstractmethod
def device_info(self) -> DeviceInfo:
"""Return API for device information."""
raise exceptions.NotSupportedError()
@property
@abstractmethod
def service(self) -> BaseService:
"""Return service used to connect to the Apple TV."""
raise exceptions.NotSupportedError()
@property
@abstractmethod
def remote_control(self) -> RemoteControl:
"""Return API for controlling the Apple TV."""
raise exceptions.NotSupportedError()
@property
@abstractmethod
def metadata(self) -> Metadata:
"""Return API for retrieving metadata from the Apple TV."""
raise exceptions.NotSupportedError()
@property
@abstractmethod
def push_updater(self) -> PushUpdater:
"""Return API for handling push update from the Apple TV."""
raise exceptions.NotSupportedError()
@property
@abstractmethod
def stream(self) -> Stream:
"""Return API for streaming media."""
raise exceptions.NotSupportedError()
@property
@abstractmethod
def power(self) -> Power:
"""Return API for power management."""
raise exceptions.NotSupportedError()
@property
@abstractmethod
def features(self) -> Features:
"""Return features interface."""
raise exceptions.NotSupportedError()
Functions
def retrieve_commands(obj: object)
-
Retrieve all commands and help texts from an API object.
Expand source code
def retrieve_commands(obj: object): """Retrieve all commands and help texts from an API object.""" commands = {} # type: Dict[str, str] for func in obj.__dict__: if not inspect.isfunction(obj.__dict__[func]) and not isinstance( obj.__dict__[func], property ): continue if func.startswith("_") or func == "listener": continue commands[func] = _get_first_sentence_in_pydoc(obj.__dict__[func]) return commands
Classes
class App (name: Union[str, NoneType], identifier: str)
-
Information about an app.
Initialize a new App instance.
Expand source code
class App: """Information about an app.""" def __init__(self, name: Optional[str], identifier: str) -> None: """Initialize a new App instance.""" self._name = name self._identifier = identifier @property def name(self) -> Optional[str]: """User friendly name of app.""" return self._name @property def identifier(self) -> str: """Return a unique bundle id for the app.""" return self._identifier def __str__(self) -> str: """Convert app info to readable string.""" return f"App: {self.name} ({self.identifier})"
Instance variables
var identifier -> str
-
Return a unique bundle id for the app.
Expand source code
@property def identifier(self) -> str: """Return a unique bundle id for the app.""" return self._identifier
var name -> Union[str, NoneType]
-
User friendly name of app.
Expand source code
@property def name(self) -> Optional[str]: """User friendly name of app.""" return self._name
class AppleTV
-
Base class representing an Apple TV.
Listener interface:
pyatv.interfaces.DeviceListener
Initialize a new StateProducer instance.
Expand source code
class AppleTV(ABC, StateProducer): """Base class representing an Apple TV. Listener interface: `pyatv.interfaces.DeviceListener` """ @abstractmethod async def connect(self) -> None: """Initiate connection to device. No need to call it yourself, it's done automatically. """ raise exceptions.NotSupportedError() @abstractmethod def close(self) -> None: """Close connection and release allocated resources.""" raise exceptions.NotSupportedError() @property @abstractmethod def device_info(self) -> DeviceInfo: """Return API for device information.""" raise exceptions.NotSupportedError() @property @abstractmethod def service(self) -> BaseService: """Return service used to connect to the Apple TV.""" raise exceptions.NotSupportedError() @property @abstractmethod def remote_control(self) -> RemoteControl: """Return API for controlling the Apple TV.""" raise exceptions.NotSupportedError() @property @abstractmethod def metadata(self) -> Metadata: """Return API for retrieving metadata from the Apple TV.""" raise exceptions.NotSupportedError() @property @abstractmethod def push_updater(self) -> PushUpdater: """Return API for handling push update from the Apple TV.""" raise exceptions.NotSupportedError() @property @abstractmethod def stream(self) -> Stream: """Return API for streaming media.""" raise exceptions.NotSupportedError() @property @abstractmethod def power(self) -> Power: """Return API for power management.""" raise exceptions.NotSupportedError() @property @abstractmethod def features(self) -> Features: """Return features interface.""" raise exceptions.NotSupportedError()
Ancestors
- abc.ABC
- StateProducer
Subclasses
- pyatv.dmap.DmapAppleTV
- pyatv.mrp.MrpAppleTV
Instance variables
var device_info -> DeviceInfo
-
Return API for device information.
Expand source code
@property @abstractmethod def device_info(self) -> DeviceInfo: """Return API for device information.""" raise exceptions.NotSupportedError()
var features -> Features
-
Return features interface.
Expand source code
@property @abstractmethod def features(self) -> Features: """Return features interface.""" raise exceptions.NotSupportedError()
var metadata -> Metadata
-
Return API for retrieving metadata from the Apple TV.
Expand source code
@property @abstractmethod def metadata(self) -> Metadata: """Return API for retrieving metadata from the Apple TV.""" raise exceptions.NotSupportedError()
var power -> Power
-
Return API for power management.
Expand source code
@property @abstractmethod def power(self) -> Power: """Return API for power management.""" raise exceptions.NotSupportedError()
var push_updater -> PushUpdater
-
Return API for handling push update from the Apple TV.
Expand source code
@property @abstractmethod def push_updater(self) -> PushUpdater: """Return API for handling push update from the Apple TV.""" raise exceptions.NotSupportedError()
var remote_control -> RemoteControl
-
Return API for controlling the Apple TV.
Expand source code
@property @abstractmethod def remote_control(self) -> RemoteControl: """Return API for controlling the Apple TV.""" raise exceptions.NotSupportedError()
var service -> BaseService
-
Return service used to connect to the Apple TV.
Expand source code
@property @abstractmethod def service(self) -> BaseService: """Return service used to connect to the Apple TV.""" raise exceptions.NotSupportedError()
var stream -> Stream
-
Return API for streaming media.
Expand source code
@property @abstractmethod def stream(self) -> Stream: """Return API for streaming media.""" raise exceptions.NotSupportedError()
Methods
def close(self) -> NoneType
-
Close connection and release allocated resources.
Expand source code
@abstractmethod def close(self) -> None: """Close connection and release allocated resources.""" raise exceptions.NotSupportedError()
async def connect(self) -> NoneType
-
Initiate connection to device.
No need to call it yourself, it's done automatically.
Expand source code
@abstractmethod async def connect(self) -> None: """Initiate connection to device. No need to call it yourself, it's done automatically. """ raise exceptions.NotSupportedError()
Inherited members
class ArtworkInfo (bytes: bytes, mimetype: str, width: int, height: int)
-
Artwork information.
Expand source code
class ArtworkInfo(NamedTuple): """Artwork information.""" bytes: bytes mimetype: str width: int height: int
Ancestors
- builtins.tuple
Instance variables
var bytes -> bytes
-
Alias for field number 0
var height -> int
-
Alias for field number 3
var mimetype -> str
-
Alias for field number 1
var width -> int
-
Alias for field number 2
class BaseService (identifier: str, protocol: Protocol, port: int, properties: Union[Dict[str, str], NoneType])
-
Base class for protocol services.
Initialize a new BaseService.
Expand source code
class BaseService: """Base class for protocol services.""" def __init__( self, identifier: str, protocol: Protocol, port: int, properties: Optional[Dict[str, str]], ) -> None: """Initialize a new BaseService.""" self.__identifier = identifier self.protocol = protocol self.port = port self.credentials = None # type: Optional[str] self.properties = properties or {} @property def identifier(self) -> str: """Return unique identifier associated with this service.""" return self.__identifier def merge(self, other) -> None: """Merge with other service of same type.""" self.credentials = other.credentials or self.credentials self.properties.update(other.properties) def __str__(self) -> str: """Return a string representation of this object.""" return "Protocol: {0}, Port: {1}, Credentials: {2}".format( convert.protocol_str(self.protocol), self.port, self.credentials )
Subclasses
Instance variables
var identifier -> str
-
Return unique identifier associated with this service.
Expand source code
@property def identifier(self) -> str: """Return unique identifier associated with this service.""" return self.__identifier
Methods
def merge(self, other) -> NoneType
-
Merge with other service of same type.
Expand source code
def merge(self, other) -> None: """Merge with other service of same type.""" self.credentials = other.credentials or self.credentials self.properties.update(other.properties)
class DeviceInfo (os: OperatingSystem, version: Union[str, NoneType], build_number: Union[str, NoneType], model: DeviceModel, mac: Union[str, NoneType])
-
General information about device.
Initialize a new DeviceInfo instance.
Expand source code
class DeviceInfo: """General information about device.""" def __init__( self, os: const.OperatingSystem, version: Optional[str], build_number: Optional[str], model: const.DeviceModel, mac: Optional[str], ) -> None: # pylint: disable=too-many-arguments # noqa """Initialize a new DeviceInfo instance.""" self._os = os self._version = version self._build_number = build_number self._model = model self._mac = mac @property def operating_system(self) -> const.OperatingSystem: """Operating system running on device.""" return self._os @property def version(self) -> Optional[str]: """Operating system version.""" return self._version @property def build_number(self) -> Optional[str]: """Operating system build number, e.g. 17K795.""" return self._build_number @property def model(self) -> const.DeviceModel: """Hardware model name, e.g. 3, 4 or 4K.""" return self._model @property def mac(self) -> Optional[str]: """Device MAC address.""" return self._mac def __str__(self) -> str: """Convert device info to readable string.""" if self.model != DeviceModel.Unknown: output = self.model.name.replace("Gen", "") else: output = "Unknown Model" output += " " + { OperatingSystem.Legacy: "ATV SW", OperatingSystem.TvOS: "tvOS", }.get(self.operating_system, "Unknown OS") if self.version: output += " " + self.version if self.build_number: output += " build " + self.build_number return output
Instance variables
var build_number -> Union[str, NoneType]
-
Operating system build number, e.g. 17K795.
Expand source code
@property def build_number(self) -> Optional[str]: """Operating system build number, e.g. 17K795.""" return self._build_number
var mac -> Union[str, NoneType]
-
Device MAC address.
Expand source code
@property def mac(self) -> Optional[str]: """Device MAC address.""" return self._mac
var model -> DeviceModel
-
Hardware model name, e.g. 3, 4 or 4K.
Expand source code
@property def model(self) -> const.DeviceModel: """Hardware model name, e.g. 3, 4 or 4K.""" return self._model
var operating_system -> OperatingSystem
-
Operating system running on device.
Expand source code
@property def operating_system(self) -> const.OperatingSystem: """Operating system running on device.""" return self._os
var version -> Union[str, NoneType]
-
Operating system version.
Expand source code
@property def version(self) -> Optional[str]: """Operating system version.""" return self._version
class DeviceListener
-
Listener interface for generic device updates.
Expand source code
class DeviceListener(ABC): """Listener interface for generic device updates.""" @abstractmethod def connection_lost(self, exception: Exception) -> None: """Device was unexpectedly disconnected.""" raise NotImplementedError() @abstractmethod def connection_closed(self) -> None: """Device connection was (intentionally) closed.""" raise NotImplementedError()
Ancestors
- abc.ABC
Subclasses
- pyatv.scripts.atvremote.DeviceListener
- pyatv.scripts.atvscript.DevicePrinter
Methods
def connection_closed(self) -> NoneType
-
Device connection was (intentionally) closed.
Expand source code
@abstractmethod def connection_closed(self) -> None: """Device connection was (intentionally) closed.""" raise NotImplementedError()
def connection_lost(self, exception: Exception) -> NoneType
-
Device was unexpectedly disconnected.
Expand source code
@abstractmethod def connection_lost(self, exception: Exception) -> None: """Device was unexpectedly disconnected.""" raise NotImplementedError()
class FeatureInfo (state: FeatureState, options: Union[Dict[str, object], NoneType] = {})
-
Feature state and options.
Expand source code
class FeatureInfo(NamedTuple): """Feature state and options.""" state: FeatureState options: Optional[Dict[str, object]] = {}
Ancestors
- builtins.tuple
Instance variables
var options -> Union[Dict[str, object], NoneType]
-
Alias for field number 1
var state -> FeatureState
-
Alias for field number 0
class Features
-
Base class for supported feature functionality.
Expand source code
class Features(ABC): """Base class for supported feature functionality.""" @abstractmethod def get_feature(self, feature: FeatureName) -> FeatureInfo: """Return current state of a feature.""" raise NotImplementedError() def all_features(self, include_unsupported=False) -> Dict[FeatureName, FeatureInfo]: """Return state of all features.""" features = {} # type: Dict[FeatureName, FeatureInfo] for name in FeatureName: feature = self.get_feature(name) if feature.state != FeatureState.Unsupported or include_unsupported: features[name] = feature return features def in_state( self, states: Union[List[FeatureState], FeatureState], *feature_names: FeatureName ): """Return if features are in a specific state. This method will return True if all given features are in the state specified by "states". If "states" is a list of states, it is enough for the feature to be in one of the listed states. """ for name in feature_names: feature = self.get_feature(name) expected_states = states if isinstance(states, list) else [states] if feature.state not in expected_states: return False return True
Ancestors
- abc.ABC
Subclasses
- pyatv.dmap.DmapFeatures
- pyatv.mrp.MrpFeatures
Methods
def all_features(self, include_unsupported=False) -> Dict[FeatureName, FeatureInfo]
-
Return state of all features.
Expand source code
def all_features(self, include_unsupported=False) -> Dict[FeatureName, FeatureInfo]: """Return state of all features.""" features = {} # type: Dict[FeatureName, FeatureInfo] for name in FeatureName: feature = self.get_feature(name) if feature.state != FeatureState.Unsupported or include_unsupported: features[name] = feature return features
def get_feature(self, feature: FeatureName) -> FeatureInfo
-
Return current state of a feature.
Expand source code
@abstractmethod def get_feature(self, feature: FeatureName) -> FeatureInfo: """Return current state of a feature.""" raise NotImplementedError()
def in_state(self, states: Union[List[pyatv.const.FeatureState], pyatv.const.FeatureState], *feature_names: FeatureName)
-
Return if features are in a specific state.
This method will return True if all given features are in the state specified by "states". If "states" is a list of states, it is enough for the feature to be in one of the listed states.
Expand source code
def in_state( self, states: Union[List[FeatureState], FeatureState], *feature_names: FeatureName ): """Return if features are in a specific state. This method will return True if all given features are in the state specified by "states". If "states" is a list of states, it is enough for the feature to be in one of the listed states. """ for name in feature_names: feature = self.get_feature(name) expected_states = states if isinstance(states, list) else [states] if feature.state not in expected_states: return False return True
class Metadata (identifier: str)
-
Base class for retrieving metadata from an Apple TV.
Initialize a new instance of Metadata.
Expand source code
class Metadata(ABC): """Base class for retrieving metadata from an Apple TV.""" def __init__(self, identifier: str) -> None: """Initialize a new instance of Metadata.""" self._identifier = identifier @property def device_id(self) -> Optional[str]: """Return a unique identifier for current device.""" return self._identifier @abstractmethod @feature(30, "Artwork", "Playing media artwork.") async def artwork(self, width=512, height=None) -> Optional[ArtworkInfo]: """Return artwork for what is currently playing (or None). The parameters "width" and "height" makes it possible to request artwork of a specific size. This is just a request, the device might impose restrictions and return artwork of a different size. Set both parameters to None to request default size. Set one of them and let the other one be None to keep original aspect ratio. """ raise exceptions.NotSupportedError() @property @abstractmethod def artwork_id(self) -> str: """Return a unique identifier for current artwork.""" raise exceptions.NotSupportedError() @abstractmethod async def playing(self) -> Playing: """Return what is currently playing.""" raise exceptions.NotSupportedError() @property # type: ignore @abstractmethod @feature(35, "App", "App playing media.") def app(self) -> Optional[App]: """Return information about current app playing something. Do note that this property returns which app is currently playing something and not which app is currently active. If nothing is playing, the corresponding feature will be unavailable. """ raise exceptions.NotSupportedError()
Ancestors
- abc.ABC
Subclasses
- pyatv.dmap.DmapMetadata
- pyatv.mrp.MrpMetadata
Instance variables
var app -> Union[App, NoneType]
-
Return information about current app playing something.
Do note that this property returns which app is currently playing something and not which app is currently active. If nothing is playing, the corresponding feature will be unavailable.
Expand source code
@property # type: ignore @abstractmethod @feature(35, "App", "App playing media.") def app(self) -> Optional[App]: """Return information about current app playing something. Do note that this property returns which app is currently playing something and not which app is currently active. If nothing is playing, the corresponding feature will be unavailable. """ raise exceptions.NotSupportedError()
var artwork_id -> str
-
Return a unique identifier for current artwork.
Expand source code
@property @abstractmethod def artwork_id(self) -> str: """Return a unique identifier for current artwork.""" raise exceptions.NotSupportedError()
var device_id -> Union[str, NoneType]
-
Return a unique identifier for current device.
Expand source code
@property def device_id(self) -> Optional[str]: """Return a unique identifier for current device.""" return self._identifier
Methods
async def artwork(self, width=512, height=None) -> Union[ArtworkInfo, NoneType]
-
Return artwork for what is currently playing (or None).
The parameters "width" and "height" makes it possible to request artwork of a specific size. This is just a request, the device might impose restrictions and return artwork of a different size. Set both parameters to None to request default size. Set one of them and let the other one be None to keep original aspect ratio.
Expand source code
@abstractmethod @feature(30, "Artwork", "Playing media artwork.") async def artwork(self, width=512, height=None) -> Optional[ArtworkInfo]: """Return artwork for what is currently playing (or None). The parameters "width" and "height" makes it possible to request artwork of a specific size. This is just a request, the device might impose restrictions and return artwork of a different size. Set both parameters to None to request default size. Set one of them and let the other one be None to keep original aspect ratio. """ raise exceptions.NotSupportedError()
async def playing(self) -> Playing
-
Return what is currently playing.
Expand source code
@abstractmethod async def playing(self) -> Playing: """Return what is currently playing.""" raise exceptions.NotSupportedError()
class PairingHandler (session: aiohttp.client.ClientSession, service: BaseService)
-
Base class for API used to pair with an Apple TV.
Initialize a new instance of PairingHandler.
Expand source code
class PairingHandler(ABC): """Base class for API used to pair with an Apple TV.""" def __init__(self, session: aiohttp.ClientSession, service: BaseService) -> None: """Initialize a new instance of PairingHandler.""" self.session = session self._service = service @property def service(self) -> BaseService: """Return service used for pairing.""" return self._service async def close(self) -> None: """Call to free allocated resources after pairing.""" if net.is_custom_session(self.session): await self.session.close() @abstractmethod def pin(self, pin) -> None: """Pin code used for pairing.""" raise exceptions.NotSupportedError() @property @abstractmethod def device_provides_pin(self) -> bool: """Return True if remote device presents PIN code, else False.""" raise exceptions.NotSupportedError() @property @abstractmethod def has_paired(self) -> bool: """If a successful pairing has been performed. The value will be reset when stop() is called. """ raise exceptions.NotSupportedError() @abstractmethod async def begin(self) -> None: """Start pairing process.""" raise exceptions.NotSupportedError() @abstractmethod async def finish(self) -> None: """Stop pairing process.""" raise exceptions.NotSupportedError()
Ancestors
- abc.ABC
Subclasses
- pyatv.airplay.pairing.AirPlayPairingHandler
- pyatv.dmap.pairing.DmapPairingHandler
- pyatv.mrp.pairing.MrpPairingHandler
Instance variables
var device_provides_pin -> bool
-
Return True if remote device presents PIN code, else False.
Expand source code
@property @abstractmethod def device_provides_pin(self) -> bool: """Return True if remote device presents PIN code, else False.""" raise exceptions.NotSupportedError()
var has_paired -> bool
-
If a successful pairing has been performed.
The value will be reset when stop() is called.
Expand source code
@property @abstractmethod def has_paired(self) -> bool: """If a successful pairing has been performed. The value will be reset when stop() is called. """ raise exceptions.NotSupportedError()
var service -> BaseService
-
Return service used for pairing.
Expand source code
@property def service(self) -> BaseService: """Return service used for pairing.""" return self._service
Methods
async def begin(self) -> NoneType
-
Start pairing process.
Expand source code
@abstractmethod async def begin(self) -> None: """Start pairing process.""" raise exceptions.NotSupportedError()
async def close(self) -> NoneType
-
Call to free allocated resources after pairing.
Expand source code
async def close(self) -> None: """Call to free allocated resources after pairing.""" if net.is_custom_session(self.session): await self.session.close()
async def finish(self) -> NoneType
-
Stop pairing process.
Expand source code
@abstractmethod async def finish(self) -> None: """Stop pairing process.""" raise exceptions.NotSupportedError()
def pin(self, pin) -> NoneType
-
Pin code used for pairing.
Expand source code
@abstractmethod def pin(self, pin) -> None: """Pin code used for pairing.""" raise exceptions.NotSupportedError()
class Playing
-
Base class for retrieving what is currently playing.
Expand source code
class Playing(ABC): """Base class for retrieving what is currently playing.""" def __str__(self) -> str: """Convert this playing object to a readable string.""" output = [] output.append( " Media type: {0}".format(convert.media_type_str(self.media_type)) ) output.append( "Device state: {0}".format(convert.device_state_str(self.device_state)) ) if self.title is not None: output.append(" Title: {0}".format(self.title)) if self.artist is not None: output.append(" Artist: {0}".format(self.artist)) if self.album is not None: output.append(" Album: {0}".format(self.album)) if self.genre is not None: output.append(" Genre: {0}".format(self.genre)) position = self.position total_time = self.total_time if position is not None and total_time is not None and total_time != 0: output.append( " Position: {0}/{1}s ({2:.1%})".format( position, total_time, float(position) / float(total_time) ) ) elif position is not None and position != 0: output.append(" Position: {0}s".format(position)) elif total_time is not None and position != 0: output.append(" Total time: {0}s".format(total_time)) if self.repeat is not None: output.append(" Repeat: {0}".format(convert.repeat_str(self.repeat))) if self.shuffle is not None: output.append(" Shuffle: {0}".format(convert.shuffle_str(self.shuffle))) return "\n".join(output) @property def hash(self) -> str: """Create a unique hash for what is currently playing. The hash is based on title, artist, album and total time. It should always be the same for the same content, but it is not guaranteed. """ base = "{0}{1}{2}{3}".format( self.title, self.artist, self.album, self.total_time ) return hashlib.sha256(base.encode("utf-8")).hexdigest() @property @abstractmethod def media_type(self) -> const.MediaType: """Type of media is currently playing, e.g. video, music.""" raise exceptions.NotSupportedError() @property @abstractmethod def device_state(self) -> const.DeviceState: """Device state, e.g. playing or paused.""" raise exceptions.NotSupportedError() @property # type: ignore @abstractmethod @feature(22, "Title", "Title of playing media.") def title(self) -> Optional[str]: """Title of the current media, e.g. movie or song name.""" raise exceptions.NotSupportedError() @property # type: ignore @abstractmethod @feature(23, "Artist", "Artist of playing song.") def artist(self) -> Optional[str]: """Artist of the currently playing song.""" raise exceptions.NotSupportedError() @property # type: ignore @abstractmethod @feature(24, "Album", "Album from playing artist.") def album(self) -> Optional[str]: """Album of the currently playing song.""" raise exceptions.NotSupportedError() @property # type: ignore @abstractmethod @feature(25, "Genre", "Genre of playing song.") def genre(self) -> Optional[str]: """Genre of the currently playing song.""" raise exceptions.NotSupportedError() @property # type: ignore @abstractmethod @feature(26, "TotalTime", "Total length of playing media (seconds).") def total_time(self) -> int: """Total play time in seconds.""" raise exceptions.NotSupportedError() @property # type: ignore @abstractmethod @feature(27, "Position", "Current play time position.") def position(self) -> int: """Position in the playing media (seconds).""" raise exceptions.NotSupportedError() @property # type: ignore @abstractmethod @feature(28, "Shuffle", "Shuffle stat.e") def shuffle(self) -> const.ShuffleState: """If shuffle is enabled or not.""" raise exceptions.NotSupportedError() @property # type: ignore @abstractmethod @feature(29, "Repeat", "Repeat state.") def repeat(self) -> const.RepeatState: """Repeat mode.""" raise exceptions.NotSupportedError()
Ancestors
- abc.ABC
Subclasses
- pyatv.dmap.DmapPlaying
- pyatv.mrp.MrpPlaying
Instance variables
var album -> Union[str, NoneType]
-
Album of the currently playing song.
Expand source code
@property # type: ignore @abstractmethod @feature(24, "Album", "Album from playing artist.") def album(self) -> Optional[str]: """Album of the currently playing song.""" raise exceptions.NotSupportedError()
var artist -> Union[str, NoneType]
-
Artist of the currently playing song.
Expand source code
@property # type: ignore @abstractmethod @feature(23, "Artist", "Artist of playing song.") def artist(self) -> Optional[str]: """Artist of the currently playing song.""" raise exceptions.NotSupportedError()
var device_state -> DeviceState
-
Device state, e.g. playing or paused.
Expand source code
@property @abstractmethod def device_state(self) -> const.DeviceState: """Device state, e.g. playing or paused.""" raise exceptions.NotSupportedError()
var genre -> Union[str, NoneType]
-
Genre of the currently playing song.
Expand source code
@property # type: ignore @abstractmethod @feature(25, "Genre", "Genre of playing song.") def genre(self) -> Optional[str]: """Genre of the currently playing song.""" raise exceptions.NotSupportedError()
var hash -> str
-
Create a unique hash for what is currently playing.
The hash is based on title, artist, album and total time. It should always be the same for the same content, but it is not guaranteed.
Expand source code
@property def hash(self) -> str: """Create a unique hash for what is currently playing. The hash is based on title, artist, album and total time. It should always be the same for the same content, but it is not guaranteed. """ base = "{0}{1}{2}{3}".format( self.title, self.artist, self.album, self.total_time ) return hashlib.sha256(base.encode("utf-8")).hexdigest()
var media_type -> MediaType
-
Type of media is currently playing, e.g. video, music.
Expand source code
@property @abstractmethod def media_type(self) -> const.MediaType: """Type of media is currently playing, e.g. video, music.""" raise exceptions.NotSupportedError()
var position -> int
-
Position in the playing media (seconds).
Expand source code
@property # type: ignore @abstractmethod @feature(27, "Position", "Current play time position.") def position(self) -> int: """Position in the playing media (seconds).""" raise exceptions.NotSupportedError()
var repeat -> RepeatState
-
Repeat mode.
Expand source code
@property # type: ignore @abstractmethod @feature(29, "Repeat", "Repeat state.") def repeat(self) -> const.RepeatState: """Repeat mode.""" raise exceptions.NotSupportedError()
var shuffle -> ShuffleState
-
If shuffle is enabled or not.
Expand source code
@property # type: ignore @abstractmethod @feature(28, "Shuffle", "Shuffle stat.e") def shuffle(self) -> const.ShuffleState: """If shuffle is enabled or not.""" raise exceptions.NotSupportedError()
var title -> Union[str, NoneType]
-
Title of the current media, e.g. movie or song name.
Expand source code
@property # type: ignore @abstractmethod @feature(22, "Title", "Title of playing media.") def title(self) -> Optional[str]: """Title of the current media, e.g. movie or song name.""" raise exceptions.NotSupportedError()
var total_time -> int
-
Total play time in seconds.
Expand source code
@property # type: ignore @abstractmethod @feature(26, "TotalTime", "Total length of playing media (seconds).") def total_time(self) -> int: """Total play time in seconds.""" raise exceptions.NotSupportedError()
class Power
-
Base class for retrieving power state from an Apple TV.
Listener interface:
pyatv.interfaces.PowerListener
Initialize a new StateProducer instance.
Expand source code
class Power(ABC, StateProducer): """Base class for retrieving power state from an Apple TV. Listener interface: `pyatv.interfaces.PowerListener` """ @property # type: ignore @abstractmethod @feature(32, "PowerState", "Current device power state.") def power_state(self) -> const.PowerState: """Return device power state.""" raise exceptions.NotSupportedError() @abstractmethod @feature(33, "TurnOn", "Turn device on.") async def turn_on(self) -> None: """Turn device on.""" raise exceptions.NotSupportedError() @abstractmethod @feature(34, "TurnOff", "Turn off device.") async def turn_off(self) -> None: """Turn device off.""" raise exceptions.NotSupportedError()
Ancestors
- abc.ABC
- StateProducer
Subclasses
- pyatv.dmap.DmapPower
- pyatv.mrp.MrpPower
Instance variables
var power_state -> PowerState
-
Return device power state.
Expand source code
@property # type: ignore @abstractmethod @feature(32, "PowerState", "Current device power state.") def power_state(self) -> const.PowerState: """Return device power state.""" raise exceptions.NotSupportedError()
Methods
async def turn_off(self) -> NoneType
-
Turn device off.
Expand source code
@abstractmethod @feature(34, "TurnOff", "Turn off device.") async def turn_off(self) -> None: """Turn device off.""" raise exceptions.NotSupportedError()
async def turn_on(self) -> NoneType
-
Turn device on.
Expand source code
@abstractmethod @feature(33, "TurnOn", "Turn device on.") async def turn_on(self) -> None: """Turn device on.""" raise exceptions.NotSupportedError()
Inherited members
class PowerListener
-
Listener interface for power updates.
Expand source code
class PowerListener(ABC): # pylint: disable=too-few-public-methods """Listener interface for power updates.""" @abstractmethod def powerstate_update( self, old_state: const.PowerState, new_state: const.PowerState ): """Device power state was updated.""" raise NotImplementedError()
Ancestors
- abc.ABC
Subclasses
- pyatv.scripts.atvscript.PowerPrinter
Methods
def powerstate_update(self, old_state: PowerState, new_state: PowerState)
-
Device power state was updated.
Expand source code
@abstractmethod def powerstate_update( self, old_state: const.PowerState, new_state: const.PowerState ): """Device power state was updated.""" raise NotImplementedError()
class PushListener
-
Listener interface for push updates.
Expand source code
class PushListener(ABC): """Listener interface for push updates.""" @abstractmethod def playstatus_update(self, updater, playstatus: Playing) -> None: """Inform about changes to what is currently playing.""" @abstractmethod def playstatus_error(self, updater, exception: Exception) -> None: """Inform about an error when updating play status."""
Ancestors
- abc.ABC
Subclasses
- pyatv.scripts.atvremote.PushListener
- pyatv.scripts.atvscript.PushPrinter
Methods
def playstatus_error(self, updater, exception: Exception) -> NoneType
-
Inform about an error when updating play status.
Expand source code
@abstractmethod def playstatus_error(self, updater, exception: Exception) -> None: """Inform about an error when updating play status."""
def playstatus_update(self, updater, playstatus: Playing) -> NoneType
-
Inform about changes to what is currently playing.
Expand source code
@abstractmethod def playstatus_update(self, updater, playstatus: Playing) -> None: """Inform about changes to what is currently playing."""
class PushUpdater
-
Base class for push/async updates from an Apple TV.
Listener interface:
PushListener
Initialize a new StateProducer instance.
Expand source code
class PushUpdater(ABC, StateProducer): """Base class for push/async updates from an Apple TV. Listener interface: `pyatv.interface.PushListener` """ @property @abstractmethod def active(self) -> bool: """Return if push updater has been started.""" raise exceptions.NotSupportedError() @abstractmethod def start(self, initial_delay: int = 0) -> None: """Begin to listen to updates. If an error occurs, start must be called again. """ raise exceptions.NotSupportedError() @abstractmethod def stop(self) -> None: """No longer forward updates to listener.""" raise exceptions.NotSupportedError()
Ancestors
- abc.ABC
- StateProducer
Subclasses
- pyatv.dmap.DmapPushUpdater
- pyatv.mrp.MrpPushUpdater
Instance variables
var active -> bool
-
Return if push updater has been started.
Expand source code
@property @abstractmethod def active(self) -> bool: """Return if push updater has been started.""" raise exceptions.NotSupportedError()
Methods
def start(self, initial_delay: int = 0) -> NoneType
-
Begin to listen to updates.
If an error occurs, start must be called again.
Expand source code
@abstractmethod def start(self, initial_delay: int = 0) -> None: """Begin to listen to updates. If an error occurs, start must be called again. """ raise exceptions.NotSupportedError()
def stop(self) -> NoneType
-
No longer forward updates to listener.
Expand source code
@abstractmethod def stop(self) -> None: """No longer forward updates to listener.""" raise exceptions.NotSupportedError()
Inherited members
class RemoteControl
-
Base class for API used to control an Apple TV.
Expand source code
class RemoteControl(ABC): # pylint: disable=too-many-public-methods """Base class for API used to control an Apple TV.""" # pylint: disable=invalid-name @abstractmethod @feature(0, "Up", "Up button on remote.") async def up(self) -> None: """Press key up.""" raise exceptions.NotSupportedError() @abstractmethod @feature(1, "Down", "Down button on remote.") async def down(self) -> None: """Press key down.""" raise exceptions.NotSupportedError() @abstractmethod @feature(2, "Left", "Left button on remote.") async def left(self) -> None: """Press key left.""" raise exceptions.NotSupportedError() @abstractmethod @feature(3, "Right", "Right button on remote.") async def right(self) -> None: """Press key right.""" raise exceptions.NotSupportedError() @abstractmethod @feature(4, "Play", "Start playing media.") async def play(self) -> None: """Press key play.""" raise exceptions.NotSupportedError() @abstractmethod @feature(5, "PlayPause", "Toggle between play/pause.") async def play_pause(self) -> None: """Toggle between play and pause.""" raise exceptions.NotSupportedError() @abstractmethod @feature(6, "Pause", "Pause playing media.") async def pause(self) -> None: """Press key play.""" raise exceptions.NotSupportedError() @abstractmethod @feature(7, "Stop", "Stop playing media.") async def stop(self) -> None: """Press key stop.""" raise exceptions.NotSupportedError() @abstractmethod @feature(8, "Next", "Change to next item.") async def next(self) -> None: """Press key next.""" raise exceptions.NotSupportedError() @abstractmethod @feature(9, "Previous", "Change to previous item.") async def previous(self) -> None: """Press key previous.""" raise exceptions.NotSupportedError() @abstractmethod @feature(10, "Select", "Select current option.") async def select(self) -> None: """Press key select.""" raise exceptions.NotSupportedError() @abstractmethod @feature(11, "Menu", "Go back to previous menu.") async def menu(self) -> None: """Press key menu.""" raise exceptions.NotSupportedError() @abstractmethod @feature(12, "VolumeUp", "Increase volume.") async def volume_up(self) -> None: """Press key volume up.""" raise exceptions.NotSupportedError() @abstractmethod @feature(13, "VolumeDown", "Decrease volume.") async def volume_down(self) -> None: """Press key volume down.""" raise exceptions.NotSupportedError() @abstractmethod @feature(14, "Home", "Home/TV button.") async def home(self) -> None: """Press key home.""" raise exceptions.NotSupportedError() @abstractmethod @feature(15, "HomeHold", "Long-press home button.") async def home_hold(self) -> None: """Hold key home.""" raise exceptions.NotSupportedError() @abstractmethod @feature(16, "TopMenu", "Go to main menu.") async def top_menu(self) -> None: """Go to main menu (long press menu).""" raise exceptions.NotSupportedError() @abstractmethod @feature(17, "Suspend", "Suspend device (deprecated; use Power.turn_off).") async def suspend(self) -> None: """Suspend the device.""" raise exceptions.NotSupportedError() @abstractmethod @feature(18, "WakeUp", "Wake up device (deprecated; use Power.turn_on).") async def wakeup(self) -> None: """Wake up the device.""" raise exceptions.NotSupportedError() @abstractmethod @feature( 36, "SkipForward", "Skip forward a time interval.", ) async def skip_forward(self) -> None: """Skip forward a time interval. Skip interval is typically 15-30s, but is decided by the app. """ raise exceptions.NotSupportedError() @abstractmethod @feature(37, "SkipBackward", "Skip backwards a time interval.") async def skip_backward(self) -> None: """Skip backwards a time interval. Skip interval is typically 15-30s, but is decided by the app. """ raise exceptions.NotSupportedError() @abstractmethod @feature(19, "SetPosition", "Seek to position.") async def set_position(self, pos: int) -> None: """Seek in the current playing media.""" raise exceptions.NotSupportedError() @abstractmethod @feature(20, "SetShuffle", "Change shuffle state.") async def set_shuffle(self, shuffle_state: const.ShuffleState) -> None: """Change shuffle mode to on or off.""" raise exceptions.NotSupportedError() @abstractmethod @feature(21, "SetRepeat", "Change repeat state.") async def set_repeat(self, repeat_state: const.RepeatState) -> None: """Change repeat state.""" raise exceptions.NotSupportedError()
Ancestors
- abc.ABC
Subclasses
- pyatv.dmap.DmapRemoteControl
- pyatv.mrp.MrpRemoteControl
Methods
async def down(self) -> NoneType
-
Press key down.
Expand source code
@abstractmethod @feature(1, "Down", "Down button on remote.") async def down(self) -> None: """Press key down.""" raise exceptions.NotSupportedError()
async def home(self) -> NoneType
-
Press key home.
Expand source code
@abstractmethod @feature(14, "Home", "Home/TV button.") async def home(self) -> None: """Press key home.""" raise exceptions.NotSupportedError()
async def home_hold(self) -> NoneType
-
Hold key home.
Expand source code
@abstractmethod @feature(15, "HomeHold", "Long-press home button.") async def home_hold(self) -> None: """Hold key home.""" raise exceptions.NotSupportedError()
async def left(self) -> NoneType
-
Press key left.
Expand source code
@abstractmethod @feature(2, "Left", "Left button on remote.") async def left(self) -> None: """Press key left.""" raise exceptions.NotSupportedError()
-
Press key menu.
Expand source code
@abstractmethod @feature(11, "Menu", "Go back to previous menu.") async def menu(self) -> None: """Press key menu.""" raise exceptions.NotSupportedError()
async def next(self) -> NoneType
-
Press key next.
Expand source code
@abstractmethod @feature(8, "Next", "Change to next item.") async def next(self) -> None: """Press key next.""" raise exceptions.NotSupportedError()
async def pause(self) -> NoneType
-
Press key play.
Expand source code
@abstractmethod @feature(6, "Pause", "Pause playing media.") async def pause(self) -> None: """Press key play.""" raise exceptions.NotSupportedError()
async def play(self) -> NoneType
-
Press key play.
Expand source code
@abstractmethod @feature(4, "Play", "Start playing media.") async def play(self) -> None: """Press key play.""" raise exceptions.NotSupportedError()
async def play_pause(self) -> NoneType
-
Toggle between play and pause.
Expand source code
@abstractmethod @feature(5, "PlayPause", "Toggle between play/pause.") async def play_pause(self) -> None: """Toggle between play and pause.""" raise exceptions.NotSupportedError()
async def previous(self) -> NoneType
-
Press key previous.
Expand source code
@abstractmethod @feature(9, "Previous", "Change to previous item.") async def previous(self) -> None: """Press key previous.""" raise exceptions.NotSupportedError()
async def right(self) -> NoneType
-
Press key right.
Expand source code
@abstractmethod @feature(3, "Right", "Right button on remote.") async def right(self) -> None: """Press key right.""" raise exceptions.NotSupportedError()
async def select(self) -> NoneType
-
Press key select.
Expand source code
@abstractmethod @feature(10, "Select", "Select current option.") async def select(self) -> None: """Press key select.""" raise exceptions.NotSupportedError()
async def set_position(self, pos: int) -> NoneType
-
Seek in the current playing media.
Expand source code
@abstractmethod @feature(19, "SetPosition", "Seek to position.") async def set_position(self, pos: int) -> None: """Seek in the current playing media.""" raise exceptions.NotSupportedError()
async def set_repeat(self, repeat_state: RepeatState) -> NoneType
-
Change repeat state.
Expand source code
@abstractmethod @feature(21, "SetRepeat", "Change repeat state.") async def set_repeat(self, repeat_state: const.RepeatState) -> None: """Change repeat state.""" raise exceptions.NotSupportedError()
async def set_shuffle(self, shuffle_state: ShuffleState) -> NoneType
-
Change shuffle mode to on or off.
Expand source code
@abstractmethod @feature(20, "SetShuffle", "Change shuffle state.") async def set_shuffle(self, shuffle_state: const.ShuffleState) -> None: """Change shuffle mode to on or off.""" raise exceptions.NotSupportedError()
async def skip_backward(self) -> NoneType
-
Skip backwards a time interval.
Skip interval is typically 15-30s, but is decided by the app.
Expand source code
@abstractmethod @feature(37, "SkipBackward", "Skip backwards a time interval.") async def skip_backward(self) -> None: """Skip backwards a time interval. Skip interval is typically 15-30s, but is decided by the app. """ raise exceptions.NotSupportedError()
async def skip_forward(self) -> NoneType
-
Skip forward a time interval.
Skip interval is typically 15-30s, but is decided by the app.
Expand source code
@abstractmethod @feature( 36, "SkipForward", "Skip forward a time interval.", ) async def skip_forward(self) -> None: """Skip forward a time interval. Skip interval is typically 15-30s, but is decided by the app. """ raise exceptions.NotSupportedError()
async def stop(self) -> NoneType
-
Press key stop.
Expand source code
@abstractmethod @feature(7, "Stop", "Stop playing media.") async def stop(self) -> None: """Press key stop.""" raise exceptions.NotSupportedError()
async def suspend(self) -> NoneType
-
Suspend the device.
Expand source code
@abstractmethod @feature(17, "Suspend", "Suspend device (deprecated; use Power.turn_off).") async def suspend(self) -> None: """Suspend the device.""" raise exceptions.NotSupportedError()
-
Go to main menu (long press menu).
Expand source code
@abstractmethod @feature(16, "TopMenu", "Go to main menu.") async def top_menu(self) -> None: """Go to main menu (long press menu).""" raise exceptions.NotSupportedError()
async def up(self) -> NoneType
-
Press key up.
Expand source code
@abstractmethod @feature(0, "Up", "Up button on remote.") async def up(self) -> None: """Press key up.""" raise exceptions.NotSupportedError()
async def volume_down(self) -> NoneType
-
Press key volume down.
Expand source code
@abstractmethod @feature(13, "VolumeDown", "Decrease volume.") async def volume_down(self) -> None: """Press key volume down.""" raise exceptions.NotSupportedError()
async def volume_up(self) -> NoneType
-
Press key volume up.
Expand source code
@abstractmethod @feature(12, "VolumeUp", "Increase volume.") async def volume_up(self) -> None: """Press key volume up.""" raise exceptions.NotSupportedError()
async def wakeup(self) -> NoneType
-
Wake up the device.
Expand source code
@abstractmethod @feature(18, "WakeUp", "Wake up device (deprecated; use Power.turn_on).") async def wakeup(self) -> None: """Wake up the device.""" raise exceptions.NotSupportedError()
class StateProducer
-
Base class for objects announcing state changes to a listener.
Initialize a new StateProducer instance.
Expand source code
class StateProducer: """Base class for objects announcing state changes to a listener.""" def __init__(self) -> None: """Initialize a new StateProducer instance.""" self.__listener: Optional[weakref.ReferenceType[Any]] = None @property def listener(self): """Return current listener object.""" return _ListenerProxy(self.__listener) @listener.setter def listener(self, target) -> None: """Change current listener object. Set to None to remove active listener. """ if target is not None: self.__listener = weakref.ref(target) else: self.__listener = None
Subclasses
- AppleTV
- Power
- PushUpdater
- pyatv.mrp.connection.MrpConnection
Instance variables
var listener
-
Return current listener object.
Expand source code
@property def listener(self): """Return current listener object.""" return _ListenerProxy(self.__listener)
class Stream
-
Base class for stream functionality.
Expand source code
class Stream(ABC): # pylint: disable=too-few-public-methods """Base class for stream functionality.""" @abstractmethod def close(self) -> None: """Close connection and release allocated resources.""" raise exceptions.NotSupportedError() @abstractmethod @feature(31, "PlayUrl", "Stream a URL on device.") async def play_url(self, url: str, **kwargs) -> None: """Play media from an URL on the device.""" raise exceptions.NotSupportedError()
Ancestors
- abc.ABC
Subclasses
- pyatv.airplay.AirPlayStreamAPI
Methods
def close(self) -> NoneType
-
Close connection and release allocated resources.
Expand source code
@abstractmethod def close(self) -> None: """Close connection and release allocated resources.""" raise exceptions.NotSupportedError()
async def play_url(self, url: str, **kwargs) -> NoneType
-
Play media from an URL on the device.
Expand source code
@abstractmethod @feature(31, "PlayUrl", "Stream a URL on device.") async def play_url(self, url: str, **kwargs) -> None: """Play media from an URL on the device.""" raise exceptions.NotSupportedError()


The + selector is used to select an element that is directly after another specific element.
The following example selects the first p element that are placed immediately after div elements:
Sibling elements must have the same parent element, and "adjacent" means "immediately following".
The following example selects the first element that are placed immediately after
elements:
Paragraph 1 in the div.
Paragraph 2 in the div.
Paragraph 3. After a div.
Paragraph 4. After a div.
Paragraph 5 in the div.
Paragraph 6 in the div.
Paragraph 7. After a div.
Paragraph 8. After a div.


Competitive Professional Athlete
Job Description
Position Title
Competitive Professional Athlete
Location
San Francisco, CA
Employment Time
Full-time
Experience
Mid-level
Status
Open
Description
Let me be clear, you have to make it through the jungle to make it to paradise, that’s the key, Lion! Egg whites, turkey sausage, wheat toast, water.  Another one. The ladies always say Khaled you smell good, I use no cologne. Cocoa butter is the key. The first of the month is coming, we have to get money, we have no choice. It cost money to eat and they don’t want you to eat.
Hiring Lead
DJ Khaled
Approved Salary
$75,000
Link to this Job
Lorem Khaled Ipsum is a major key to success.  It’s important to use cocoa butter.
Upload Resumes by Email
To succeed you must believe. When you believe, you will succeed.
djkhaled@blessup.io


20 hours back on the Greyhound
From Darwin to Alice Springs was a mere 20 hours/1500 kms with one major town - Katherine - and nothing much else in between. Except for Daly Waters, a township we stopped off at for 5 minutes, which was 10 kms off the Stuart Highway. Had a great looking pub there, and it was the location of Australia's most remote traffic light. It was on red.
Also saw a sign on arrival in Alice Springs saying "London - 15030 km".
Back to the main page


agcEffect.Rd
agcEffect
takes a covariate and outcome model fit
from agcParam
, parameters for an MCMC, and the
specified treatment effect and determines the causal estimates (direct and spillover)
generated from the network structure.
agcEffect(mod, burnin = 1, thin = 0.5, treatment_allocation = 0.5, subset = 0, R = 10, burnin_R = 10, burnin_cov = 10, average = TRUE, index_override = 0) # S4 method for list agcEffect(mod, burnin = 1, thin = 0.2, treatment_allocation = 0.5, subset = 0, R = 10, burnin_R = 10, burnin_cov = 10, average = TRUE, index_override = 0)
| mod | An |
|---|---|
| burnin | The index to start evaluation as one would normally have for a burnin for a Bayesian computation. Default = 1 |
| thin | The rate at which to evaluate the outcome model. The closer to 1, the more values to compute (supplying 1 will not thin at all). |
| treatment_allocation | The proportion of the individuals in the network to receive the treatment. Should be a number between 0 and 1. Default = 0.5. |
| subset | The indices of the individuals, as they appear in the adjacency matrix, to be included in the network causal effects estimates. Default = 0 (include everyone). |
| R | The number of iterations for the Gibbs inner loop. Default = 10. |
| burnin_R | The index to start evaluation as one would normally have for a burnin for a Bayesian computation. Default = 10. |
| burnin_cov | The index to start saving covariates for use in the network causal effect chains. Default = 10. |
| average | An indicator of whether to evaluate the causal effects as an average of the R iterations. Default = "TRUE". |
| index_override | The MCMC outer loop iteration numbers to include in the evaluation of the causal effects. This will override the burnin and thin parameters. Default = 0 (all iterations included). |
An S3 object of type agcEffectClass
that contains essential
values for the outcome model.
rdsIn <- readRDS(paste0(system.file('extdata',package='autognet'),"/agc-example.rds")) adjmat <- rdsIn[[1]] data <- rdsIn[[2]] treatment <- "treatment" outcome <- "outcome" B = 10 R = 5 seed = 1 mod <- agcParam(data, treatment, outcome, adjmat, B = B, R = R, seed = c(1))#> | | | 0% | |======== | 11% | |================ | 22% | |======================= | 33% | |=============================== | 44% | |======================================= | 56% | |=============================================== | 67% | |====================================================== | 78% | |============================================================== | 89% | |======================================================================| 100%effects <- agcEffect(mod)#> | | | 0% | |======================================================================| 100%


Mangrove Forest
While mangrove boat tours have long been available, since the seaweed industry closed down, many former seaweed farmers have put their boats to use offering them.
Don’t expect a running commentary or even to glean any information, as most don’t speak English, but it’s a pleasant way to while away half an hour out of the sun.
From the main drag at Jungut Batu, it’s about two kilometres to the mangrove forest area, an easy walk, cycle or motorbike ride.
A jungle of signs offer tours, and local boatmen will approach you to volunteer their services.The boats are simple wooden or fibreglass affairs with no cover—bring an umbrella if it looks like rain. Our boat was pushed gondola-style with a long bamboo pole, but we also saw tour groups in larger motorised craft. We enjoyed the silence of our non-motorised version, along with the ability to navigate narrower streams.


Goddard
This page contains an index of all the individuals in the database with the surname of Goddard. Selecting the person’s name will take you to that person’s individual page.
| Given Name | Birth | Death | Partner | Parents | |
|---|---|---|---|---|---|
| Arthur | 1874-12-23 | , unknown Goddard, Mary | |||
| Cephas | 1816 | 1870-06-28 | Crawford, Martha | Crawford, Martha | |
| Cephas W. | 1890 | Grimshaw, Lillian M. | Goddard, George Ward, [Living] | ||
| Elizabeth Emma | 1878-02-04 | Wood, James H. | Goddard, George Killard, Mary | ||
| Ellen “Nellie” | 1859 | 1935 | Johnson, Henry | Goddard, Cephas Crawford, Martha | |
| Elsye Myrle | 1912 | 1968-04-29 | Fox, Thomas Jeffrey | Goddard, Samuel George Pascoe, Elizabeth Jane "Bessie" | |
| Emma “Hilda” May | 1892-05-28 | 1943 | Wilkinson, Albert Samuel | Goddard, Joseph * Kenny, Elizabeth | |
| Frances | 1847-09-13 | 1865 | Smith, Beau | Goddard, Cephas Crawford, Martha | |
| Frederick Samuel | 1906-01-09 | 1979-09-27 | Berman, Heather Ilma | Goddard, Samuel George Pascoe, Elizabeth Jane "Bessie" | |
| George | about 1856 | 1918-06-01 | Killard, Mary, Ward, [Living] | Goddard, Cephas Crawford, Martha | |
| George A. | 1887 | Goddard, George Killard, Mary | |||
| Henry | about 1843 | 1897-08-29 | Jolly, Ellen Williams | Goddard, Cephas Crawford, Martha | |
| Jane | 1858 | 1858 | Goddard, Cephas Crawford, Martha | ||
| Joseph, * | about 1853 | 1932-05-12 | Kenny, Elizabeth | Goddard, Cephas Crawford, Martha | |
| Mary | 1846-03-16 | 1846-03-28 | Goddard, Cephas Crawford, Martha | ||
| Mary | 1850 | 1931-05-28 | , unknown, Walker, Joseph | Goddard, Cephas Crawford, Martha | |
| Reginald Joseph | 1907-03-25 | 1980-09-23 | Pope, Ruby May | Goddard, Samuel George Pascoe, Elizabeth Jane "Bessie" | |
| Ruby Margaret Martha | 1892-02-20 | Pitt, Herbert | Goddard, George Ward, [Living] | ||
| Samuel | about 1841 | 1914-03-28 | Goddard, Cephas Crawford, Martha | ||
| Samuel George | 1883-03-25 | 1959-10-29 | Pascoe, Elizabeth Jane “Bessie” | Goddard, Joseph * Kenny, Elizabeth | |
| William | 1837 | 1869-12-24 | Clifford, Matilda | Goddard, Cephas Crawford, Martha | |
| [Living] | Uttley, Gwendoline Alice | ||||
| [Living] | Schumacher, Leonard Frank | Goddard, Samuel George Pascoe, Elizabeth Jane "Bessie" | |||
| [Living] | Biggs, [Living] | Goddard, Frederick Samuel Berman, Heather Ilma | |||
| [Living] | Maddison, [Living], ???, [Living] | Goddard, Frederick Samuel Berman, Heather Ilma | |||
| [Living] | Rose, [Living] | Goddard, [Living] Peaston, [Living] | |||
| [Living] | Sims, [Living] | Goddard, Reginald Joseph Pope, Ruby May | |||
| [Living] | Franklin, [Living] | Goddard, [Living] Peaston, [Living] | |||
| [Living] | Wiggins, [Living] | Goddard, [Living] Peaston, [Living] | |||
| [Living] | Peaston, [Living] | Goddard, Reginald Joseph Pope, Ruby May | |||
| [Living] | Goddard, [Living] Maddison, [Living] | ||||
| [Living] | Goddard, [Living] Maddison, [Living] | ||||
| [Living] | Goddard, [Living] ???, [Living] | ||||
| [Living] | Goddard, [Living] ???, [Living] | ||||
| [Living] | Goddard, [Living] Rose, [Living] | ||||
| [Living] | Goddard, [Living] Rose, [Living] | ||||
| [Living] | Goddard, [Living] Biggs, [Living] |


{{ theme:css src="../assets/vendor/slick/slick.css" tag="true" }}
{{ theme:js src="../assets/vendor/slick/slick" tag="true" }}
Sample Project
There's a voice that keeps on calling me. Down the road, that's where I'll always be. Every stop I make, I make a new friend. Can't stay for long, just turn around and I'm gone again. Maybe tomorrow, I'll want to settle down, Until tomorrow, I'll just keep moving on.
Bacon ipsum dolor sit amet prosciutto kielbasa meatball short loin. Jowl shankle doner pancetta, turkey short loin capicola bresaola prosciutto beef ribs cow. Tenderloin salami pork belly capicola.
T-bone spare ribs fatback pork andouille, meatloaf chicken beef beef ribs. Salami beef ribs pig ground round chicken, tail doner tenderloin shankle prosciutto biltong chuck.
As busy as a dob how flat out like a butcher. She'll be right boozer how it'll be ankle biter.  Mad as a franger flamin lets throw a compo. You little ripper bitzer how she'll be right slacker.  Shazza got us some coldie with gutful of dole bludger.


Annual General Meetings
2018 AGM
DATE:
Venue:
Start Time:
Read More
AGM MINUTES
AGM 2019 Date to be communicated soon
Audited Accounts
Election Notice
Election Regulations
Nomination form
Proxy form


class AdminUserRoleRepository extends EntityRepository
AdminUserRoleRepository
This class was generated by the Doctrine ORM. Add your own custom
repository methods below.
Methods
|
getAssignablePermissions()
Get permissions that can be assigned to a user type |
||
| getAssignablePermissionsByUserType(AdminUserType $userType) | ||
| AdminUserRole[] |
getActivePermissions()
Get permissions that are active |
Details
at line 26
public
getAssignablePermissions()
Get permissions that can be assigned to a user type
at line 34
public
getAssignablePermissionsByUserType(AdminUserType $userType)
at line 55
public AdminUserRole[]
getActivePermissions()
Get permissions that are active


Shortcuts can be used in the Debugger input.
The shortcut text will be inserted at the current caret position.
OK
Cancel


---
layout: post
title: About this project
driveId: 1eJUOr9qS4Md3K_gyX1NJGlbSXXeQfZVd/preview
---
   Recent advances of mobile and wearable technologies as well as IoT devices rapidly transform our computing environments and become de facto standards for next generation computing. This project aims to leverage persuasive interaction techniques in this novel ‘connected computing’ infrastructure for behavioral change particularly in the area of positive computing.
{% include googleDrivePlayer.html id=page.driveId %}
Project Introduction Video
   This project is composed of two sub-parts:
     (1) developing design guidelines of persuasive interaction design and its evaluation methods
     (2) developing a persuasive interaction platform and its foundational technologies
   Two teams will jointly build and evaluate representative services for positive computing to provide evidence-based design guidelines.
Keywords
Persuasive Interaction, Quantified Self, Design Guidelines, Service Design, HCI, Contextual Computing, Digital Behavioral Marker, Interruptibility
Purposes of this project
Part 1) Design guidelines of persuasive interaction and evaluation methods
- Exploring quantified self and contextual computing environments
- Design guidelines based on literature review and data collection/analysis
- Positive computing services with various intervention/engagement mechanisms
- Developing evaluation methodologies and evidence-based design guidelines (Download)
Part 2) Persuasive interaction platform and its foundational technologies
- Developing platform infrastructure for data collection & contextual computing
- Developing digital behavioral marker detection algorithms
- Developing proper interruption moment recognition algorithms
- Medium and content selection/configuration/delivery mechanisms
- Positive computing service development
- Platform component integration and open source release (Download)
Expected contributions
- We expect to deliver service design guidelines and user feedback at every experiment, making them reflected in service development/improvement. We expect to present our evidence-based service design guidelines to related international conferences.
- Design of new persuasive interaction services based on our design guidelines will be extended to the national intervention services by 1) providing wellbeing services to people with mild symptoms who have not been able to receive appropriate ones, 2) by overcoming the limitations of existing ineffective intervention services, and 3) by significantly reducing social costs.
- Digital behavioral marker detection and personalized interruption moment detection technologies can be directly applicable to AI-based service industry, including intelligent agents.
- Medium and content selection/configuration/delivery mechanisms.
- Our open source platform will provide foundations for R&D in various domains, including smart homes and ubiquitous healthcare.


UD for Marathi
Tokenization and Word Segmentation
- In general, words are delimited by whitespace characters. Description of exceptions follows.
- According to typographical rules, some punctuation marks (e.g., comma) are attached to a neighboring word, while others (e.g., the sentence-terminating danda) are not. We tokenize punctuation as separate tokens (words).
- Certain suffixes are treated as encliticized postpositions and segmented as separate syntactic words in the tree structure. The most prominent type is the possessive morpheme चा / ची / चे / च्या cā / cī / ce / cyā. Treating it as a separate word makes it easier to annotate Gender and Number, which agrees with the possessed entity and is independent of the host word (the possessor). It also increases parallelism with other related languages such as Hindi, where the corresponding morpheme is written as an independent orthographic word. Also note that a third syntactic word is sometimes attached to the right.
Morphology
Tags
- Marathi uses all 17 universal POS categories, including particles (PART). (But SYM does not occur in the current data.)
- Marathi has the following auxiliary verbs (AUX):
- असणे asaṇe (“to be”) is used as copula and in periphrastic tenses. The forms of नाही are treated as negative forms of असणे (they share the lemma).
- नको nako (“don’t”) is used to create negative imperative (prohibitive).
- येणे yeṇe (“to come”) for the passive (with a non-finite form of the main verb).
- जाणे jāṇe (“to go”) for the passive (with a non-finite form of the main verb).
- Modal auxiliaries:
- शकणे śakaṇe (“be able, can”)
- पाहिजे pāhije (“needed, should, ought to”)
- There are other verbs that are semantically weak and combine with non-finite forms of other verbs but they should not be analyzed as auxiliaries in UD.
Instead the lexically more salient verb is attached as an xcomp of the less salient verb. Phase verbs, such as to begin/end, are an example:
- लागणे lāgaṇe (“to start”) combines with a non-finite form of the lexical verb; this should be analyzed as a control verb construction (xcomp) rather than an auxiliary
- देणे deṇe (“to give”) combines with a non-finite form of the lexical verb; has the meaning of “let it (be)”; should be analyzed as a control verb construction (xcomp) rather than an auxiliary
- There are five main (de)verbal forms, distinguished by the UPOS tag and the value of the VerbForm feature:
- Infinitive
Inf
, tagged VERB or AUX. Two distinct forms are both annotated as infinitive and further distinguished by the language-specific featureInfForm
:Dict
-णॆ, -आत -ṇe, -āta (the citation/dictionary form is -ṇe)Incp
-ऊ -ū
- Finite verb
Fin
, tagged VERB or AUX. - Supine
Sup
, tagged VERB or AUX. - Participle
Part
, tagged VERB or AUX. - Converb
Conv
, tagged VERB or AUX.
- Infinitive
Nominal Features
- Nominal words (NOUN, PROPN and PRON) have an inherent Gender feature with one of three values:
Masc
,Fem
orNeut
. - The two main values of the Number feature are
Sing
andPlur
. The following parts of speech inflect for number: NOUN, PROPN, PRON, ADJ, DET, VERB, AUX, marginally ADP. - Case has 10 possible values:
Nom
,Acc
,Ins
,Dat
,Abl
,Loc
,Voc
,Com
,Erg
,Abs
. The first seven values (nominative to vocative) correspond to cases traditionally distinguished and ordered this way in the grammar of Sanskrit and its descendant languages. Only the “sixth case” (possessive/genitive) is missing because its morpheme is treated as a separate syntactic word (postposition). On the other hand some additional morphological cases are distinguished: the comitative (suffix -शी -śī) and the ergative (suffix -ने -ne). Finally, the labelAbs
is used for the bare stem that occurs in multiword tokens after cutting off the possessive postposition. TheCase
feature occurs with the nominal words, i.e., NOUN, PROPN, PRON, ADJ, DET, NUM, also with nominally used VERB.
Verbal Features
- Finite verbs always have one of four values of Mood:
Ind
,Imp
,Sub
, orDes
. - Verbs in the indicative mood always have one of three values of Tense:
Past
,Pres
orFut
. - Aspect has four possible values:
Hab
,Imp
,Perf
,Prosp
. - Voice only occurs with morphological causatives:
Cau
. - Polarity has two values,
Pos
andNeg
, and applies only to the auxiliaries (AUX) असणे asaṇe (“to be”) (both positive and negative forms) and नको nako (“don’t”) (only negative forms).
Pronouns, Determiners, Quantifiers
- PronType is used with pronouns (PRON), determiners (DET) and adverbs (ADV).
- NumType is used with numerals (NUM) and adjectives (ADJ).
- Person is a lexical feature of personal pronouns (PRON) and has three values,
1
,2
and3
. Note however, that the third person pronouns overlap with demonstratives. - Clusivity distinguishes inclusive and exclusive 1st person plural pronouns.
- Deixis distinguishes proximate and remote demonstratives.
Syntax
This is an overview only. For more detailed discussion and examples, see the list of Marathi relations.
Core Arguments, Oblique Arguments and Adjuncts
- Like in other Indo-Aryan languages, Marathi shows split ergativity. In present tense, the nominal subject (nsubj)
is a bare noun phrase in the nominative case, without preposition, and the verb cross-references its person and number.
However, for transitive verbs in the past tense, the subject (actor) is in the ergative case, and the verb cross-references
the person and number of the object, which is in the nominative form.
- For some experiencing predicates, dative noun phrases may be marked as non-canonical subjects.
- A subordinate clause may serve as the subject and is labeled
csubj
.
- Direct objects are bare noun phrases in accusative or nominative.
- Indirect objects are bare noun phrases in dative.
- In passive clauses, the subject is labeled with nsubj:pass or csubj:pass, respectively.
- The auxiliary verb in periphrastic passive is labeled aux:pass.
Relations Overview
- The following relation subtypes are used in Marathi:
- nsubj:pass for nominal subjects of passive verbs
- csubj:pass for clausal subjects of passive verbs
- aux:pass for passive auxiliaries
- cop:own for copulas in possessive-existential clauses
- acl:relcl for relative clauses
- compound:lvc for light verb constructions
- compound:svc for serial verb constructions
- compound:redup for reduplications
- nmod:poss for possessive/genitive modifiers
- The following relation types are not used in Marathi at all: expl, clf
Treebanks
There is 1 Marathi UD treebank:


If you're seeing this message, that means
JavaScript has been disabled on your browser
, please
enable JS
to make this app work.
{{SSR}} {{PRELOADEDSTATE}}


[gecode-users] non empty rangelist with an empty range
Guido Tack
tack at ps.uni-sb.de
Tue Dec 16 17:30:18 CET 2008
Denys Duchier wrote:
> I wrote:
>
> SetVar s(this, 0, -1, 0, 10, 0, 11);
>
> because it seemed (I guess, by analogy with loops) a fairly natural
> way
> to indicate an empty glb. It turns out that Gecode will happily
> create
> a range list containing the range [0,-1] which causes Gecode to behave
> strangely.
>
> I think that either the documentation should explicitely state the
> invariant or the code should check it.
Thanks, Denys. We should definitely support the 0,-1 notation (we
support it for IntSets, so SetVars should be no exception). I fixed
it in the trunk, and while I was looking at that code, I also found
out that the SetVar constructors did not throw proper exceptions when
trying to create an empty domain - it should all work as expected now.
Cheers,
Guido
More information about the gecode-users
mailing list


vargame=newPhaser.Game(800,600,Phaser.CANVAS,'phaser-example',{preload:preload,create:create,render:render});functionpreload(){game.load.image('picture1','assets/pics/cougar_sanity_train.png');game.load.image('picture2','assets/pics/cougar-face_of_nature.png');game.load.image('picture3','assets/pics/destop-rewarding.png');game.load.image('picture4','assets/pics/destop-unknown.png');game.load.image('picture5','assets/pics/questar.png');game.load.image('picture6','assets/pics/seven_seas_andromeda_fairfax.png');game.load.image('picture7','assets/pics/slayer-sorry_im_the_beast.png');}varpictureA;varpictureB;vartimer;varcurrent=3;functioncreate(){game.stage.backgroundColor='#000';pictureA=game.add.sprite(game.world.centerX,game.world.centerY,'picture1');pictureA.anchor.setTo(0.5,0.5);pictureA.scale.setTo(2,2);pictureB=game.add.sprite(game.world.centerX,game.world.centerY,'picture2');pictureB.anchor.setTo(0.5,0.5);pictureB.scale.setTo(2,2);pictureB.alpha=0;// Create our Timertimer=game.time.create(false);// Set a TimerEvent to occur after 3 secondstimer.add(3000,fadePictures,this);// Start the timer running - this is important!// It won't start automatically, allowing you to hook it to button events and the like.timer.start();}functionfadePictures(){// Cross-fade the two picturesvartween;if(pictureA.alpha===1){tween=game.add.tween(pictureA).to({alpha:0},2000,Phaser.Easing.Linear.None,true);game.add.tween(pictureB).to({alpha:1},2000,Phaser.Easing.Linear.None,true);}else{game.add.tween(pictureA).to({alpha:1},2000,Phaser.Easing.Linear.None,true);tween=game.add.tween(pictureB).to({alpha:0},2000,Phaser.Easing.Linear.None,true);}// When the cross-fade is complete we swap the image being shown by the now hidden picturetween.onComplete.add(changePicture,this);}functionchangePicture(){if(pictureA.alpha===0){pictureA.loadTexture('picture'+current);}else{pictureB.loadTexture('picture'+current);}current++;if(current>7){current=1;}// And set a new TimerEvent to occur after 3 secondstimer.add(3000,fadePictures,this);}functionrender(){game.debug.text("Time until event: "+timer.duration.toFixed(0),10,20);}


×
Home
Recipes
LocalBusiness
Contact
About
My SchemaOrg Instance Viewer
Home
Recipes
LocalBusiness
Contact
About
My Contact Page
http://schema.org/Organization
one
two
three
904 Filly Circle
New Hope
18938
Quality Seamless Gutters
This is a card.
It has an easy to override visual style, and is appropriately subdued.
Guggers Gutters
Impact Signs, USA
This is a card.
It has an easy to override visual style, and is appropriately subdued.
Sign Shop


See: Description
| Class | Description |
|---|---|
| CharsetConverter |
Converts a java.nio.charset.Carset to a string.
|
| ColorConverter |
Converts a java.awt.Color to XML, using four nested elements:
red, green, blue, alpha.
|
| CurrencyConverter |
Converts a java.util.Currency to String.
|
| DurationConverter | |
| DynamicProxyConverter |
Converts a dynamic proxy to XML, storing the implemented
interfaces and handler.
|
| EncodedByteArrayConverter |
Converts a byte array to a single Base64 encoding string.
|
| FileConverter |
This converter will take care of storing and retrieving File with either
an absolute path OR a relative path depending on how they were created.
|
| FontConverter | |
| GregorianCalendarConverter |
Converts a java.util.GregorianCalendar to XML.
|
| ISO8601DateConverter |
A DateConverter conforming to the ISO8601 standard.
|
| ISO8601GregorianCalendarConverter |
A GregorianCalendarConverter conforming to the ISO8601 standard.
|
| ISO8601SqlTimestampConverter |
A SqlTimestampConverter conforming to the ISO8601 standard.
|
| JavaClassConverter |
Converts a java.lang.Class to XML.
|
| JavaFieldConverter |
Converts a java.lang.reflect.Field to XML.
|
| JavaMethodConverter |
Converts a java.lang.reflect.Method to XML.
|
| LocaleConverter |
Converts a java.util.Locale to a string.
|
| LookAndFeelConverter |
A converter for Swing LookAndFeel implementations.
|
| NamedArrayConverter |
An array converter that uses predefined names for its items.
|
| NamedCollectionConverter |
A collection converter that uses predefined names for its items.
|
| NamedMapConverter |
A map converter that uses predefined names for its elements.
|
| PropertyEditorCapableConverter |
A SingleValueConverter that can utilize a
PropertyEditor implementation used for a
specific type. |
| RegexPatternConverter |
Ensures java.util.regex.Pattern is compiled upon deserialization.
|
| SqlDateConverter |
Converts a java.sql.Date to text.
|
| SqlTimeConverter |
Converts a java.sql.Time to text.
|
| SqlTimestampConverter |
Converts a java.sql.Timestamp to text.
|
| StackTraceElementConverter |
Converter for StackTraceElement (the lines of a stack trace) - JDK 1.4+ only.
|
| StackTraceElementFactory |
Factory for creating StackTraceElements.
|
| SubjectConverter |
Converts a
Subject instance. |
| TextAttributeConverter |
A converter for
TextAttribute constants. |
| ThrowableConverter |
Converter for Throwable (and Exception) that retains stack trace.
|
| ToAttributedValueConverter |
Converter that supports the definition of one field member that will be written as value and
all other field members are written as attributes.
|
| ToStringConverter |
Convenient converter for classes with natural string representation.
|
Extra converters that may not be enabled in XStream by default.
Copyright © 2004-2013 XStream. All Rights Reserved.


| DOSE: |
1 line |
insufflated |
Ketamine |
(powder / crystals) |
The following is a first-hand account of the effects of 'Ketamine Hydrochloride'. The drug was obtained in liquid injectable form of 100 mg/ml. It's used for pre-surgical anesthesia. One street name for the drug in crystaline form is 'Special K'. Dosage is a line about 1' in length and as wide as a paper match, snorted. Full onset of drug is in 5-10 minutes. Total trip: 20-30 minutes with residual effects lasting up to 1 hour.
The first effects are a buzzing sound in the ear, increasing in volume over a period of 2 minutes. Then a drunken feeling and a quick numbing of the body. Shortness of breath occurs and is accompanied by a slight fear of not being able to catch your breath. This subsides and a deep numbing of the body occurs. A slight increase in heart rate was also felt. A few more minutes pass and a giddy, drunken stupor overwhelms the mind. Tunnel vision and a feeling of 'being deep inside your own body' occurs. Slight visual hallucinations (trails) are common after 10 minutes. Major effect is the numbness and drunken feeling. No noticeable after-effects or tolerance build-up. All in all, a very intersting trip indeed!
Ok, enough stuffy talk. I liked it =) The only part I didn't care for is the fear of not being able to catch your breath. It goes away pretty quick. I figure it's because of the numbing sensation. I heated the liquid ketamine in a spoon over low heat on the stove. It quickly turns into powder. Chop it up finely with a razor blade. It takes effect much quicker after the first dose. I especially liked the halluciantions! Complete recovery in around half an hour. I don't recomend drinking while on this, or mixing with other drugs. I wouldn't drive either. Me and two friends got fried on this and drove to get some cigs. We took a turn too fast and did a 180 and ran into the hill next to the road.
You can tell if it's good if it tastes kinda salty and like powdered aspirin (really bad taste). Burns for a few seconds when snorted too. It's a white powder in pure form, could be cut with anything but I had the 100% pure shit!
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


grr: Alternative Implementations of Base R Functions
Alternative implementations of some base R functions, including sort, order, and match. Functions are simplified but can be faster or have other advantages.
| Version: |
0.9.5 |
| Depends: |
R (≥ 3.0.0) |
| Published: |
2016-08-26 |
| Author: |
Craig Varrichio |
| Maintainer: |
Craig Varrichio <canthony427 at gmail.com> |
| License: |
GPL-3 |
| NeedsCompilation: |
yes |
| CRAN checks: |
grr results |
Downloads:
Reverse dependencies:
Linking:
Please use the canonical form
https://CRAN.R-project.org/package=grr
to link to this page.