supersaiyanmode / PyWebOSTV

Python API for controlling LG TVs (Web OS)
MIT License
271 stars 50 forks source link

added set_audio_output() and updated readme #43

Closed Felix-Pi closed 3 years ago

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-0.9%) to 84.161% when pulling f6264fb3b44e0d344fdee3bdc5a2aa0298130467 on Felix-Pi:update_controls into e6d134bfdf800652461cd315bb0e266a34ac32ef on supersaiyanmode:master.

supersaiyanmode commented 3 years ago

Hi there, Thanks so much for this PR!

I have a few questions:

  1. Is there a "get_audio_output()" equivalent API?
  2. Can we subscribe to it?

Additionally, as for the actual code changes, I was wondering turning those string into an enum? We don't want to the users to pass in the actual payload string. The best option is to introduce a simple class in pywebstv.models, and use it like ApplicationControl or SourceControl.

Felix-Pi commented 3 years ago

Hi, thanks for your quick reply and your input!

I’ve added get_audio_output() which can be subscribed to. As far as I know there is no endpoint like 'listAudioSources‘, so I implemented a method list_audio_output_sources() to mimic that and return a list of instances from AudioOutputSource. set_audio_output(..) now accepts an instance of AudioOutputSource.

alliefitter commented 3 years ago

@supersaiyanmode Whoa! There's a bunch of stuff in here that isn't implement in this project. I'll try to implement and test all of this stuff this week and put in a PR. Do you still not have access to a WebOS TV to test stuff yourself? Man, I should have thought about looking at Home Bridge stuff.

supersaiyanmode commented 3 years ago

@supersaiyanmode Whoa! There's a bunch of stuff in here that isn't implement in this project. I'll try to implement and test all of this stuff this week and put in a PR. Do you still not have access to a WebOS TV to test stuff yourself? Man, I should have thought about looking at Home Bridge stuff.

Totally! It is disappointing that LG refuses to release any sort of documentation. We have to go hunt for other uses in the wild, come back and implement it.

I have access to the TV, but the wireless receiver is non-functional for some reason. If I must test for some reason, it's via a 10ft long ethernet cable :stuck_out_tongue_closed_eyes:.

Felix-Pi commented 3 years ago

Looking good overall. Thanks so much for this PR! Just a tiny round of super minor requests :)

Thank you for your time and advise :)