Skip to content

Commit

Permalink
Merge pull request #42 from akaplan07/avoid-current-device-level-exce…
Browse files Browse the repository at this point in the history
…ption

Avoid currentDeviceLevel exception
  • Loading branch information
lukas-clarke authored Aug 20, 2024
2 parents 5e4a52f + 1dcab0d commit 84a180c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/eight_sleep/pyEight/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ async def get_current_heating_level(self) -> int:
async def get_current_device_level(self) -> int:
url = APP_API_URL + f"v1/users/{self.user_id}/temperature"
resp = await self.device.api_request("GET", url)
return int(resp["currentDeviceLevel"])
return int(resp.get("currentDeviceLevel", 0))

async def prime_pod(self):
url = APP_API_URL + f"v1/devices/{self.device.device_id}/priming/tasks"
Expand Down

0 comments on commit 84a180c

Please sign in to comment.