Skip to content

Commit

Permalink
Fix error in first loop after token creation #55
Browse files Browse the repository at this point in the history
  • Loading branch information
Dielee authored and MaxWinterstein committed Jun 19, 2022
1 parent 42004da commit 59bb1d7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions toogoodtogo_ha_mqtt_bridge/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def is_latest_version():


def write_token_file():
global tokens
tgtg_tokens = {
"access_token": tgtg_client.access_token,
"access_token_lifetime": tgtg_client.access_token_lifetime,
Expand All @@ -179,6 +180,7 @@ def write_token_file():
"ua": tgtg_client.user_agent,
"token_version": tgtg_version,
}
tokens = tgtg_tokens

with open(settings.get("data_dir") + "/tokens.json", "w") as json_file:
json.dump(tgtg_tokens, json_file)
Expand Down

0 comments on commit 59bb1d7

Please sign in to comment.