From d2c7e516a43cb6776254a7066159479ae686f121 Mon Sep 17 00:00:00 2001 From: jacauc Date: Thu, 28 Aug 2025 13:31:59 +0500 Subject: [PATCH] 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 --- custom_components/victron/hub.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/victron/hub.py b/custom_components/victron/hub.py index f2e2d13..38a367e 100644 --- a/custom_components/victron/hub.py +++ b/custom_components/victron/hub.py @@ -86,14 +86,14 @@ def disconnect(self): def write_register(self, unit, address, value): """Write a register.""" slave = int(unit) if unit else 1 - return self._client.write_register(address=address, value=value, slave=slave) + return self._client.write_register(address=address, value=value, device_id=slave) def read_holding_registers(self, unit, address, count): """Read holding registers.""" slave = int(unit) if unit else 1 _LOGGER.info("Reading unit %s address %s count %s", unit, address, count) return self._client.read_holding_registers( - address=address, count=count, slave=slave + address=address, count=count, device_id=slave ) def calculate_register_count(self, registerInfoDict: OrderedDict):