diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-05 15:27:56 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-05 15:27:56 +0000 |
| commit | 548b3f5b7b88183362fce582df6e5f32063e6e62 (patch) | |
| tree | 1c80fde8480b70858a8a940b8684b5b34db6af49 | |
| parent | 9d6767c209ac30665e9d35b2f219ca2e8d45819c (diff) | |
automatic import of python-samsungtvwsopeneuler20.03
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-samsungtvws.spec | 678 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 680 insertions, 0 deletions
@@ -0,0 +1 @@ +/samsungtvws-2.5.0.tar.gz diff --git a/python-samsungtvws.spec b/python-samsungtvws.spec new file mode 100644 index 0000000..adb4477 --- /dev/null +++ b/python-samsungtvws.spec @@ -0,0 +1,678 @@ +%global _empty_manifest_terminate_build 0 +Name: python-samsungtvws +Version: 2.5.0 +Release: 1 +Summary: Samsung Smart TV WS API wrapper +License: MIT +URL: https://github.com/xchwarze/samsung-tv-ws-api +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/ca/85/94d3e0675ff626803ec22227963320371760f012294257a41501fd998e8b/samsungtvws-2.5.0.tar.gz +BuildArch: noarch + +Requires: python3-websocket-client +Requires: python3-requests +Requires: python3-aiohttp +Requires: python3-websockets +Requires: python3-cryptography +Requires: python3-py3rijndael + +%description +<p align="center"> + <img src="https://user-images.githubusercontent.com/5860071/47255992-611d9b00-d481-11e8-965d-d9816f254be2.png" width="300px" border="0" /> + <br/> + <a href="https://github.com/xchwarze/samsung-tv-ws-api/releases/latest"> + <img src="https://img.shields.io/badge/version-2.5.0-brightgreen.svg?style=flat-square" alt="Version"> + </a> + Samsung Smart TV WS API wrapper +</p> + +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 + +```bash +$ pip3 install samsungtvws[async,encrypted] +``` + +or + +```bash +$ pip3 install "git+https://github.com/xchwarze/samsung-tv-ws-api.git#egg=samsungtvws[async,encrypted]" +``` + +or...! + +```bash +$ git clone https://github.com/xchwarze/samsung-tv-ws-api +$ pip3 install "./samsung-tv-ws-api[async,encrypted]" +``` + +### Extras + +`async` is required if you wish to use asynchronous I/O for all communications with the TV (`SamsungTVAsyncRest` and `SamsungTVWSAsyncRemote`) +`encrypted` is required if you wish to communicate with a TV which only support the v1 API (some J and K models) for sending commands (`SamsungTVEncryptedWSAsyncRemote` and `SamsungTVEncryptedWSAsyncAuthenticator`). + +## Usage + +### Basic + +```python +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 +apps = tv.app_list() +logging.info(apps) + +# Open app (Spotify) +tv.run_app('3201606009684') + +# Get app status (Spotify) +app = tv.rest_app_status('3201606009684') +logging.info(app) + +# Open app (Spotify) +app = tv.rest_app_run('3201606009684') +logging.info(app) + +# Close app (Spotify) +app = tv.rest_app_close('3201606009684') +logging.info(app) + +# Install from official store (Spotify) +app = tv.rest_app_install('3201606009684') +logging.info(app) + +# Get device info (device name, model, supported features..) +info = tv.rest_device_info() +logging.info(info) + +``` + +### Art Mode + +TVs that support art mode (such as The Frame) can be controlled as follows: + +```python +import sys +import logging + +sys.path.append('../') + +from samsungtvws import SamsungTVWS + +# Increase debug level +logging.basicConfig(level=logging.INFO) + +# Normal constructor +tv = SamsungTVWS('192.168.xxx.xxx') + +# Is art mode supported? +info = tv.art().supported() +logging.info(info) + +# List the art available on the device +info = tv.art().available() +logging.info(info) + +# Retrieve information about the currently selected art +info = tv.art().get_current() +logging.info(info) + +# Retrieve a thumbnail for a specific piece of art. Returns a JPEG. +thumbnail = tv.art().get_thumbnail('SAM-F0206') + +# Set a piece of art +tv.art().select_image('SAM-F0206') + +# Set a piece of art, but don't immediately show it if not in art mode +tv.art().select_image('SAM-F0201', show=False) + +# Determine whether the TV is currently in art mode +info = tv.art().get_artmode() +logging.info(info) + +# Switch art mode on or off +tv.art().set_artmode(True) +tv.art().set_artmode(False) + +# Upload a picture +file = open('test.png', 'rb') +data = file.read() +tv.art().upload(data) + +# If uploading a JPEG +tv.art().upload(data, file_type='JPEG') + +# To set the matte to modern and apricot color +tv.art().upload(data, matte='modern_apricot') + +# Delete an uploaded item +tv.art().delete('MY-F0020') + +# Delete multiple uploaded items +tv.art().delete_list(['MY-F0020', 'MY-F0021']) + +# List available photo filters +info = tv.art().get_photo_filter_list() +logging.info(info) + +# Apply a filter to a specific piece of art +tv.art().set_photo_filter('SAM-F0206', 'ink') +``` + +### Async + +Examples are available in the examples folder: `async_remote.py`, `async_rest.py` + +### Encrypted API + +Examples are available in the examples folder: `encrypted_authenticator.py`, `encrypted_remote.py` + +## Supported TVs + +List of support TV models. https://developer.samsung.com/smarttv/develop/extension-libraries/smart-view-sdk/supported-device/supported-tvs.html + +``` +2017 : M5500 and above +2016 : K4300, K5300 and above +2015 : J5500 and above (except J6203) +2014 : H4500, H5500 and above (except H6003/H6103/H6153/H6201/H6203) +Supported TV models may vary by region. +``` + +For complete list https://developer.samsung.com/smarttv/develop/specifications/tv-model-groups.html + +## License + +GPL-2.0 + + + + +%package -n python3-samsungtvws +Summary: Samsung Smart TV WS API wrapper +Provides: python-samsungtvws +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-samsungtvws +<p align="center"> + <img src="https://user-images.githubusercontent.com/5860071/47255992-611d9b00-d481-11e8-965d-d9816f254be2.png" width="300px" border="0" /> + <br/> + <a href="https://github.com/xchwarze/samsung-tv-ws-api/releases/latest"> + <img src="https://img.shields.io/badge/version-2.5.0-brightgreen.svg?style=flat-square" alt="Version"> + </a> + Samsung Smart TV WS API wrapper +</p> + +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 + +```bash +$ pip3 install samsungtvws[async,encrypted] +``` + +or + +```bash +$ pip3 install "git+https://github.com/xchwarze/samsung-tv-ws-api.git#egg=samsungtvws[async,encrypted]" +``` + +or...! + +```bash +$ git clone https://github.com/xchwarze/samsung-tv-ws-api +$ pip3 install "./samsung-tv-ws-api[async,encrypted]" +``` + +### Extras + +`async` is required if you wish to use asynchronous I/O for all communications with the TV (`SamsungTVAsyncRest` and `SamsungTVWSAsyncRemote`) +`encrypted` is required if you wish to communicate with a TV which only support the v1 API (some J and K models) for sending commands (`SamsungTVEncryptedWSAsyncRemote` and `SamsungTVEncryptedWSAsyncAuthenticator`). + +## Usage + +### Basic + +```python +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 +apps = tv.app_list() +logging.info(apps) + +# Open app (Spotify) +tv.run_app('3201606009684') + +# Get app status (Spotify) +app = tv.rest_app_status('3201606009684') +logging.info(app) + +# Open app (Spotify) +app = tv.rest_app_run('3201606009684') +logging.info(app) + +# Close app (Spotify) +app = tv.rest_app_close('3201606009684') +logging.info(app) + +# Install from official store (Spotify) +app = tv.rest_app_install('3201606009684') +logging.info(app) + +# Get device info (device name, model, supported features..) +info = tv.rest_device_info() +logging.info(info) + +``` + +### Art Mode + +TVs that support art mode (such as The Frame) can be controlled as follows: + +```python +import sys +import logging + +sys.path.append('../') + +from samsungtvws import SamsungTVWS + +# Increase debug level +logging.basicConfig(level=logging.INFO) + +# Normal constructor +tv = SamsungTVWS('192.168.xxx.xxx') + +# Is art mode supported? +info = tv.art().supported() +logging.info(info) + +# List the art available on the device +info = tv.art().available() +logging.info(info) + +# Retrieve information about the currently selected art +info = tv.art().get_current() +logging.info(info) + +# Retrieve a thumbnail for a specific piece of art. Returns a JPEG. +thumbnail = tv.art().get_thumbnail('SAM-F0206') + +# Set a piece of art +tv.art().select_image('SAM-F0206') + +# Set a piece of art, but don't immediately show it if not in art mode +tv.art().select_image('SAM-F0201', show=False) + +# Determine whether the TV is currently in art mode +info = tv.art().get_artmode() +logging.info(info) + +# Switch art mode on or off +tv.art().set_artmode(True) +tv.art().set_artmode(False) + +# Upload a picture +file = open('test.png', 'rb') +data = file.read() +tv.art().upload(data) + +# If uploading a JPEG +tv.art().upload(data, file_type='JPEG') + +# To set the matte to modern and apricot color +tv.art().upload(data, matte='modern_apricot') + +# Delete an uploaded item +tv.art().delete('MY-F0020') + +# Delete multiple uploaded items +tv.art().delete_list(['MY-F0020', 'MY-F0021']) + +# List available photo filters +info = tv.art().get_photo_filter_list() +logging.info(info) + +# Apply a filter to a specific piece of art +tv.art().set_photo_filter('SAM-F0206', 'ink') +``` + +### Async + +Examples are available in the examples folder: `async_remote.py`, `async_rest.py` + +### Encrypted API + +Examples are available in the examples folder: `encrypted_authenticator.py`, `encrypted_remote.py` + +## Supported TVs + +List of support TV models. https://developer.samsung.com/smarttv/develop/extension-libraries/smart-view-sdk/supported-device/supported-tvs.html + +``` +2017 : M5500 and above +2016 : K4300, K5300 and above +2015 : J5500 and above (except J6203) +2014 : H4500, H5500 and above (except H6003/H6103/H6153/H6201/H6203) +Supported TV models may vary by region. +``` + +For complete list https://developer.samsung.com/smarttv/develop/specifications/tv-model-groups.html + +## License + +GPL-2.0 + + + + +%package help +Summary: Development documents and examples for samsungtvws +Provides: python3-samsungtvws-doc +%description help +<p align="center"> + <img src="https://user-images.githubusercontent.com/5860071/47255992-611d9b00-d481-11e8-965d-d9816f254be2.png" width="300px" border="0" /> + <br/> + <a href="https://github.com/xchwarze/samsung-tv-ws-api/releases/latest"> + <img src="https://img.shields.io/badge/version-2.5.0-brightgreen.svg?style=flat-square" alt="Version"> + </a> + Samsung Smart TV WS API wrapper +</p> + +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 + +```bash +$ pip3 install samsungtvws[async,encrypted] +``` + +or + +```bash +$ pip3 install "git+https://github.com/xchwarze/samsung-tv-ws-api.git#egg=samsungtvws[async,encrypted]" +``` + +or...! + +```bash +$ git clone https://github.com/xchwarze/samsung-tv-ws-api +$ pip3 install "./samsung-tv-ws-api[async,encrypted]" +``` + +### Extras + +`async` is required if you wish to use asynchronous I/O for all communications with the TV (`SamsungTVAsyncRest` and `SamsungTVWSAsyncRemote`) +`encrypted` is required if you wish to communicate with a TV which only support the v1 API (some J and K models) for sending commands (`SamsungTVEncryptedWSAsyncRemote` and `SamsungTVEncryptedWSAsyncAuthenticator`). + +## Usage + +### Basic + +```python +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 +apps = tv.app_list() +logging.info(apps) + +# Open app (Spotify) +tv.run_app('3201606009684') + +# Get app status (Spotify) +app = tv.rest_app_status('3201606009684') +logging.info(app) + +# Open app (Spotify) +app = tv.rest_app_run('3201606009684') +logging.info(app) + +# Close app (Spotify) +app = tv.rest_app_close('3201606009684') +logging.info(app) + +# Install from official store (Spotify) +app = tv.rest_app_install('3201606009684') +logging.info(app) + +# Get device info (device name, model, supported features..) +info = tv.rest_device_info() +logging.info(info) + +``` + +### Art Mode + +TVs that support art mode (such as The Frame) can be controlled as follows: + +```python +import sys +import logging + +sys.path.append('../') + +from samsungtvws import SamsungTVWS + +# Increase debug level +logging.basicConfig(level=logging.INFO) + +# Normal constructor +tv = SamsungTVWS('192.168.xxx.xxx') + +# Is art mode supported? +info = tv.art().supported() +logging.info(info) + +# List the art available on the device +info = tv.art().available() +logging.info(info) + +# Retrieve information about the currently selected art +info = tv.art().get_current() +logging.info(info) + +# Retrieve a thumbnail for a specific piece of art. Returns a JPEG. +thumbnail = tv.art().get_thumbnail('SAM-F0206') + +# Set a piece of art +tv.art().select_image('SAM-F0206') + +# Set a piece of art, but don't immediately show it if not in art mode +tv.art().select_image('SAM-F0201', show=False) + +# Determine whether the TV is currently in art mode +info = tv.art().get_artmode() +logging.info(info) + +# Switch art mode on or off +tv.art().set_artmode(True) +tv.art().set_artmode(False) + +# Upload a picture +file = open('test.png', 'rb') +data = file.read() +tv.art().upload(data) + +# If uploading a JPEG +tv.art().upload(data, file_type='JPEG') + +# To set the matte to modern and apricot color +tv.art().upload(data, matte='modern_apricot') + +# Delete an uploaded item +tv.art().delete('MY-F0020') + +# Delete multiple uploaded items +tv.art().delete_list(['MY-F0020', 'MY-F0021']) + +# List available photo filters +info = tv.art().get_photo_filter_list() +logging.info(info) + +# Apply a filter to a specific piece of art +tv.art().set_photo_filter('SAM-F0206', 'ink') +``` + +### Async + +Examples are available in the examples folder: `async_remote.py`, `async_rest.py` + +### Encrypted API + +Examples are available in the examples folder: `encrypted_authenticator.py`, `encrypted_remote.py` + +## Supported TVs + +List of support TV models. https://developer.samsung.com/smarttv/develop/extension-libraries/smart-view-sdk/supported-device/supported-tvs.html + +``` +2017 : M5500 and above +2016 : K4300, K5300 and above +2015 : J5500 and above (except J6203) +2014 : H4500, H5500 and above (except H6003/H6103/H6153/H6201/H6203) +Supported TV models may vary by region. +``` + +For complete list https://developer.samsung.com/smarttv/develop/specifications/tv-model-groups.html + +## License + +GPL-2.0 + + + + +%prep +%autosetup -n samsungtvws-2.5.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-samsungtvws -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 2.5.0-1 +- Package Spec generated @@ -0,0 +1 @@ +d8380dc20486a6207e2345da3aafc885 samsungtvws-2.5.0.tar.gz |
