mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Improve mqtt sensor options validion logging (#127631)
* Improve mqtt sensor options validion logging * Fix test
This commit is contained in:
parent
24fbc366a6
commit
e54031e318
@ -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'",
|
||||
),
|
||||
(
|
||||
|
Loading…
x
Reference in New Issue
Block a user