Skip to content

Commit 5c31e41

Browse files
committed
Various updates
1 parent 75d0342 commit 5c31e41

File tree

4 files changed

+29
-13
lines changed

4 files changed

+29
-13
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"0466eae8520144c78afb29628384edeb": {
3+
"binary_sensors": {
4+
"plugwise_notification": false
5+
},
6+
"dev_class": "gateway",
7+
"firmware": "4.0.15",
8+
"hardware": "AME Smile 2.0 board",
9+
"location": "94c107dc6ac84ed98e9f68c0dd06bf71",
10+
"mac_address": "012345670001",
11+
"model": "Gateway",
12+
"model_id": "smile_thermo",
13+
"name": "Smile Anna",
14+
"notifications": {},
15+
"sensors": {
16+
"outdoor_temperature": 7.44
17+
},
18+
"vendor": "Plugwise"
19+
}
20+
}

plugwise/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def _appl_heater_central_info(
102102
if not module_data["contents"]:
103103
module_data = self._get_module_data(xml_1, locator_2, xml_3)
104104
if not module_data["contents"]:
105+
self._heater_id = NONE
105106
return (
106107
Munch()
107108
) # no module-data present means the device has been removed

plugwise/helper.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def _get_p1_smartmeter_info(self) -> None:
172172
module_data = self._get_module_data(self._home_location, locator)
173173
# No module-data present means the device has been removed
174174
if not module_data["contents"]: # pragma: no cover
175-
return Munch() # pragma: no cover
175+
return
176176

177177
appl.available = None
178178
appl.entity_id = self._gateway_id
@@ -220,15 +220,14 @@ def _appliance_info_finder(self, appl: Munch, appliance: etree.Element) -> Munch
220220
return self._appl_thermostat_info(appl, appliance)
221221
case "heater_central":
222222
# Collect heater_central entity info
223-
self._appl_heater_central_info(
223+
# 251016: the added guarding below also solves Core Issue #104433
224+
if not self._appl_heater_central_info(
224225
appl, appliance, False
225-
) # False means non-legacy entity
226+
): # False means non-legacy entity
227+
return Munch()
226228
self._dhw_allowed_modes = self._get_appl_actuator_modes(
227229
appliance, "domestic_hot_water_mode_control_functionality"
228230
)
229-
# Skip orphaned heater_central (Core Issue #104433)
230-
if appl.entity_id != self.heater_id:
231-
return Munch()
232231
return appl
233232
case _ as s if s.endswith("_plug"):
234233
# Collect info from plug-types (Plug, Aqara Smart Plug)

plugwise/legacy/helper.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,18 +219,14 @@ def _energy_entity_info_finder(self, appliance: etree, appl: Munch) -> Munch:
219219
Munch()
220220
) # no module-data present means the device has been removed
221221

222-
appl.zigbee_mac = module_data["zigbee_mac_address"]
223-
# Filter appliance without zigbee_mac, it's an orphaned device
224-
if appl.zigbee_mac is None and self.smile.type != "power":
225-
return None
226-
222+
appl.firmware = module_data["firmware_version"]
227223
appl.hardware = module_data["hardware_version"]
228224
appl.model = module_data["vendor_model"]
229-
appl.vendor_name = module_data["vendor_name"]
230225
if appl.hardware is not None:
231226
hw_version = appl.hardware.replace("-", "")
232227
appl.model = version_to_model(hw_version)
233-
appl.firmware = module_data["firmware_version"]
228+
appl.vendor_name = module_data["vendor_name"]
229+
appl.zigbee_mac = module_data["zigbee_mac_address"]
234230

235231
return appl
236232

0 commit comments

Comments
 (0)