Skip to content

Commit

Permalink
MMPPT id and idstr as properties
Browse files Browse the repository at this point in the history
  • Loading branch information
WillCodeForCats committed May 2, 2024
1 parent 9c8c439 commit 9391fd8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions custom_components/solaredge_modbus_multi/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -1413,8 +1413,6 @@ def __init__(
self.hub = hub
self.unit = unit
self.mmppt_key = f"mmppt_{self.unit}"
self.mmppt_id = self.inverter.decoded_model[self.mmppt_key]["ID"]
self.mmppt_idstr = self.inverter.decoded_model[self.mmppt_key]["IDStr"]

@property
def online(self) -> bool:
Expand All @@ -1433,6 +1431,14 @@ def device_info(self) -> DeviceInfo:
via_device=(DOMAIN, self.inverter.uid_base),
)

@property
def mmppt_id(self) -> str:
return self.inverter.decoded_model[self.mmppt_key]["ID"]

@property
def mmppt_idstr(self) -> str:
return self.inverter.decoded_model[self.mmppt_key]["IDStr"]


class SolarEdgeMeter:
"""Defines a SolarEdge meter."""
Expand Down

0 comments on commit 9391fd8

Please sign in to comment.