platypush.plugins.tv.samsung.ws

class platypush.plugins.tv.samsung.ws.TvSamsungWsPlugin(host: Optional[str] = None, port: int = 8002, timeout: Optional[int] = 5, name='platypush', token_file: Optional[str] = None, **kwargs)[source]

Control a Samsung smart TV with Tizen OS over WiFi/ethernet. It should support any post-2016 Samsung with Tizen OS and enabled websocket-based connection.

Requires:

  • samsungtvws (pip install samsungtvws)

__init__(host: Optional[str] = None, port: int = 8002, timeout: Optional[int] = 5, name='platypush', token_file: Optional[str] = None, **kwargs)[source]
Parameters
  • host – IP address or host name of the smart TV.

  • port – Websocket port (default: 8002).

  • timeout – Connection timeout in seconds (default: 5, specify 0 or None for no timeout).

  • name – Name of the remote device (default: platypush).

  • token_file – Path to the token file (default: ~/.local/share/platypush/samsungtvws/token.txt)

back(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send back key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

blue(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send blue key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

channel(channel: int, host: Optional[str] = None, port: Optional[int] = None)None[source]

Change to the selected channel.

Parameters
  • channel – Channel index.

  • host – Default host IP/name override.

  • port – Default port override.

channel_down(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send channel_down key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

channel_up(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send channel_up key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

close_app(app_id: Union[int, str], host: Optional[str] = None, port: Optional[int] = None)None[source]

Close an app.

Parameters
  • app_id – App ID.

  • host – Default host IP/name override.

  • port – Default port override.

device_info(host: Optional[str] = None, port: Optional[int] = None)dict[source]

Return the info of the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

digit(digit: int, host: Optional[str] = None, port: Optional[int] = None)None[source]

Send a digit key to the device.

Parameters
  • digit – Digit to send.

  • host – Default host IP/name override.

  • port – Default port override.

down(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send down key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

enter(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send enter key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

green(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send green key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

guide(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send guide key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

home(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send home key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

info(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send info key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

install_app(app_id: Union[int, str], host: Optional[str] = None, port: Optional[int] = None)None[source]

Install an app.

Parameters
  • app_id – App ID.

  • host – Default host IP/name override.

  • port – Default port override.

left(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send left key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

list_apps(host: Optional[str] = None, port: Optional[int] = None)list[source]

Get the list of installed apps.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

menu(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send menu key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

mute(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send mute key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

open_browser(url: str, host: Optional[str] = None, port: Optional[int] = None)None[source]

Open a URL in the browser.

Parameters
  • url – URL to open.

  • host – Default host IP/name override.

  • port – Default port override.

power(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send power on/off control to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

red(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send red key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

right(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send right key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

run_app(app_id: Union[int, str], host: Optional[str] = None, port: Optional[int] = None)None[source]

Run an app by ID.

Parameters
  • app_id – App ID.

  • host – Default host IP/name override.

  • port – Default port override.

source(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send source key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

status_app(app_id: Union[int, str], host: Optional[str] = None, port: Optional[int] = None)dict[source]

Get the status of an app.

Parameters
  • app_id – App ID.

  • host – Default host IP/name override.

  • port – Default port override.

tools(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send tools key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

up(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send up key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

volume_down(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send volume down control to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

volume_up(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send volume up control to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.

yellow(host: Optional[str] = None, port: Optional[int] = None)None[source]

Send red key to the device.

Parameters
  • host – Default host IP/name override.

  • port – Default port override.