panasonic-viera
panasonic-viera copied to clipboard
issue with _session_seq_num
There is a problem with the latest release, but it has turned into a feature. I am using this code with a Panasonic GX880 series television. If I issue a command such as get_mute when the television is turned off, it throw an exception. However, having done so, the remote no longer works and you have to instantiate a new one. The problem appears to be with _session_seq_num which is decremented in line 241 when an exception occurs. It appears though that the seq_num is decremented before it is incremented, thus putting the remote out of sync if an exception occurs.
I am taking advantage of this bug to see whether the tv is turned on or off. I issue a get_mute command, and if it throws an exception, the tv is turned off. I then reset the _session_seq_num and carry on as normal. If no exception is thrown, and I get a value back, the tv is on.