Skip to content

Commit

Permalink
Compatibility info updates
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonDusseau committed Jul 19, 2020
1 parent e7ad162 commit c6e89c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 9 additions & 2 deletions README.md
Expand Up @@ -15,8 +15,15 @@ It supports the following features:
* Direct control of external inputs and media sources
* Emulated remote control input via IRCC commands

This library is intended for use on newer, Android-based televisions, and has been tested on 2015 and 2016 Bravia
models running Android 7.0 (Nougat).
## Compatibility

This library is intended for use on newer, Android-based televisions. A list of devices and software versions known to be compatible is available on [the GitHub wiki](https://github.com/BrandonDusseau/braviaproapi/wiki/Compatible-Device-List).

It has come to my attention that some newer Bravia models have received software updates bumping their API version to higher than 3.x. These devices are not supported by braviaproapi at this time as I do not have a compatible device to test with. Contributions to the library (and the above linked wiki page) are encouraged if you have a supported device!

If your device is not compatible, braviaproapi will raise the following exception on first connection:

braviaproapi.bravia.errors.apierror.ApiError: The target device is running an incompatible API version 'X.Y.Z'

## Requirements

Expand Down
6 changes: 4 additions & 2 deletions braviaproapi/braviaclient.py
Expand Up @@ -55,12 +55,14 @@ def initialize(self):
if api_version is None:
raise ApiError(
"Unable to verify API version compatibility because the device did not indicate its API version."
)
) from None

if (
version.parse(api_version) >= version.parse("4.0.0")
or version.parse(api_version) < version.parse("3.0.0")
):
raise ApiError("The target device is running an incompatible API version '{0}'".format(api_version))
raise ApiError(
"The target device is running an incompatible API version '{0}'".format(api_version)
) from None

self.__initialized = True

0 comments on commit c6e89c9

Please sign in to comment.