2.0.0
Breaking changes
- The typed register helpers (
read_uint16,read_int16,read_uint32,
read_float32,read_string,write_uint16,write_float32) have been
removed from theModbusUnitprotocol and every backend. The connection
layer now exposes raw register/coil I/O plus the full Modbus function-code set
only; datatype encoding/decoding moves one layer up (see below). Replace
await unit.read_uint32(addr)with
decode_uint32(await unit.read_holding_registers(addr, 2)).
New
modbus_connection.decode/modbus_connection.encode— a pure,
backend-neutral register codec covering the SunSpec point-type set: int/uint
16·32·64, float32/64, strings, IPv4/IPv6/EUI-48, and weighted sums, in either
word order.modbus_connection.model— an optional device-modelling framework. Map a
device's registers and coils to typed Python attributes and read a whole device
(or one sub-system) in as few Modbus calls as possible:Component/ComponentGroupwith pooled, range-aware, cached block-read
planning.- Generic field factories:
gauge,integer,uint32/64,int32/64,
float32/64,string,raw_register,scaled_sum,enum/flags
(nativeIntEnum/IntFlagmapping, incl. signed codes), andcoil. modbus_connection.model.sunspec— SunSpec point types pre-wired with their
per-point "unimplemented" sentinels, plus address types and dynamic scale
factors (sunssf).- Holding (FC03) and input (FC04) register spaces, planned and read separately.
The backends, the in-memory mock, and the pytest plugin are otherwise unchanged.