Skip to content

Commit 68d5176

Browse files
committed
Use .get() constructs as suggested
1 parent ecc68ea commit 68d5176

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugwise/helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ def _add_p1_smartmeter_info(self) -> None:
207207

208208
module_id = module_data["module_id"]
209209
if module_id in (
210-
self.gw_entities[self._home_loc_id]["module_id"],
211-
self.gw_entities[self._gateway_id]["module_id"],
210+
self.gw_entities[self._gateway_id].get("module_id"),
211+
self.gw_entities.get(self._home_loc_id, {}).get("module_id"),
212212
):
213213
return
214214

0 commit comments

Comments
 (0)