Skip to content

Commit 2feced9

Browse files
ModbusExceptions constant class
1 parent bbc909a commit 2feced9

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

custom_components/solaredge_modbus_multi/const.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@
2828
)
2929

3030

31+
class ModbusExceptions:
32+
"""An enumeration of the valid modbus exceptions."""
33+
34+
IllegalFunction = 0x01
35+
IllegalAddress = 0x02
36+
IllegalValue = 0x03
37+
SlaveFailure = 0x04
38+
Acknowledge = 0x05
39+
SlaveBusy = 0x06
40+
NegativeAcknowledge = 0x07
41+
MemoryParityError = 0x08
42+
GatewayPathUnavailable = 0x0A
43+
GatewayNoResponse = 0x0B
44+
45+
3146
class RetrySettings(IntEnum):
3247
"""Retry settings when opening a connection to the inverter fails."""
3348

custom_components/solaredge_modbus_multi/hub.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from pymodbus.constants import Endian
1616
from pymodbus.exceptions import ConnectionException, ModbusIOException
1717
from pymodbus.payload import BinaryPayloadDecoder
18-
from pymodbus.pdu import ExceptionResponse, ModbusExceptions
18+
from pymodbus.pdu import ExceptionResponse
1919
except ImportError:
2020
raise ImportError("pymodbus is not installed, or pymodbus version is not supported")
2121

@@ -28,6 +28,7 @@
2828
ConfDefaultStr,
2929
ConfName,
3030
ModbusDefaults,
31+
ModbusExceptions,
3132
RetrySettings,
3233
SolarEdgeTimeouts,
3334
SunSpecNotImpl,

0 commit comments

Comments
 (0)