Skip to content
Snippets Groups Projects
Unverified Commit e54031e3 authored by Jan Bouwhuis's avatar Jan Bouwhuis Committed by GitHub
Browse files

Improve mqtt sensor options validion logging (#127631)

* Improve mqtt sensor options validion logging

* Fix test
parent 24fbc366
No related branches found
No related tags found
No related merge requests found
......@@ -100,7 +100,7 @@ def validate_sensor_state_and_device_class_config(config: ConfigType) -> ConfigT
if (device_class := config.get(CONF_DEVICE_CLASS)) != SensorDeviceClass.ENUM:
raise vol.Invalid(
f"The option `{CONF_OPTIONS}` can only be used "
f"The option `{CONF_OPTIONS}` must be used "
f"together with device class `{SensorDeviceClass.ENUM}`, "
f"got `{CONF_DEVICE_CLASS}` '{device_class}'"
)
......
......@@ -956,7 +956,7 @@ async def test_invalid_state_class(
}
}
},
"The option `options` can only be used together with "
"The option `options` must be used together with "
"device class `enum`, got `device_class` 'gas'",
),
(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment