Skip to content

Commit

Permalink
optional "name" in response["data"]["user"] (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolwi authored Sep 14, 2023
1 parent 32b06fc commit c6504ef
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 c6504ef

Please sign in to comment.