Correct modbus swap/datatype error message (#98698)

This commit is contained in:
jan iversen 2023-08-21 22:55:50 +02:00 committed by GitHub
parent 4a03f6482a
commit 92258b8e6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -124,8 +124,7 @@ def struct_validator(config: dict[str, Any]) -> dict[str, Any]:
if count < regs_needed or (count % regs_needed) != 0: if count < regs_needed or (count % regs_needed) != 0:
raise vol.Invalid( raise vol.Invalid(
f"Error in sensor {name} swap({swap_type}) " f"Error in sensor {name} swap({swap_type}) "
"not possible due to the registers " f"impossible because datatype({data_type}) is too small"
f"count: {count}, needed: {regs_needed}"
) )
structure = f">{DEFAULT_STRUCT_FORMAT[data_type].struct_id}" structure = f">{DEFAULT_STRUCT_FORMAT[data_type].struct_id}"
if slave_count > 1: if slave_count > 1: