antonioparraga / braviarc

Python library for Sony Bravia TV remote control
MIT License
79 stars 41 forks source link

Handle error during connection in sleep mode. #10

Closed ngraziano closed 7 years ago

ngraziano commented 7 years ago

If TV is in sleep mode (not totally off) when I try to connect, its response is :

{"error":[7,"not power-on"],"id":1}

and there is not the necessary cookie for authentication but is_connected() return True

I get sleep mode for few minutes when I turn the TV off.

ngraziano commented 7 years ago

I change to use response.json(), it was use before for log so this should be good. I also change the test to be allow null response.

antonioparraga commented 7 years ago

perfect!