Skip to content

Commit 00fecb7

Browse files
committed
Use .get() constructs as suggested
1 parent 6c40d70 commit 00fecb7

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
@@ -194,8 +194,8 @@ def _add_p1_smartmeter_info(self) -> None:
194194

195195
module_id = module_data["module_id"]
196196
if module_id in (
197-
self.gw_entities[self._home_loc_id]["module_id"],
198-
self.gw_entities[self._gateway_id]["module_id"],
197+
self.gw_entities[self._gateway_id].get("module_id"),
198+
self.gw_entities.get(self._home_loc_id, {}).get("module_id"),
199199
):
200200
return
201201

0 commit comments

Comments
 (0)