bendavid / aiopylgtv

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

Version 0.4.1 not working with LG OLED C6 #40

Open FilHarr opened 2 years ago

FilHarr commented 2 years ago

I've been trying to use the latest version of aiopylgtv, but am having issues with it and my C6 OLED. Regardless of what command is attempted the following error is thrown:

Traceback (most recent call last):
  File "/config/python/test.py", line 13, in <module>
    asyncio.get_event_loop().run_until_complete(runloop())
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/config/python/test.py", line 6, in runloop
    await client.connect()
  File "/usr/local/lib/python3.9/site-packages/aiopylgtv/webos_client.py", line 163, in connect
    return await self.connect_result
  File "/usr/local/lib/python3.9/site-packages/aiopylgtv/webos_client.py", line 283, in connect_handler
    task.result()
  File "/usr/local/lib/python3.9/site-packages/aiopylgtv/webos_client.py", line 1641, in subscribe_picture_settings
    return await self.subscribe(settings, ep.GET_SYSTEM_SETTINGS, payload=payload)
  File "/usr/local/lib/python3.9/site-packages/aiopylgtv/webos_client.py", line 725, in subscribe
    return await self.request(
  File "/usr/local/lib/python3.9/site-packages/aiopylgtv/webos_client.py", line 711, in request
    raise PyLGTVCmdError(response)
aiopylgtv.webos_client.PyLGTVCmdError: {'type': 'error', 'id': 5, 'error': '500 Application error', 'payload': {'returnValue': False, 'errorCode': -1000, 'errorText': "category, picture doesn't support the key(s): contrast,backlight,brightness,color"}}

I've tested it using the basic example script included in the readme.md, i.e:

import asyncio
from aiopylgtv import WebOsClient

async def runloop():
    client = await WebOsClient.create('192.168.1.53')
    await client.connect()
    apps = await client.get_apps()
    for app in apps:
        print(app)

    await client.disconnect()

asyncio.get_event_loop().run_until_complete(runloop())

This completes successfully with version 0.4.0, but throws the above error when using 0.4.1.

bendavid commented 2 years ago

Ok yes will change this to make this one fail gracefully when not supported.

chros73 commented 2 years ago

You can try my fork, lite package is enough for you (Windows binaries are also available), it should work even using command line util, look at the readme for examples.

chros73 commented 2 years ago

This issue is also fixed in the new release.