diff --git a/README.md b/README.md index f727317d..9e1633e2 100644 --- a/README.md +++ b/README.md @@ -38,9 +38,9 @@ After rebooting Home Assistant, this integration can be configured through the i [WillCodeForCats/solaredge-modbus-multi/wiki](https://github.com/WillCodeForCats/solaredge-modbus-multi/wiki) ### Required Versions -* Home Assistant 2025.2.0 or newer +* Home Assistant 2025.7.0 or newer * Python 3.11 or newer -* pymodbus 3.8.3 or newer +* pymodbus 4.0.0 or newer ## Specifications [WillCodeForCats/solaredge-modbus-multi/tree/main/doc](https://github.com/WillCodeForCats/solaredge-modbus-multi/tree/main/doc) diff --git a/custom_components/solaredge_modbus_multi/const.py b/custom_components/solaredge_modbus_multi/const.py index 194c92b0..1e366e97 100644 --- a/custom_components/solaredge_modbus_multi/const.py +++ b/custom_components/solaredge_modbus_multi/const.py @@ -10,7 +10,7 @@ DEFAULT_NAME = "SolarEdge" # raise a startup exception if pymodbus version is less than this -PYMODBUS_REQUIRED_VERSION = "3.8.3" +PYMODBUS_REQUIRED_VERSION = "4.0.0" # units missing in homeassistant core ENERGY_VOLT_AMPERE_HOUR: Final = "VAh" @@ -42,9 +42,9 @@ class ModbusExceptions: IllegalFunction = 0x01 IllegalAddress = 0x02 IllegalValue = 0x03 - SlaveFailure = 0x04 + DeviceFailure = 0x04 Acknowledge = 0x05 - SlaveBusy = 0x06 + DeviceBusy = 0x06 NegativeAcknowledge = 0x07 MemoryParityError = 0x08 GatewayPathUnavailable = 0x0A diff --git a/custom_components/solaredge_modbus_multi/hub.py b/custom_components/solaredge_modbus_multi/hub.py index b1abb706..18f966ad 100644 --- a/custom_components/solaredge_modbus_multi/hub.py +++ b/custom_components/solaredge_modbus_multi/hub.py @@ -526,7 +526,7 @@ async def modbus_read_holding_registers(self, unit, address, rcount): self._rr_count = rcount result = await self._client.read_holding_registers( - address=self._rr_address, count=self._rr_count, slave=self._rr_unit + address=self._rr_address, count=self._rr_count, device_id=self._rr_unit ) if result.isError(): @@ -578,7 +578,7 @@ async def write_registers(self, unit: int, address: int, payload) -> None: result = await self._client.write_registers( address=self._wr_address, values=self._wr_payload, - slave=self._wr_unit, + device_id=self._wr_unit, ) self.has_write = address diff --git a/custom_components/solaredge_modbus_multi/manifest.json b/custom_components/solaredge_modbus_multi/manifest.json index 050d1e5a..83a58fe0 100644 --- a/custom_components/solaredge_modbus_multi/manifest.json +++ b/custom_components/solaredge_modbus_multi/manifest.json @@ -9,6 +9,6 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/WillCodeForCats/solaredge-modbus-multi/issues", "loggers": ["custom_components.solaredge_modbus_multi"], - "requirements": ["pymodbus>=3.8.3"], + "requirements": ["pymodbus>=4.0.0"], "version": "3.1.4" } diff --git a/hacs.json b/hacs.json index 95a17fed..40fa45b5 100644 --- a/hacs.json +++ b/hacs.json @@ -1,5 +1,5 @@ { "name": "SolarEdge Modbus Multi", "content_in_root": false, - "homeassistant": "2025.2.0" + "homeassistant": "2025.7.0" } diff --git a/requirements.txt b/requirements.txt index d6716968..42305dee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -pymodbus>=3.8.3 +pymodbus>=4.0.0