Skip to content

Commit

Permalink
Merge pull request #547 from WillCodeForCats/entity-naming
Browse files Browse the repository at this point in the history
Include inverter ID in meter and battery names
  • Loading branch information
WillCodeForCats authored Aug 23, 2024
2 parents a676f31 + 19adca0 commit edc15a4
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 @@ -1591,7 +1591,10 @@ async def init_device(self) -> None:
self.fw_version = self.decoded_common["C_Version"]
self.serial = self.decoded_common["C_SerialNumber"]
self.device_address = self.decoded_common["C_Device_address"]
self.name = f"{self.hub.hub_id.capitalize()} M{self.meter_id}"
self.name = (
f"{self.hub.hub_id.capitalize()} "
f"I{self.inverter_unit_id} M{self.meter_id}"
)

inverter_model = self.inverter_common["C_Model"]
inerter_serial = self.inverter_common["C_SerialNumber"]
Expand Down Expand Up @@ -1844,7 +1847,10 @@ async def init_device(self) -> None:
self.fw_version = self.decoded_common["B_Version"]
self.serial = self.decoded_common["B_SerialNumber"]
self.device_address = self.decoded_common["B_Device_Address"]
self.name = f"{self.hub.hub_id.capitalize()} B{self.battery_id}"
self.name = (
f"{self.hub.hub_id.capitalize()} "
f"I{self.inverter_unit_id} B{self.battery_id}"
)

inverter_model = self.inverter_common["C_Model"]
inerter_serial = self.inverter_common["C_SerialNumber"]
Expand Down

0 comments on commit edc15a4

Please sign in to comment.