Solve missing automatic update of struct configuration in modbus (#54193)

This commit is contained in:
jan iversen 2021-08-08 06:11:56 +02:00 committed by GitHub
parent a001fd5000
commit 8a4674c086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,7 @@ def struct_validator(config):
_LOGGER.warning(error)
try:
data_type = OLD_DATA_TYPES[data_type][config.get(CONF_COUNT, 1)]
config[CONF_DATA_TYPE] = data_type
except KeyError as exp:
error = f"{name} cannot convert automatically {data_type}"
raise vol.Invalid(error) from exp