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 Franck Nijhof
parent df3e49b24f
commit 8a152a68d8

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}"
) )