Skip to content

Commit 9391fd8

Browse files
MMPPT id and idstr as properties
1 parent 9c8c439 commit 9391fd8

File tree

1 file changed

+8
-2
lines changed
  • custom_components/solaredge_modbus_multi

1 file changed

+8
-2
lines changed

custom_components/solaredge_modbus_multi/hub.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -1413,8 +1413,6 @@ def __init__(
14131413
self.hub = hub
14141414
self.unit = unit
14151415
self.mmppt_key = f"mmppt_{self.unit}"
1416-
self.mmppt_id = self.inverter.decoded_model[self.mmppt_key]["ID"]
1417-
self.mmppt_idstr = self.inverter.decoded_model[self.mmppt_key]["IDStr"]
14181416

14191417
@property
14201418
def online(self) -> bool:
@@ -1433,6 +1431,14 @@ def device_info(self) -> DeviceInfo:
14331431
via_device=(DOMAIN, self.inverter.uid_base),
14341432
)
14351433

1434+
@property
1435+
def mmppt_id(self) -> str:
1436+
return self.inverter.decoded_model[self.mmppt_key]["ID"]
1437+
1438+
@property
1439+
def mmppt_idstr(self) -> str:
1440+
return self.inverter.decoded_model[self.mmppt_key]["IDStr"]
1441+
14361442

14371443
class SolarEdgeMeter:
14381444
"""Defines a SolarEdge meter."""

0 commit comments

Comments
 (0)