diff --git a/homeassistant/components/mqtt/sensor.py b/homeassistant/components/mqtt/sensor.py index 3046c957978944957cca122eb43cbca7a38b52fd..17ea0ab1f5be3e65bb64f868c270bca4a99d23ab 100644 --- a/homeassistant/components/mqtt/sensor.py +++ b/homeassistant/components/mqtt/sensor.py @@ -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}'" ) diff --git a/tests/components/mqtt/test_sensor.py b/tests/components/mqtt/test_sensor.py index 555d1be5ed35789d968d4d03d8ccd8a768e832aa..7b63afbc60373a9a24b8b976d04c4126d1930524 100644 --- a/tests/components/mqtt/test_sensor.py +++ b/tests/components/mqtt/test_sensor.py @@ -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'", ), (