Skip to content

Commit d2c7e51

Browse files
authored
Update hub.py
Attempt to make victron integration compatible with pymodbus API 3.10.0 and greater "Change slave to device_id and slave= to device_id=. (#2600)" https://pymodbus.readthedocs.io/en/latest/source/api_changes.html
1 parent 9457f0d commit d2c7e51

File tree

1 file changed

+2
-2
lines changed
  • custom_components/victron

1 file changed

+2
-2
lines changed

custom_components/victron/hub.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ def disconnect(self):
8686
def write_register(self, unit, address, value):
8787
"""Write a register."""
8888
slave = int(unit) if unit else 1
89-
return self._client.write_register(address=address, value=value, slave=slave)
89+
return self._client.write_register(address=address, value=value, device_id=slave)
9090

9191
def read_holding_registers(self, unit, address, count):
9292
"""Read holding registers."""
9393
slave = int(unit) if unit else 1
9494
_LOGGER.info("Reading unit %s address %s count %s", unit, address, count)
9595
return self._client.read_holding_registers(
96-
address=address, count=count, slave=slave
96+
address=address, count=count, device_id=slave
9797
)
9898

9999
def calculate_register_count(self, registerInfoDict: OrderedDict):

0 commit comments

Comments
 (0)