pyremoteplay.device module
Remote Play Devices.
- class pyremoteplay.device.RPDevice(host)
Bases:
objectRepresents a Remote Play device/host.
Most, if not all user interactions should be performed with this class. Status must be polled manually with get_status. Most interactions cannot be used unless there is a valid status.
- Parameters
host (
str) – IP address of Remote Play Host
- static get_all_users(profiles=None)
Return all usernames that have been authenticated with OAuth.
- static get_profiles(path='')
Return Profiles.
- Parameters
path (
str) – Path to file to load profiles. If not given, will load profiles from default path.- Return type
- static search()
Return all devices that are discovered.
- async static async_search()
Return all devices that are discovered. Async.
- WAKEUP_TIMEOUT = 60.0
- get_users(profiles=None)
Return Registered Users.
- get_profile(user, profiles=None)
Return valid profile for user.
See:
pyremoteplay.oauth.get_user_account()pyremoteplay.profile.format_user_account()- Parameters
user (
str) – Username of userprofiles (
Optional[Profiles]) – dict of all user profiles. If None, profiles will be retrieved from default location. Optional.
- Return type
- get_status()
Return status.
- Return type
dict
- async async_get_status()
Return status. Async.
- set_unreachable(state)
Set unreachable attribute.
- set_callback(callback)
Set callback for status changes.
- create_session(user, profiles=None, loop=None, receiver=None, resolution='720p', fps='low', quality='default', codec='h264', hdr=False)
Return initialized session if session created else return None. Also connects a controller to session.
See
Sessionfor param details.- Parameters
user (
str) – Name of user to use. Can be found with get_users- Return type
Optional[Session]
- async connect()
Connect and start session. Return True if successful.
- Return type
bool
- disconnect()
Disconnect and stop session. This also sets session to None.
- async standby(user='', profiles=None)
Place Device in standby. Return True if successful.
If there is a valid and connected session, no arguments need to be passed. Otherwise creates and connects a session first.
If already connected, the sync method
RPDevice.session.standby()is available.- Parameters
user – Name of user to use. Can be found with get_users
- Return type
bool
- wakeup(user='', profiles=None, key='')
Send Wakeup.
Either one of key or user needs to be specified. Key takes precedence over user.
- Parameters
user (
str) – Name of user to use. Can be found with get_userskey (
str) – Regist key from registering
- wait_for_wakeup(timeout=60.0)
Wait for device to wakeup. Blocks until device is on or for timeout.
- Parameters
timeout (
float) – Timeout in seconds- Return type
bool
- async async_wait_for_wakeup(timeout=60.0)
Wait for device to wakeup. Wait until device is on or for timeout.
- Parameters
timeout (
float) – Timeout in seconds- Return type
bool
- wait_for_session(timeout=5)
Wait for session to be ready. Return True if session becomes ready.
Blocks until timeout exceeded or when session is ready.
- Parameters
timeout (
Union[float,int]) – Timeout in seconds.- Return type
bool
- async async_wait_for_session(timeout=5)
Wait for session to be ready. Return True if session becomes ready.
Waits until timeout exceeded or when session is ready.
- Parameters
timeout (
Union[float,int]) – Timeout in seconds.- Return type
bool
- register(user, pin, timeout=2.0, profiles=None, save=True)
Register psn_id with device. Return updated user profile.
- Parameters
user (
str) – User name. Can be found with get_all_userspin (
str) – PIN for linking found on Remote Play Hosttimeout (
float) – Timeout to wait for completionprofiles (
Optional[Profiles]) – Profiles to usesave (
bool) – Save profiles if True
- Return type
- async_register(user, pin, timeout=2.0, profiles=None, save=True)
Register psn_id with device. Return updated user profile.
- Parameters
user (
str) – User name. Can be found with get_all_userspin (
str) – PIN for linking found on Remote Play Hosttimeout (
float) – Timeout to wait for completionprofiles (
Optional[Profiles]) – Profiles to usesave (
bool) – Save profiles if True
- Return type
- property host: str
Return host address.
- Return type
str
- property host_type: str
Return Host Type.
- Return type
str
- property host_name: str
Return Host Name.
- Return type
str
- property mac_address: str
Return Mac Address
- Return type
str
- property ip_address: str
Return IP Address.
- Return type
str
- property ddp_version: str
Return DDP Version.
- Return type
str
- property system_version: str
Return System Version.
- Return type
str
- property remote_port: int
Return DDP port of device.
- Return type
int
- property max_polls: int
Return max polls.
- Return type
int
- property unreachable: bool
Return True if unreachable
- Return type
bool
- property callback: Callable
Return callback for status updates.
- Return type
Callable
- property status: dict
Return Status as dict.
- Return type
dict
- property status_code: int
Return status code.
- Return type
int
- property status_name: str
Return status name.
- Return type
str
- property is_on: bool
Return True if device is on.
- Return type
bool
- property app_name: str
Return App name.
- Return type
str
- property app_id: str
Return App ID.
- Return type
str
- property media_info: ResultItem
Return media info.
- Return type
ResultItem
- property image: bytes
Return raw media image.
- Return type
bytes
- property connected: bool
Return True if session connected.
- Return type
bool
- property ready: bool
Return True if session is ready.
- Return type
bool
- property controller: Controller
Return Controller.
- Return type