Skip to content

Commit

Permalink
Fix for users with faulty token file caused by google-play-scraper
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxWinterstein committed Aug 20, 2022
1 parent 5ed959f commit a8da854
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion toogoodtogo_ha_mqtt_bridge/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,13 @@ def is_latest_version():

act_version = version.parse(app_info["version"])
token_version = version.parse(tokens["token_version"])
minor_diff = act_version.minor - token_version.minor

# Fix for users having already a tokens.json containt 'Varies with device'
# see https://github.com/MaxWinterstein/toogoodtogo-ha-mqtt-bridge/issues/87
if str(token_version) == "Varies with device":
minor_diff = 999
else:
minor_diff = act_version.minor - token_version.minor

if minor_diff > 2 or act_version.major > token_version.major:
global tgtg_version
Expand Down

0 comments on commit a8da854

Please sign in to comment.