braviaproapi.bravia.System¶
-
class
braviaproapi.bravia.
System
(bravia_client, http_client)¶ Bases:
object
Provides functionality for configuring the target device.
Parameters: - bravia_client – The parent
BraviaClient
instance. - http_client – The
Http
instance associated with the parent client.
-
get_current_time
()¶ Gets the current system time, if set.
Raises: ApiError
– The request to the target device failed.Returns: The current system time. If the time is not set, returns None. Return type: DateTime or None
-
get_interface_information
()¶ Returns information about the server on the target device. This is used internally to check the current API version.
Raises: ApiError
– The request to the target device failed.Returns: A dict containing the following keys: - product_category (str or None): The device’s category name.
- model_name (str or None): The model of the device.
- product_name (str or None): The product name of the device;
- server_name (str or None): The name of the server, if the device supports multiple.
- interface_version (str or None): The semver API version.
Return type: dict
-
get_led_status
()¶ Returns the current mode of the device’s LED and whether it is enabled.
Raises: ApiError
– The request to the target device failed.Returns: A dict containing the following keys, or None if the LED mode cannot be determined. - status (bool or None): Whether the LED is enabled or not.
- mode (
LedMode
): Which LED mode the target device is currently using.
Return type: dict or None
-
get_network_settings
(interface=None)¶ Returns informaton about the target device’s network configuration.
Parameters: interface (str, optional) – Defaults to None (all interfaces). The interface to get information about. Raises: ApiError
– The request to the target device failed.Returns: A list of dicts containing the following keys. If an interface is specified and not found, returns None. - name (str or None): The name of the interface.
- mac (str or None): The MAC address of the interface.
- ip_v4 (str or None): The IPv4 address of the interface, if available.
- ip_v6 (str or None): The IPv6 address of the interface, if available.
- netmask (str or None): The network mask for the interface.
- gateway (str or None): The configured gateway address for the interface.
- dns_servers (list(str)): A list of DNS servers configured on the interface.
Return type: list(dict) or None
-
get_power_saving_mode
()¶ Returns the current power saving mode of the device.
Raises: ApiError
– The request to the target device failed.Returns: The current power saving mode. Return type: PowerSavingMode
-
get_power_status
()¶ Returns the current power state of the target device:
Raises: ApiError
– The request to the target device failed.Returns: True if device is awake, False if the device is in standby. Return type: bool
-
get_remote_access_status
()¶ Returns whether remote access is enabled on the target device.
Raises: ApiError
– The request to the target device failed.Returns: True if remote access is enabled, False otherwise. Return type: bool
-
get_remote_control_info
()¶ Returns a list of IRCC remote codes supported by the target device.
Raises: ApiError
– The request to the target device failed.Returns: A mapping of remote control button name (str) to IRCC code (str). Return type: dict
-
get_system_information
()¶ Returns information about the target device.
Raises: ApiError
– The request to the target device failed.Returns: A dict containing the following keys: - product (str or None): The product name.
- language (str or None): The configured UI language.
- model (str or None): The device model.
- serial (str or None): The serial number of the device.
- mac (str or None): The device’s MAC address.
- name (str or None): The name of the device.
- generation (str or None): The semver representation of the device’s generation.
Return type: dict
-
get_wake_on_lan_mac
()¶ Returns the Wake-on-LAN (WOL) MAC address for the target device, if available.
Raises: ApiError
– The request to the target device failed.Returns: String MAC address of the device (format 00:00:00:00:00:00), or None if Wake-on-LAN is not available. Return type: str or None
-
get_wake_on_lan_status
()¶ Returns whether the Wake-on-LAN (WOL) function of the target device is enabled.
Raises: ApiError
– The request to the target device failed.Returns: True if Wake-on-LAN is enabled, False if not. Return type: bool
-
power_off
()¶ Puts the target device into standby.
Raises: ApiError
– The request to the target device failed.
-
power_on
()¶ Wakes up the target device.
Raises: ApiError
– The request to the target device failed.
-
request_reboot
()¶ Reboots the target device.
Raises: ApiError
– The request to the target device failed.
-
set_language
(language)¶ Sets the UI language of the target device. Language availabilit depends on the device’s region settings.
Parameters: language (str) – The ISO-639-3 code for the desired language.
Raises: TypeError
– One or more arguments is the incorrect type.ApiError
– The request to the target device failed.LanguageNotSupportedError
– The specified language is not supported by the device.
-
set_led_status
(mode)¶ Sets the LED mode of the target device.
Parameters: mode (LedMode) – The LED mode to set. May not be LedMode.UNKNOWN.
Raises: TypeError
– One or more arguments is the incorrect type.ValueError
– One or more arguments is invalid.ApiError
– The request to the target device failed.InternalError
– An internal error occurred.
-
set_power_saving_mode
(mode)¶ Sets the specified power saving mode on the target device.
Parameters: mode (PowerSavingMode) – The power saving mode to set. May not be PowerSavingMode.UNKNOWN.
Raises: TypeError
– One or more arguments is the incorrect type.ValueError
– One or more arguments is invalid.ApiError
– The request to the target device failed.InternalError
– An internal error occurred.
-
set_power_status
(power_state)¶ Wakes or sleeps the target device.
Parameters: power_state (bool) – True to wake, False to sleep.
Raises: TypeError
– One or more arguments is the incorrect type.ApiError
– The request to the target device failed.
-
set_wake_on_lan_status
(enabled)¶ Enables or disables Wake-on-LAN (WOL) on the target device.
Parameters: enabled (bool) – Whether to enable Wake-on-LAN.
Raises: TypeError
– One or more arguments is the incorrect type.ApiError
– The request to the target device failed.
- bravia_client – The parent
-
class
braviaproapi.bravia.
LedMode
¶ Bases:
enum.Enum
Describes the mode of the LED indicator on the device.
-
UNKNOWN
¶ The LED mode was not recognized.
-
DEMO
¶ The LED is in demo mode.
-
AUTO_BRIGHTNESS
¶ The LED adjusts its brightness based on the ambient light.
-
DARK
¶ The LED is dimmed.
-
SIMPLE_RESPONSE
¶ The LED lights only when responding to a command.
-
OFF
¶ The LED is disabled.
-