Skip to content

Commit

Permalink
optional "name" in response["data"]["user"]
Browse files Browse the repository at this point in the history
  • Loading branch information
tolwi committed Sep 14, 2023
1 parent 32b06fc commit 067f82c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/ecoflow_cloud/mqtt/ecoflow_mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def authorize(self):
try:
self.token = response["data"]["token"]
self.user_id = response["data"]["user"]["userId"]
user_name = response["data"]["user"]["name"]
user_name = response["data"]["user"].get("name", "<no user name>")
except KeyError as key:
raise EcoflowException(f"Failed to extract key {key} from response: {response}")

Expand Down

0 comments on commit 067f82c

Please sign in to comment.