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.

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

Install

$ 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 wakeonlan

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

from samsungtvws import SamsungTVWS

# Toggle power
tv = SamsungTVWS('192.168.xxx.xxx')
tv.power()

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

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

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

# Open Spotify
# https://github.com/Ape/samsungctl/issues/75
tv = SamsungTVWS('192.168.xxx.xxx')
tv.run_app('rJeHak5zRg.Spotify')

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.0.0.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

samsungtvws-1.0.0-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

Supported by

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