olinek2 / LGAC_SmartT

Domoticz plugin for LGAC SmartThing
MIT License
7 stars 8 forks source link

Wideq not working #4

Open stingone opened 4 years ago

stingone commented 4 years ago

Trying now for hours to get it working. With the new wideq version https://github.com/gladhorn/wideq/blob/api2_merged atleast i get at once a refresh token and a device ID. it creates a proper wideq_state.json file with all information. however if i extract this information and put it in the LGACServerNew.py i get the error below:

Traceback (most recent call last): File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run File "./LGACServerNew.py", line 97, in ac_commands_handler client = wideq.Client.from_token(token) File "/home/pi/LGAC_SmartT/wideq.py", line 555, in from_token client.refresh() File "/home/pi/LGAC_SmartT/wideq.py", line 542, in refresh self._session, self._devices = self.auth.start_session() File "/home/pi/LGAC_SmartT/wideq.py", line 257, in start_session return Session(self, session_id), as_list(session_info['item']) KeyError: 'item' 2020-06-28T08:45:09Z <Greenlet at 0x756e69c0: ac_commands_handler('XXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, <Queue at 0x756c8880>)> failed with KeyError

where at the X it shows the device ID number and the refresh token...

stingone commented 4 years ago

I think the whole plugin needs to be updated to the latest API. Could you please see of you can make some time update the plugin to the latest wideq 1.4 version :)

fast-potat0 commented 2 years ago

plugin works fine for me. It looks like you might have copied token instead of refresh token.

I am working on updating this plugin, adding some new wideq features, etc. You can find it here for now, I'll try to request pull request once it's ready. https://github.com/fast-potat0/LGAC_SmartT

Piefje01 commented 1 month ago

File "example.py", line 214, in example(sys.argv[1:]) File "example.py", line 195, in example client._auth = authenticate(client.gateway) File "example.py", line 19, in authenticate return wideq.Auth.from_url(gateway, callback_url) File "/home/pi/LGAC_SmartT/wideq.py", line 247, in from_url access_token, refresh_token = parse_oauth_callback(url) File "/home/pi/LGAC_SmartT/wideq.py", line 162, in parse_oauth_callback return params['access_token'][0], params['refresh_token'][0] KeyError: 'access_token'

Piefje01 commented 1 month ago

Traceback (most recent call last): File "example.py", line 214, in example(sys.argv[1:]) File "example.py", line 200, in example example_command(client, args) File "example.py", line 177, in example_command ls(client) File "example.py", line 25, in ls for device in client.devices: File "/home/pi/LGAC_SmartT/wideq.py", line 474, in devices self._devices = self.session.get_devices() File "/home/pi/LGAC_SmartT/wideq.py", line 465, in session self._session, self._devices = self.auth.start_session() File "/home/pi/LGAC_SmartT/wideq.py", line 257, in start_session return Session(self, session_id), as_list(session_info['item']) KeyError: 'item'