M8-R14: preserve zero DSMR sample interval
This commit is contained in:
@@ -98,8 +98,10 @@ def _validate_field_value(kind: str, field: SourceConfigField, value: Any) -> No
|
||||
_check_type(field, value)
|
||||
if field.name == "path" and not value.startswith("/dev/"):
|
||||
raise SourceProfileError("warmtelink_serial config path must start with '/dev/'.")
|
||||
if field.name in {"broker_port", "sample_interval_s", "baudrate"} and value <= 0:
|
||||
if field.name in {"broker_port", "baudrate"} and value <= 0:
|
||||
raise SourceProfileError(f"Config field {field.name!r} must be greater than zero.")
|
||||
if field.name == "sample_interval_s" and value < 0:
|
||||
raise SourceProfileError("Config field 'sample_interval_s' must not be negative.")
|
||||
if field.name == "data_bits" and value != 7:
|
||||
raise SourceProfileError("warmtelink_serial data_bits must be 7.")
|
||||
if field.name == "parity" and value != "N":
|
||||
|
||||
Reference in New Issue
Block a user