Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update device.py #61

Open
wants to merge 226 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
226 commits
Select commit Hold shift + click to select a range
b241b39
Update README.md
alexmohr Mar 27, 2018
9985535
Update README.md
alexmohr Mar 27, 2018
e668585
added pip config
alexmohr Mar 27, 2018
715273d
renamed file to make imports better
alexmohr Mar 27, 2018
d17150f
Update README.md
alexmohr Mar 27, 2018
61a5651
Update README.md
alexmohr Mar 27, 2018
abbd2e9
made command hnadling more robust
alexmohr Mar 28, 2018
738e2ac
Fixed issue with registration and added method to start apps.
alexmohr Mar 28, 2018
9df445b
Fixed a lot of issues in combination with home assistant. Improved st…
alexmohr Mar 31, 2018
ee6fa0f
More minor fixes to prevent uneccssary logging.
alexmohr Mar 31, 2018
00e8ebc
version bump
alexmohr Mar 31, 2018
e658cba
reduced timeout
alexmohr Mar 31, 2018
d1d4595
reduced timeout
alexmohr Mar 31, 2018
4c5f7e4
Added file to convert into hassbian configuration
alexmohr May 21, 2018
82cfa80
fix for version < 3 devices.
alexmohr May 21, 2018
b3cffd7
Added script for services discovery
alexmohr May 22, 2018
47b0246
fixed some issues with version < 3
alexmohr May 22, 2018
e1159a1
Update README.md
alexmohr Mar 27, 2019
8896e95
Merge branch 'master' of ssh://github.com/alexmohr/sonyapilib
alexmohr Mar 27, 2019
dd519f3
Fixed registration url for gen2 devices
alexmohr Mar 27, 2019
ca631e9
starting impl of API version 4
alexmohr Mar 27, 2019
aa9bba5
Using TVSideView:MAC as deviceId
alexmohr Mar 27, 2019
4f9a6c3
Revert "Fixed registration url for gen2 devices"
alexmohr Mar 27, 2019
d08fe8e
Update README.md
dilruacs Mar 28, 2019
fadc5bb
Update README.md
dilruacs Mar 28, 2019
a172757
Spelling error and variable mixup?
dilruacs Mar 29, 2019
01a60d8
Merge branch 'bugfix/Trouble-configuring-Sony-BDP-S4200' into master
dilruacs Mar 29, 2019
ab2ff9a
Added "registration_response = "
dilruacs Mar 29, 2019
c3a11dc
Merge branch 'master' of github.com:dilruacs/sonyapilib
dilruacs Mar 29, 2019
a5b087f
Added working registration
alexmohr Mar 29, 2019
be28941
Merge pull request #6 from dilruacs/master
alexmohr Mar 29, 2019
1d2d315
Update README.md
alexmohr Mar 29, 2019
02a3c3a
Merge pull request #8 from alexmohr/dev
alexmohr Mar 29, 2019
2106105
imported logging twice
dilruacs Apr 1, 2019
d366961
Spelling, version
dilruacs Apr 1, 2019
9c9d6c0
Use wakeonlan library
dilruacs Apr 1, 2019
c520ce6
modify mac
dilruacs Apr 1, 2019
19066fc
Add debug
dilruacs Apr 1, 2019
229c74c
add parameter name
dilruacs Apr 1, 2019
ca69d8a
Merge remote-tracking branch 'upstream/master'
dilruacs Apr 1, 2019
2bc2c84
Add error checking to send_command
dilruacs Apr 1, 2019
1d240b8
Check if command is known
dilruacs Apr 1, 2019
42798ca
Merge pull request #11 from dilruacs/dev
alexmohr Apr 1, 2019
6e103ef
Merge pull request #12 from dilruacs/keyerror_firstpoweron
alexmohr Apr 1, 2019
213137d
Merge branch 'master' of ssh://github.com/alexmohr/sonyapilib
alexmohr Apr 1, 2019
fd241d6
Merge branch 'master' into dev
alexmohr Apr 1, 2019
690aef9
Fixed spelling
alexmohr Apr 1, 2019
befdf7b
Merge branch 'dev' into bugfix/Trouble-configuring-Sony-BDP-S4200
alexmohr Apr 1, 2019
2cb354b
Merge pull request #13 from alexmohr/bugfix/Trouble-configuring-Sony-…
alexmohr Apr 1, 2019
9169bae
Moved examples to subfolder and updated readme.
alexmohr Apr 1, 2019
19f876c
Merge branch 'dev' of ssh://github.com/alexmohr/sonyapilib into dev
alexmohr Apr 1, 2019
7308575
Added wakeonlan library to pip dependencies.
alexmohr Apr 1, 2019
c482f0e
Merge branch 'dev' into v4
alexmohr Apr 1, 2019
04b1644
refactoring in parts to include v4
alexmohr Apr 1, 2019
dfaa84b
Updated Version number
alexmohr Apr 1, 2019
4c7b96c
Merge pull request #2 from alexmohr/dev
dilruacs Apr 2, 2019
7c02a8c
Update README.md
dilruacs Apr 2, 2019
f6b9654
Merge pull request #15 from dilruacs/patch-1
alexmohr Apr 2, 2019
bddaebf
Merge branch 'dev' of ssh://github.com/alexmohr/sonyapilib into v4
alexmohr Apr 2, 2019
3349000
Merge branch 'master' of ssh://github.com/alexmohr/sonyapilib into dev
alexmohr Apr 2, 2019
367490d
Merge pull request #14 from alexmohr/dev
alexmohr Apr 2, 2019
b164783
Merge branch 'master' of ssh://github.com/alexmohr/sonyapilib into v4
alexmohr Apr 2, 2019
b411737
Refactoring and added travis.
alexmohr Apr 2, 2019
2525bd7
Changed python version for travis
alexmohr Apr 2, 2019
1fc4e73
Merge pull request #3 from alexmohr/dev
dilruacs Apr 2, 2019
bec625d
mend
alexmohr Apr 2, 2019
c6f2efb
mend
alexmohr Apr 2, 2019
215813a
Call update_service_urls() after successfull registration
dilruacs Apr 2, 2019
8901088
Merge branch 'dev' of github.com:dilruacs/sonyapilib into dev
dilruacs Apr 2, 2019
8e9ec0d
Changed init.
alexmohr Apr 2, 2019
accf3e8
updated init
alexmohr Apr 2, 2019
7587317
Decoupled methods
alexmohr Apr 2, 2019
e26bc1c
Removed recursive call
alexmohr Apr 2, 2019
1dc41b8
Update device URL's and command list after authentication has been send
dilruacs Apr 3, 2019
c4d1d90
Resolved merge conflict
dilruacs Apr 3, 2019
6aacbef
Small style fixes
dilruacs Apr 3, 2019
8596744
Merge pull request #16 from dilruacs/dev
alexmohr Apr 3, 2019
6e072b0
Fix linter errors
dilruacs Apr 3, 2019
8a7e81a
Added blank line
dilruacs Apr 3, 2019
d54956a
More lint errors
dilruacs Apr 3, 2019
a8bf326
Merge pull request #18 from dilruacs/lint
alexmohr Apr 3, 2019
6e6b860
Merge branch 'dev' of ssh://github.com/alexmohr/sonyapilib into v4
alexmohr Apr 3, 2019
7f001c2
Do some codestyling in setup.py
Apr 3, 2019
30617cb
Sort imports in device.py
Apr 3, 2019
4f1e63c
Refactoring, cleanup, added tests, continuued v4 impl.
alexmohr Apr 3, 2019
d4ec7f1
added pylint to travis
alexmohr Apr 3, 2019
aca8902
Refactor init of XmlApiObject
Apr 3, 2019
b3da4ff
Changed coveralls config.
alexmohr Apr 3, 2019
bfa472c
Removed invalid no mirrors option.
alexmohr Apr 3, 2019
d87fa70
changed travis.
alexmohr Apr 3, 2019
302712d
travis.
alexmohr Apr 3, 2019
2534521
changed version for pytest.
alexmohr Apr 3, 2019
fa626f3
readded lint to travis.
alexmohr Apr 3, 2019
051234d
Changed readme to display v4 branch
alexmohr Apr 3, 2019
30c26b7
updated test requirements.
alexmohr Apr 3, 2019
81e4f55
corrected travis exec pylint.
alexmohr Apr 3, 2019
481c872
Refactor and codestyling in device.py
Apr 3, 2019
8268a48
Fix urljoin in _parse_dmr
Apr 3, 2019
f7e7f81
Merge branch 'v4' into refactor
Apr 3, 2019
d479206
Fix Bugs
Apr 3, 2019
1d6a266
Remove pylint warnings
Apr 3, 2019
b40a007
Fix pylint messages and merge errors
Apr 3, 2019
c5f86b4
Merge pull request #23 from schoenpat/refactor
alexmohr Apr 4, 2019
074a341
Add optional target for wakeonlan
dilruacs Apr 4, 2019
b6f64f4
Merge pull request #25 from dilruacs/v4
alexmohr Apr 4, 2019
ec1de13
Unit tests
alexmohr Apr 4, 2019
5f96225
Merge branch 'v4' of ssh://github.com/alexmohr/sonyapilib into v4
alexmohr Apr 4, 2019
79e7d36
linter
alexmohr Apr 4, 2019
77343b8
Add broadcast as optional to power method
dilruacs Apr 4, 2019
f13dcfd
Update README.md
alexmohr Apr 4, 2019
08056ad
Merge pull request #26 from dilruacs/v4
alexmohr Apr 4, 2019
248fc14
tests
alexmohr Apr 4, 2019
f9fa0ce
Merge branch 'v4' of ssh://github.com/alexmohr/sonyapilib into v4
alexmohr Apr 4, 2019
4292d04
Changed python version to 3.5 to validate errors in #27
alexmohr Apr 4, 2019
f8e2bef
partially rollback of XmlApiObject to solve #27
alexmohr Apr 4, 2019
0db9458
Add function to find in xml
Apr 4, 2019
8cc8420
fixed linter issues.
alexmohr Apr 4, 2019
4d20630
Update README.md
alexmohr Apr 4, 2019
082534d
Update README.md
alexmohr Apr 4, 2019
a26f3d6
Merge branch 'v4' into find_in_xml
Apr 4, 2019
9605c65
Updated readme, added tests.
alexmohr Apr 4, 2019
44488d6
Merge branch 'v4' of ssh://github.com/alexmohr/sonyapilib into v4
alexmohr Apr 4, 2019
eeb5f84
Move find_xml to new xml_helper.py
Apr 4, 2019
8bf7410
Merge pull request #29 from schoenpat/find_in_xml
alexmohr Apr 4, 2019
c4eb8e6
Registration error tests.
alexmohr Apr 4, 2019
16e5f43
Merge branch 'v4' of ssh://github.com/alexmohr/sonyapilib into v4
alexmohr Apr 4, 2019
91eea25
linter and spelling
alexmohr Apr 4, 2019
c84683b
Fixed #28
alexmohr Apr 5, 2019
f88a6a6
changed authentication
alexmohr Apr 5, 2019
1e79bd2
extended registration tests.
alexmohr Apr 5, 2019
dd8cd78
Refactor _send_http
Apr 5, 2019
6e6629f
Remove _request_json method
Apr 5, 2019
35d3469
continued tests.
alexmohr Apr 5, 2019
0d8548e
Merge branch 'refactor_send_http' of ssh://github.com/schoenpat/sonya…
alexmohr Apr 5, 2019
118293e
added testcase to make sure uuid is the same.
alexmohr Apr 5, 2019
66a3710
Fix params for http request
Apr 6, 2019
59073e5
Merge pull request #33 from schoenpat/fix_request_params
alexmohr Apr 6, 2019
96cf214
Added ssdp test, refactored structure, running tests via setup.py, re…
alexmohr Apr 6, 2019
765781a
Merge remote-tracking branch 'origin/v4' into v4
alexmohr Apr 6, 2019
8bd8110
added python-coveralls to travis config.
alexmohr Apr 6, 2019
f1668d8
added git attributes
alexmohr Apr 6, 2019
7ddf036
added more tests
alexmohr Apr 7, 2019
12045fe
added commands for v4.
alexmohr Apr 7, 2019
76e0326
Added apps for v4
alexmohr Apr 7, 2019
bc716c1
added test for power status.
alexmohr Apr 7, 2019
447a4b0
Added most tests possible before getting data from v4 device.
alexmohr Apr 9, 2019
c751f29
tests for playing status.
alexmohr Apr 9, 2019
e8d04cf
updated readme.
alexmohr Apr 9, 2019
51df6eb
Update README.md
alexmohr Apr 9, 2019
24e1fc5
Update README.md
alexmohr Apr 11, 2019
b53cd83
Finished v4 impl.
alexmohr Apr 14, 2019
78085e4
Merge branch 'v4' of ssh://github.com/alexmohr/sonyapilib into v4
alexmohr Apr 14, 2019
86aa47a
Disabled a linter warning
alexmohr Apr 14, 2019
cd1ee9d
added reading of mac address for v4
alexmohr Apr 14, 2019
652e310
Merge pull request #34 from alexmohr/v4
alexmohr Apr 14, 2019
20e6e8a
added psk support.
alexmohr Apr 14, 2019
d97fc8d
Merge pull request #36 from alexmohr/psk
alexmohr Apr 14, 2019
a2eeb2c
Fixed some issues regarding v3 creation
alexmohr Apr 17, 2019
8fbf9e1
Fixed some issues regarding inital device creation in v3
alexmohr Apr 17, 2019
e221ad0
Renamed uuid field to client_id
alexmohr Apr 17, 2019
0065ab7
Using nickname as id.
alexmohr Apr 17, 2019
a299eab
Fixed tests.
alexmohr Apr 17, 2019
30e70e5
Merge pull request #37 from alexmohr/dev
alexmohr Apr 17, 2019
4360038
Update README.md
alexmohr Sep 11, 2019
6194f9d
Merge pull request #39 from alexmohr/alexmohr-patch-1-1
alexmohr Sep 11, 2019
d6d5f3e
Add support for volume control for Home Cinéma like BVD-E2100
ptimatth Oct 6, 2019
687da20
Add new method to test & remove trailing whitespaces
ptimatth Oct 7, 2019
fb223d5
Renaming function mute_volume to mute
ptimatth Oct 7, 2019
4469ef2
Merge pull request #40 from ptimatth/master
alexmohr Oct 7, 2019
94fc956
Updated version number for pip
alexmohr Oct 7, 2019
455a9f7
Merge pull request #42 from alexmohr/dev
alexmohr Oct 7, 2019
fc7e22f
More linting and stages in travis
alexmohr Oct 7, 2019
79b1101
Linting
alexmohr Oct 7, 2019
4bdbde6
linting
alexmohr Oct 8, 2019
c702b9f
pylint install
alexmohr Oct 8, 2019
cb2e83b
travis cfg
alexmohr Oct 8, 2019
5f78348
trigger build.
alexmohr Nov 3, 2019
862e4b9
Travis
alexmohr Nov 3, 2019
58e77c7
coveralls now working?
alexmohr Nov 3, 2019
503d96a
coveralls
alexmohr Nov 3, 2019
42b328f
Merge pull request #44 from alexmohr/dev
alexmohr Nov 3, 2019
25c4348
Added constructor options to give ports
alexmohr Apr 30, 2020
fe78491
Changed python version in travis.yml
alexmohr Apr 30, 2020
0c66df4
Changed coveralls version
alexmohr Apr 30, 2020
ee3151e
Changed to version 4.5.1 for coveralls
alexmohr Apr 30, 2020
c2678f2
Fixed deprecation warning
alexmohr Apr 30, 2020
3cc98de
Fixed linter
alexmohr Apr 30, 2020
3469e54
Added missing test case
alexmohr Apr 30, 2020
d15f33e
tests
alexmohr Apr 30, 2020
abc49eb
tests
alexmohr Apr 30, 2020
1da3a08
added another test case
alexmohr Apr 30, 2020
f9b87ba
added another exception test case
alexmohr Apr 30, 2020
bcc4ffe
Fixed missing url
alexmohr Apr 30, 2020
f56aa80
removed invalid if
alexmohr Apr 30, 2020
c3491a0
tests...
alexmohr Apr 30, 2020
b877bb0
Merge pull request #47 from alexmohr/feature/ports
alexmohr May 1, 2020
e298706
Merge pull request #48 from alexmohr/dev
alexmohr May 1, 2020
4122c1e
Added bugfix for bdp-s580
alexmohr May 4, 2020
bdb5710
linter
alexmohr May 4, 2020
f24312d
linter
alexmohr May 4, 2020
405984a
Fixed coveralls
alexmohr May 4, 2020
8dfd21f
Merge branch 'master' into bugfix/ports
alexmohr May 4, 2020
7a304f4
Merge pull request #49 from alexmohr/bugfix/ports
alexmohr May 28, 2020
512cf07
version
alexmohr May 28, 2020
b7e8f92
Merge branch 'bugfix/ports' of github.com:alexmohr/sonyapilib into bu…
alexmohr May 28, 2020
b978e9b
Merge pull request #50 from alexmohr/bugfix/ports
alexmohr May 30, 2020
c81283c
added device info for issue #53
alexmohr Jun 5, 2020
8294931
linter
alexmohr Jun 5, 2020
493ed86
linter
alexmohr Jun 5, 2020
fe9b122
uses sugesstion from #54 to fix service location bug.
alexmohr Jun 6, 2020
03c0d55
Added auth request to fix #52
alexmohr Jun 6, 2020
07b2b17
Added tests.
alexmohr Jun 6, 2020
19e4ebd
Added test for no schema add
alexmohr Jun 6, 2020
7b6e776
adding device info headers int init device to make sure they are alwa…
alexmohr Jun 8, 2020
da4d5ba
test fixed
alexmohr Jun 8, 2020
bb9baee
Fixed tests.
alexmohr Jun 8, 2020
598fdf3
Merge pull request #55 from alexmohr/bug/auth
alexmohr Jun 9, 2020
f2a6b8e
SonyDevice: Support 2010 Blu-ray players, e.g. BDP-S370
mtdcr Aug 30, 2020
3e1380b
device_test.py: Default to API version 3
mtdcr Sep 1, 2020
b8059ce
IrccCategory: Add a short description
mtdcr Sep 1, 2020
bae0494
travis: disable pylint message C0302
mtdcr Sep 1, 2020
b9fc63c
Add a test for SonyDevice._use_builtin_command_list
mtdcr Sep 1, 2020
c9a2445
Added tests to fix coverage
alexmohr Oct 3, 2020
553577b
Merge pull request #60 from alexmohr/mtdcrpr58
alexmohr Oct 3, 2020
50fd583
Version bump
alexmohr Oct 3, 2020
8608c57
Update device.py
gohlas Oct 12, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* crlf_text eol=crlf

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
ssdp.text crlf_text
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Files used for testing
bluray.json
cp.sh

.pypirc

# Byte-compiled / optimized / DLL files
__pycache__/
Expand All @@ -11,6 +13,8 @@ __pycache__/
*.so




# Distribution / packaging
.Python
build/
Expand Down Expand Up @@ -104,4 +108,8 @@ venv.bak/
/site

# mypy
.mypy_cache/
.mypy_cache/

.coveralls
.idea/
.vscode/
42 changes: 42 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
language: python
python:
- "3.7"
cache: pip
stages:
- UnitTests
- linting
install:
- pip install -r test_requirements.txt
- pip install .

jobs:
include:
- stage: UnitTests
name: "Running unit tests"
script: py.test tests/*_test.py --cov=sonyapilib && coveralls
# Linting
- stage: linting
install: pip install pycodestyle
name: "Linting with pycodestyle"
script: find . -name \*.py -exec pycodestyle --ignore=E501,E402 {} +
- stage: linting
install: pip install pydocstyle
name: "Linting with pydocstyle"
# do not lint docs for tests
script: find sonyapilib -name \*.py -exec pydocstyle --add-ignore=D400 {} +
- stage: linting
install:
- pip install pylint
- pip install -r test_requirements.txt
- pip install .
name: "Linting with pylint"
script: find sonyapilib -name \*.py -exec pylint -d C0302 {} +
- stage: linting
install: pip install pyflakes
name: "Linting with pyflakes"
script: find . -name \*.py -exec pyflakes {} +
- stage: linting
install: pip install flake8
name: "Linting with flake8"
script: find . -name \*.py -exec flake8 --ignore=E501,E402 {} +

22 changes: 0 additions & 22 deletions .vscode/launch.json

This file was deleted.

98 changes: 57 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,87 @@
# Sonyapilib
Sony API lib. This is a python3 conversion from this project https://github.com/KHerron/SonyAPILib and some things have been taken from here: https://github.com/aparraga/braviarc.
It may not contains all functionality which is implemented in the project from KHerron because it is used as base implementation for usage in home assistant
[![Build Status](https://travis-ci.org/alexmohr/sonyapilib.svg?branch=v4)](https://travis-ci.org/alexmohr/sonyapilib)
[![Coverage Status](https://coveralls.io/repos/github/alexmohr/sonyapilib/badge.svg?branch=v4)](https://coveralls.io/github/alexmohr/sonyapilib?branch=v4)

This library controls sony devices of all generations which are supported by the TVSideView app. In contrast to other libraries like https://github.com/aparraga/braviarc this supports older generations aswell.

Code has been taken from the following repositories.
* https://github.com/KHerron/SonyAPILib
* https://github.com/aparraga/braviarc

This library is used as communication interface in a home assistant component to control media players, which can be found here: https://github.com/alexmohr/media_player.sony

At the moment not all functions offered by the api are implemented. If you miss a function feel free to create a pull request or open a feature request.

# Installation
To install simply run
```
pip install sonyapilib
```

This library has been tested with python 3.5 and above, functionality for older python version cannot be guaranteed.

# Example
`
stored_config = "bluray.json"
device = None
import os.path
if os.path.exists(stored_config):
with open(stored_config, 'r') as content_file:
json_data = content_file.read()
device = SonyDevice.load_from_json(json_data)
else:
This example connections with device (of which the ip address is hard coded) start the registration process and starts the first available. More detailed examples can be found in the examples folder.
```
from sonyapilib.device import SonyDevice

if __name__ == "__main__":
# device must be on for registration
host = "10.0.0.102"
device = SonyDevice(host)
device.register("SonyApiLib Python Test")
device = SonyDevice(host, "SonyApiLib Python Test")
device.register()
pin = input("Enter the PIN displayed at your device: ")
device.send_authentication(pin)
if not device.send_authentication(pin):
print("Failed to register device")
exit(1)

data = device.save_to_json()
text_file = open("bluray.json", "w")
text_file.write(data)
text_file.close()
apps = device.get_apps()
device.start_app(apps[0])
device.play()

is_on = device.get_power_status()
if not is_on:
device.wakeonlan()
device.update_service_urls()
device.update_commands()
```

device.play()
`
# URL list

#Compatability List
https://github.com/chr15m/media-remote/blob/master/SNIFF.md

LCD TV BRAVIA
2016 model or later:
*KDL-W/WD, KLV-W Series (2016 model) are not compatible with Video & TV SideView. (Except for KDL-W800D/W950D) *You can not install Video & TV SideView app into your Sony's Android TV™.
https://gist.github.com/kalleth/e10e8f3b8b7cb1bac21463b0073a65fb

2015 model
XBR-X94xC series, XBR-X93xC series, XBR-X91xC series, XBR-X90xC series, XBR-X85xC series, XBR-X83xC series, XBR-X80xC series, KD-X94xxC series, KD-X93xxC series, KD-X91xxC series, KD-X90xxC series, KD-X85xxC series, KD-X83xxC series, KD-X80xxC series, KDL-W95xC series, KDL-W85xC series, KDL-W80xC series, KDL-W75xC series, KDL-W70xC series, KDL-W600A series
# Compatibility List

Please update your TV software to the latest version. For how to update the software.
### 2016 model or later
KDL-W/WD, KLV-W Series (2016 model) are not compatible with Video & TV SideView. (Except for KDL-W800D/W950D)

You can not install Video & TV SideView app into your Sony's Android TV™.
2014 model

### 2015 model
XBR-X94xC series, XBR-X93xC series, XBR-X91xC series, XBR-X90xC series, XBR-X85xC series, XBR-X83xC series, XBR-X80xC series, KD-X94xxC series, KD-X93xxC series, KD-X91xxC series, KD-X90xxC series, KD-X85xxC series, KD-X83xxC series, KD-X80xxC series, KDL-W95xC series, KDL-W85xC series, KDL-W80xC series, KDL-W75xC series, KDL-W70xC series, KDL-W600A series

Please update your TV software to the latest version.

### 2014 model
XBR-X95xB series, XBR-X90xB series, XBR-X85xB series, KD-X95xxB series, KD-X90xxB series, KD-X85xxB series, KD-X83xxC series, KD-X80xxB series, KDL-W95xB series, KDL-W92xA series, KDL-W90xB series, KDL-W85xB series, KDL-W83xB series, KDL-W8xxB series, KDL-W7xxB series, KDL-W6xxB series, KDL-W5xxA series

2013 model
### 2013 model
XBR-X90xA series, XBR-X85xA series, KD-X900xA series, KD-X850xA series, KDL-W95xA series, KDL-W90xA series, KDL-W85xA series, KDL-W80xA series, KDL-W70xA series, KDL-W67xA series, KDL-W65xA series, KDL-W60xA series, KDL-S99xA series

2012 model
### 2012 model
XBR-X90x series, KD-X900x series, XBR-HX95 series, KDL-HX95 series, KDL-HX85 series, KDL-HX75 series, KDL-NX65 series, KDL-EX75 series, KDL-EX65 series, KDL-EX55 series, KDL-EX54 series

2011 model
### 2011 model
XBR-HX92 series, KDL-HX92 series, KDL-HX82 series, KDL-HX72 series, KDL-NX72 series, KDL-EX72 series, KDL-EX62 series, KDL-EX52 series, KDL-EX42 series, KDL-EX32 series, KDL-CX52 series, KDL-CX40 series

Blu-ray Disc™/DVD Player
### Blu-ray Disc™/DVD Player
UHP-H1, BDP-S6700, BDP-S3700, BDP-S6500, BDP-S5500, BDP-S4500, BDP-S3500, BDP-S7200, BDP-S6200, BDP-S5200, BDP-S4200, BDP-S3200, BDP-BX620, BDP-BX520, BDP-BX320, BDP-S5100, BDP-S4100, BDP-S3100, BDP-BX510, BDP-BX310, BDP-A6000, BDP-S790, BDP-S590, BDP-S490, BDP-S390, BDP-BX59, BDP-BX39, BDP-S780, BDP-S580, BDP-S480, BDP-S380, BDP-BX58, BDP-BX38, BDP-S1700ES, BDP-S770, BDP-S570, BDP-S470, BDP-S370, BDP-BX57, BDP-BX37

Blu-ray Disc™/DVD Home Theatre System
### Blu-ray Disc™/DVD Home Theatre System
BDV-N9200WL, BDV-N9200W, BDV-NF7220, BDV-N7200WL, BDV-N7200W, BDV-N5200W, BDV-E3200, BDV-N9900SH, BDV-N9150WL, BDV-N9150W, BDV-N9100WL, BDV-N9100W , BDV-N8100WL, BDV-N8100W , BDV-N7100WL, BDV-N7100W, BDV-E6100 , BDV-E5100, BDV-E4100, BDV-E3100, BDV-E2100, BDV-EF1100, BDV-N995W, BDV-N990W, BDV-N890W, BDV-N790W, BDV-N590, BDV-E690, BDV-E490, BDV-E390, BDV-E385, BDV-E290, BDV-E190, BDV-NF720, BDV-NF620, BDV-EF420, BDV-EF220, BDV-T79, BDV-T39, BDV-E985W, BDV-E980W, BDV-E980, BDV-E880, BDV-E780W, BDV-E580, BDV-E380, BDV-L800M, BDV-L800, BDV-L600, BDV-T58, BDV-IZ1000W, BDV-HZ970W, BDV-E970W, BDV-E870, BDV-E770W, BDV-E670W, BDV-E570, BDV-E470, BDV-E370, BDV-F700, BDV-F500, BDV-F7, BDV-T57

Streaming Player / Network Media Player
### Streaming Player / Network Media Player
NSZ-GS8, NSZ-GU1, NSZ-GX70, NSZ-GS7, SMP-N200, SMP-N100

Sony Internet TV
### Sony Internet TV
NSX-46GT1, NSX-40GT1, NSX-32GT1, NSX-24GT1, NSZ-GT1

AV Receiver
### AV Receiver
STR-DN1070, STR-DN1060, STR-DN860, STR-DN1050, STR-DN850, STR-DN1040, STR-DN840, STR-DA1800ES, STR-DN1030, STR-DN1020
16 changes: 16 additions & 0 deletions examples/convert_to_hass.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""Converts the configuration for home assistant."""
import json
from sonyapilib.device import SonyDevice


config_file = 'bluray.json'

with open(config_file, 'r') as myfile:
data = myfile.read()

device = SonyDevice.load_from_json(data)

hass_cfg = {}
hass_cfg[device.host] = {}
hass_cfg[device.host]["device"] = data
print(json.dumps(hass_cfg), file=open("sony.conf", "w"))
8 changes: 8 additions & 0 deletions examples/discover_devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Example to discover services on a device."""
from sonyapilib.ssdp import SSDPDiscovery

ip = "10.0.0.102"
ssdp = SSDPDiscovery()
services = ssdp.discover()
for service in services:
print(service)
54 changes: 54 additions & 0 deletions examples/pair_and_apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""Example script to pair the device and start an app."""
from sonyapilib.device import SonyDevice

CONFIG_FILE = "bluray.json"


def save_device():
"""Save the device to disk."""
data = device.save_to_json()
text_file = open(CONFIG_FILE, "w")
text_file.write(data)
text_file.close()


def load_device():
"""Restore the device from disk."""
import os
sony_device = None
if os.path.exists(CONFIG_FILE):
with open(CONFIG_FILE, 'r') as content_file:
json_data = content_file.read()
sony_device = SonyDevice.load_from_json(json_data)
return sony_device


if __name__ == "__main__":
device = load_device()
if not device:
# device must be on for registration
host = "192.168.178.23"
device = SonyDevice(host, "Test123")
device.register()
pin = input("Enter the PIN displayed at your device: ")
if device.send_authentication(pin):
save_device()
else:
print("Registration failed")
exit(1)

# wake device
is_on = device.get_power_status()
if not is_on:
device.power(True)

status = device.get_playing_status()

apps = device.get_apps()
device.pause()
for app in device.apps:
if "youtube" in app.lower():
device.start_app(app)
device.get_playing_status()
# Play media
device.play()
16 changes: 16 additions & 0 deletions examples/readme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""Example found in the readme."""
from sonyapilib.device import SonyDevice

if __name__ == "__main__":
# device must be on for registration
host = "10.0.0.102"
device = SonyDevice(host, "SonyApiLib Python Test")
device.register()
pin = input("Enter the PIN displayed at your device: ")
if not device.send_authentication(pin):
print("Failed to register device")
exit(1)

apps = device.get_apps()
device.start_app(apps[0])
device.play()
4 changes: 4 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
python setup.py sdist bdist_wheel
twine upload dist

3 changes: 3 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
python setup.py sdist
twine upload
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[metadata]
description-file = README.md
Loading