Fix raising vol.Invalid during mqtt config validation instead of ValueError (#103764)

This commit is contained in:
Jan Bouwhuis
2023-11-13 22:59:03 +01:00
committed by GitHub
parent feabbfc375
commit 7ca264e746

View File

@@ -256,7 +256,7 @@ def valid_humidity_state_configuration(config: ConfigType) -> ConfigType:
CONF_HUMIDITY_STATE_TOPIC in config CONF_HUMIDITY_STATE_TOPIC in config
and CONF_HUMIDITY_COMMAND_TOPIC not in config and CONF_HUMIDITY_COMMAND_TOPIC not in config
): ):
raise ValueError( raise vol.Invalid(
f"{CONF_HUMIDITY_STATE_TOPIC} cannot be used without" f"{CONF_HUMIDITY_STATE_TOPIC} cannot be used without"
f" {CONF_HUMIDITY_COMMAND_TOPIC}" f" {CONF_HUMIDITY_COMMAND_TOPIC}"
) )