Skip to content

Commit

Permalink
fix: Order favorites by displayOrder (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmstumpff committed Jan 2, 2024
1 parent 9217677 commit df52ec3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hatch_rest_api/hatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ async def favorites(self, auth_token: str, mac: str):
)
)
response_json = await response.json()
return response_json["payload"]
favorites = response_json["payload"]
favorites.sort(key=lambda x: x.get("displayOrder", float('inf')))
return favorites

async def content(self, auth_token: str, product: str, content: list):
# content options are ["sound", "color", "windDown"]
Expand Down

0 comments on commit df52ec3

Please sign in to comment.