Skip to content

Commit 9e53b6e

Browse files
Merge pull request #62 from andrey-git/fix-if-no-result
Fix if no result in data
2 parents 6e6c54f + 7c62869 commit 9e53b6e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pysensibo/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ async def async_get_devices_data(self) -> SensiboData:
5555
"""Return dataclass with Sensibo Devices."""
5656
devices: list[dict[str, Any]] = []
5757
data = await self.async_get_devices()
58+
if "result" not in data:
59+
LOGGER.warning("No result in data from devices")
60+
LOGGER.debug("Data without result: %s", data)
61+
raise SensiboError("No result in data")
5862
for device in data["result"]:
5963
devices.append(device)
6064

0 commit comments

Comments
 (0)