What's Changed in 1.3.2
Bug Fixes & Reliability
- Prompt MQTT write handling & startup staggering (#88): Fixed initial register reads to actually stagger by 100 ms (
0.1 * (i + 1)) instead of 1 s, and updated the main loop to wait
directly on the incoming MQTT message queue so queued write requests are processed immediately rather than one per 0.5 s loop quantum. - Monotonic clock for scheduling and timeouts (#84): Switched the register polling scheduler and
OptolinkVS2Protocol.receive_fullraw()from wall-clock time (time.time) to
time.monotonic, preventing NTP/clock jumps from stalling polling or triggering read bursts. - VS2 protocol request & response validation (#85):
receive_telegram()now verifies that incoming response telegrams have aResponseMessageidentifier and match the requested register address (reportingMessageIdErroror
AddressMismatchin error statistics rather than returning stale/mismatched data).read_datapoint_ext(),write_datapoint_ext(), anddo_request()now validate addresses (0x0000–0xFFFF) and payload data lengths (0–250bytes) up front, returningInvalidRequest
instead of crashing or truncating addresses.
- MQTT client thread safety & per-instance counters (#83): Moved
MqttClientstatistics counters from class-level to per-instance attributes and guarded the Home Assistant discovery request
flag with a lock to avoid losingonlinenotifications between the paho network thread and main thread.
Configuration & Schema Improvements
- Multiple
byte_filterentries per register address (#87): A register address can now appear multiple times inregisters_poll_listto extract different bytes of the same register,
provided every entry for that address specifies abyte_filter. - Tighter configuration schema validation (#87):
mqtt.broker.portis now optional (defaults to1883) and validated within1–65535.mqtt.qosis constrained to0–2, and registerlengthto1–250.enummappings now require integer keys and string labels (map(str(), key=int())), catching misconfigurations like quoted integer keys ("0": "Off") or unquoted YAML booleans (On) at
startup.
Upgrade Notes
- Because config schema validation is stricter in
1.3.2, invalidenumdefinitions (such as quoted numeric keys or unquotedOn/Offlabels) or out-of-rangeport,qos, or register
lengthvalues that previously loaded silently will now be rejected on startup.