Skip to content

Commit 39f6ecd

Browse files
committed
Improve detection of data missing
This should happen after a reboot of the gateway
1 parent fa40d6d commit 39f6ecd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

plugwise/helper.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ def _get_locations(self) -> None:
205205
counter = 0
206206
loc = Munch()
207207
locations = self._domain_objects.findall("./location")
208+
if not locations:
209+
raise KeyError("No location data present!")
210+
208211
for location in locations:
209212
loc.loc_id = location.get("id")
210213
loc.name = location.find("name").text

plugwise/smile.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ async def async_update(self) -> dict[str, GwEntityData]:
137137
self._cooling_enabled = heat_cooler["binary_sensors"][
138138
"cooling_enabled"
139139
]
140-
else: # cover failed data-retrieval for P1
141-
_ = self.gw_entities[self.gateway_id]["location"]
142140
except KeyError as err:
143141
raise DataMissingError("No Plugwise actual data received") from err
144142

0 commit comments

Comments
 (0)