Skip to main content

Samsung Smart TV WS API wrapper

Project description


Version Samsung Smart TV WS API wrapper

This project is a library for remote controlling Samsung televisions via a TCP/IP connection.

It currently supports modern (post-2016) TVs with Ethernet or Wi-Fi connectivity. They should be all models with TizenOs.

Based on https://github.com/marysieek/samsung-tv-api work

Install

$ pip3 install samsungtvws

or

$ pip3 install git+https://github.com/xchwarze/samsung-tv-ws-api.git

or...!

$ git clone https://github.com/xchwarze/samsung-tv-ws-api
$ pip3 install ./samsung-tv-ws-api

Usage

import sys
import os
import logging
import wakeonlan

sys.path.append('../')

from samsungtvws import SamsungTVWS

# Increase debug level
logging.basicConfig(level=logging.INFO)

# Normal constructor
tv = SamsungTVWS('192.168.xxx.xxx')

# Autosave token to file 
token_file = os.path.dirname(os.path.realpath(__file__)) + '/tv-token.txt'
tv = SamsungTVWS(host='192.168.xxx.xxx', port=8002, token_file=token_file)

# Toggle power
tv.shortcuts().power()

# Power On
wakeonlan.send_magic_packet('CC:6E:A4:xx:xx:xx')

# Open web in browser
tv.open_browser('https://duckduckgo.com/')

# View installed apps (Spotify)
tv.app_list()

# Open apps (Spotify)
tv.run_app('3201606009684')

# Get device info (device name, model, supported features..)
tv.device_info()

# Get device info (device name, model, supported features..)
info = tv.device_info()
logging.info(info)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

samsungtvws-1.3.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

samsungtvws-1.3.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file samsungtvws-1.3.1.tar.gz.

File metadata

  • Download URL: samsungtvws-1.3.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0

File hashes

Hashes for samsungtvws-1.3.1.tar.gz
Algorithm Hash digest
SHA256 f8306959f9fff7a5e8ab8c79a1a62533ae60f2226b04438bb180f8c18fc154ac
MD5 de0c9c6a2e4b43c1d3a8c82365abbfbf
BLAKE2b-256 1cf60bbd993675426cc7e4d963362622aa290e1d4d14c7140cadd3107837a8ab

See more details on using hashes here.

File details

Details for the file samsungtvws-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: samsungtvws-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0

File hashes

Hashes for samsungtvws-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 15dace43540e1c4c20407354d3086593ba496d49f26db24a9da5f9f92fee5767
MD5 05dcef1e80ad85460960276f09382e7f
BLAKE2b-256 74a73fa4c9a074c834038ece43ff8aa859f2a157339980d6a2d3a6dde2a7c522

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page