Skip to content

Commit

Permalink
feat: rework auth flow - part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
chemelli74 committed Jul 12, 2024
1 parent 5ad87b5 commit 85b5ac3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions midealocal/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
},
}

default_keys = {
DEFAULT_KEYS = {
99: {
"token": "ee755a84a115703768bcc7c6c13d3d629aa416f1e2fd798beb9f78cbb1381d09"
"1cc245d7b063aad2a900e5b498fbd936c811f5d504b2e656d4f33b3bbc6d1da3",
Expand Down Expand Up @@ -182,6 +182,10 @@ async def login(self) -> bool:
"""Authenticate."""
raise NotImplementedError

async def get_default_keys(self) -> dict[int, dict[str, Any]]:
"""Get default cloud keys."""
return DEFAULT_KEYS

async def get_keys(self, appliance_id: int) -> dict[int, dict[str, Any]]:
"""Get keys for device."""
result = {}
Expand All @@ -206,8 +210,6 @@ async def get_keys(self, appliance_id: int) -> dict[int, dict[str, Any]]:
"token": token["token"].lower(),
"key": token["key"].lower(),
}
# add default key with method 1 and method 2 key
result.update(default_keys)
return result

@staticmethod
Expand Down

0 comments on commit 85b5ac3

Please sign in to comment.