bendavid / aiopylgtv

Library to control webOS based LG Tv devices
MIT License
143 stars 47 forks source link

Get Volume not working on webOSTV 5.0 #26

Closed marciogranzotto closed 3 years ago

marciogranzotto commented 3 years ago

I have 2 LG TVs, this integration works great with my older 49uj6565 which runs webOSTV 3.5. When I call get_volume the payload is:

{'returnValue': True, 'volumeMax': 100, 'muted': False, 'scenario': 'mastervolume_tv_speaker', 'subscribed': True, 'volume': 9, 'action': 'requested', 'active': False}

But on my LG CX running webOSTV 5.0 I get a different payload:

{'volumeStatus': {'activeStatus': True, 'adjustVolume': True, 'maxVolume': 100, 'muteStatus': False, 'volume': 9, 'mode': 'normal', 'soundOutput': 'tv_speaker'}, 'returnValue': True, 'callerId': 'secondscreen.client'}

so payload.get("volume") fails, since there's a new volumeStatus object.

I'll open a PR with the fix shortly

marciogranzotto commented 3 years ago

Thanks @bendavid ! Can we release a new version with this change to pip?

bendavid commented 3 years ago

I wanted to consolidate a bit the config file handling to avoid breaking backwards compatibility before releasing a new version. If you open a PR to the 0.3.x branch I can release a new version from there at least.