antonioparraga / braviarc

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

Sony Bravia KD-43X8307C #1

Closed laf closed 8 years ago

laf commented 8 years ago

Hi,

Firstly thank you for the excellent library. I'm making use of it within home-assistant.io at present but I am seeing an issue which I've tracked down to the TV not responding to:

getPlayingContentInfo

I get the following when I debug

{'id': 1, 'error': [7, 'Illegal State']}

I've tested this by utilising your library directly and can't get this function to work.

As I'm mainly only interested in the status of the TV, I did add the following:

    def get_power_status(self):
        """Get power status."""
        return_value = {}
        resp = self.bravia_req_json("sony/system", self._jdata_build("getPowerStatus", None))
        if resp is not None and not resp.get('error'):
            power_data = resp.get('result')[0]
            return_value['status'] = power_data.get('status')
        return return_value

This will return:

{'status': 'active'}
{'status': 'standby'}

Is it worth me doing a pull request for this or am I doing something wrong in the first place causing the original library not to work.

Thanks in advance.

laf commented 8 years ago

Resolved by #2