From ebdf48e41f4c23b5537cd2f965fa7fef0a51df88 Mon Sep 17 00:00:00 2001 From: jan iversen Date: Mon, 21 Aug 2023 22:55:50 +0200 Subject: [PATCH] Correct modbus swap/datatype error message (#98698) --- homeassistant/components/modbus/validators.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/modbus/validators.py b/homeassistant/components/modbus/validators.py index 47ce518ec67..4f3f4a1c8a1 100644 --- a/homeassistant/components/modbus/validators.py +++ b/homeassistant/components/modbus/validators.py @@ -124,8 +124,7 @@ def struct_validator(config: dict[str, Any]) -> dict[str, Any]: if count < regs_needed or (count % regs_needed) != 0: raise vol.Invalid( f"Error in sensor {name} swap({swap_type}) " - "not possible due to the registers " - f"count: {count}, needed: {regs_needed}" + f"impossible because datatype({data_type}) is too small" ) structure = f">{DEFAULT_STRUCT_FORMAT[data_type].struct_id}" if slave_count > 1: