Skip to content

Commit e2ad185

Browse files
committed
Fix module_data
1 parent 91b6877 commit e2ad185

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

plugwise/helper.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ def _get_p1_smartmeter_info(self) -> None:
158158
appl.entity_id = self._home_loc_id
159159
if not self.smile.anna_p1:
160160
appl.entity_id = self._gateway_id
161-
appl.firmware = module_data["firmware_version"]
162-
appl.hardware = module_data["hardware_version"]
161+
appl.firmware = module_data.firmware_version
162+
appl.hardware = module_data.hardware_version
163163
appl.location = self._home_loc_id
164164
appl.mac = None
165-
appl.model = module_data["vendor_model"]
165+
appl.model = module_data.vendor_model
166166
appl.model_id = None # don't use model_id for SmartMeter
167167
appl.name = "P1"
168168
appl.pwclass = "smartmeter"
169-
appl.vendor_name = module_data["vendor_name"]
169+
appl.vendor_name = module_data.vendor_name
170170
appl.zigbee_mac = None
171171

172172
# Replace the entity_id of the gateway by the smartmeter location_id
@@ -232,17 +232,17 @@ def _appliance_info_finder(self, appliance: Appliance) -> Appliance | None:
232232
locator = MODULE_LOCATOR
233233
module_data = self._get_module_data(appliance, locator)
234234
# A plug without module-data is orphaned/ no present
235-
if not module_data["content"]:
235+
if not module_data.content:
236236
return None
237237

238238
print(f"HOI24 {module_data}")
239-
appliance.available = module_data["reachable"]
240-
appliance.firmware_version = module_data["firmware_version"]
241-
appliance.hardware_version = module_data["hardware_version"]
242-
appliance.model_id = module_data["vendor_model"]
243-
appliance.vendor_name = module_data["vendor_name"]
239+
appliance.available = module_data.reachable
240+
appliance.firmware_version = module_data.firmware_version
241+
appliance.hardware_version = module_data.hardware_version
242+
appliance.model_id = module_data.vendor_model
243+
appliance.vendor_name = module_data.vendor_name
244244
appliance.model = check_model(appl.model_id, appl.vendor_name)
245-
appliance.zigbee_mac_address = module_data["zigbee_mac_address"]
245+
appliance.zigbee_mac_address = module_data.zigbee_mac_address
246246
return appliance
247247
case _: # pragma: no cover
248248
return None

0 commit comments

Comments
 (0)