Samsung Smart TV WS API wrapper
Project description
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
Release history Release notifications | RSS feed
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.0.tar.gz
(5.3 kB
view hashes)
Built Distribution
Close
Hashes for samsungtvws-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cefc55c98ab9d33f5d8697e13a409d13df9443e4934d92b6a90478dbf8f7d16 |
|
MD5 | 17cab9dd3eee5481819c9a64aee7981a |
|
BLAKE2b-256 | fc529bf2dcb040e4a7d56b471d33b2b945d7a5ebf349a16fc9df9371a642b47e |