-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError: 'token_version' #55
Comments
Correction!!! It does work...You need to let it run the loop again, then the issue is solved. |
In fact, there is some issue when the token file does not exist before. Workaround: Reproduction: $ rm data/tokens.json
$ python toogoodtogo_ha_mqtt_bridge/main.py 2022-06-19 06:42:46 [INFO] Connecting mqtt
2022-06-19 06:42:46 [INFO] Starting loop
2022-06-19 06:42:46 [INFO] Logging in with credentials
Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
Logged in!
2022-06-19 06:43:02 [INFO] Written tokens.json file to filesystem
2022-06-19 06:43:02 [INFO] Next run at 2022-06-19 06:44:35
2022-06-19 06:44:35 [DEBUG] Loop run started
Exception in thread Thread-3:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "toogoodtogo_ha_mqtt_bridge/main.py", line 281, in loop
if not is_latest_version():
File "toogoodtogo_ha_mqtt_bridge/main.py", line 161, in is_latest_version
token_version = version.parse(tokens["token_version"])
KeyError: 'token_version'
^CException ignored in: <module 'threading' from '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py'>
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 1273, in _shutdown
t.join()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 1032, in join
self._wait_for_tstate_lock()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 1048, in _wait_for_tstate_lock
elif lock.acquire(block, timeout):
KeyboardInterrupt @Dielee might genereate a quick fix for this? :) |
I will have a look! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Like the release notes shows, I tried reinstalling the addon ( already 5 times) but it doesn't solve the error.
The text was updated successfully, but these errors were encountered: