Skip to content

Commit

Permalink
Update timing
Browse files Browse the repository at this point in the history
* 1200ms per inverter read
* Extra init read on devices during init
  • Loading branch information
WillCodeForCats committed Jul 16, 2023
1 parent 15aef45 commit 293727f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/solaredge_modbus_multi/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class StrEnum(str, Enum):
class SolarEdgeTimeouts(IntEnum):
"""Timeouts in milliseconds."""

Inverter = 5000
Inverter = 8400
Device = 1200


Expand Down
5 changes: 3 additions & 2 deletions custom_components/solaredge_modbus_multi/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,9 @@ def keep_modbus_open(self, value: bool) -> None:
def coordinator_timeout(self) -> int:
if not self.initalized:
this_timeout = SolarEdgeTimeouts.Inverter * self.number_of_inverters
this_timeout += SolarEdgeTimeouts.Device * 3 # max 3 per inverter
this_timeout += SolarEdgeTimeouts.Device * 2 # max 2 per inverter
this_timeout += SolarEdgeTimeouts.Device * self.number_of_inverters
this_timeout += (SolarEdgeTimeouts.Device * 2) * 3 # max 3 per inverter
this_timeout += (SolarEdgeTimeouts.Device * 2) * 2 # max 2 per inverter

else:
this_timeout = SolarEdgeTimeouts.Inverter * self.number_of_inverters
Expand Down

0 comments on commit 293727f

Please sign in to comment.