Skip to content

Commit

Permalink
fix: handle cu returning no devices
Browse files Browse the repository at this point in the history
  • Loading branch information
jafar-atili committed May 5, 2023
1 parent a224446 commit 46bbca0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pyswitchbee"
version = "1.7.24"
version = "1.7.25"
description = "SwitchBee Python Integration."
readme = "README.md"
authors = [{ name = "Jafar Atili", email = "[email protected]" }]
Expand Down
5 changes: 5 additions & 0 deletions src/switchbee/api/central_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,11 @@ async def fetch_states(
]
)

if not states:
logger.debug('get_multiple_states returned empty dict')
return


for device_state in states[ApiAttribute.DATA]:
device_id = device_state[ApiAttribute.ID]

Expand Down

0 comments on commit 46bbca0

Please sign in to comment.