dcnielsen90 / python-bravia-tv

MIT License
13 stars 6 forks source link

Raise NoIPControl error when IP Control is disabled or TV is not supported #11

Closed bieniu closed 4 years ago

bieniu commented 4 years ago

Currently, when the TV has IP Control disabled or the TV is not supported, the JSONDecodeError exception is raised when method connect is used. This patch checks if the requests status_code is 404 and if so raises a NOIPControl exception that could be handled by HA integration.

Related issue: https://github.com/home-assistant/core/issues/35126

dcnielsen90 commented 4 years ago

LGTM 👍.

I'm going to update the README to remove the "compatibility" list (I left it from the original fork and it's obviously come back to bite us) After that, I assume you already have an idea of how you want to implement this in HA so I'll push the release to pip and let you handle the rest from there. The release should be on pip within the hour

bieniu commented 4 years ago

Great. Tomorrow I will prepare a change of integration to handle this exception.