[multiple] Fix misc cosmetic bugs (error messages, types, defaults) (#15499)

This commit is contained in:
Jonathan Swoboda
2026-04-07 01:41:57 +00:00
committed by GitHub
parent e428cb5092
commit e62c78ad46
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -390,7 +390,7 @@ def validate_multi_click_timing(value):
new_state = v_.get(CONF_STATE, not state)
if new_state == state:
raise cv.Invalid(
f"Timings must have alternating state. Indices {i} and {i + 1} have the same state {state}"
f"Timings must have alternating state. Indices {i - 1} and {i} have the same state {state}"
)
if max_length is not None and max_length < min_length:
raise cv.Invalid(
+1 -1
View File
@@ -36,7 +36,7 @@ CONFIG_SCHEMA = (
cv.Schema(
{
cv.GenerateID(): cv.declare_id(lc709203f),
cv.Optional(CONF_SIZE, default="500"): cv.int_range(100, 3000),
cv.Optional(CONF_SIZE, default=500): cv.int_range(100, 3000),
cv.Optional(CONF_VOLTAGE, default="3.7"): cv.enum(
BATTERY_VOLTAGE_OPTIONS, upper=True
),
@@ -405,7 +405,7 @@ def _model_config_to_manifest_data(model_config):
file = _compute_local_file_path(model_config) / "manifest.json"
else:
raise ValueError("Unsupported config type: {model_config[CONF_TYPE]}")
raise ValueError(f"Unsupported config type: {model_config[CONF_TYPE]}")
return _load_model_data(file)
+1 -1
View File
@@ -50,7 +50,7 @@ def validate_min_max_value(config):
max_val = config[CONF_MAX_VALUE]
if min_val >= max_val:
raise cv.Invalid(
f"Max value {max_val} must be smaller than min value {min_val}"
f"Max value {max_val} must be greater than min value {min_val}"
)
return config
+1 -1
View File
@@ -272,7 +272,7 @@ SPRINKLER_VALVE_SCHEMA = cv.Schema(
),
cv.Optional(
CONF_UNIT_OF_MEASUREMENT, default=UNIT_SECOND
): cv.one_of(UNIT_MINUTE, UNIT_SECOND, lower="True"),
): cv.one_of(UNIT_MINUTE, UNIT_SECOND, lower=True),
}
)
.extend(cv.COMPONENT_SCHEMA),
+1 -1
View File
@@ -127,7 +127,7 @@ def validate_st7789v(config):
if model_data[REQUIRE_PS] and CONF_POWER_SUPPLY not in config:
raise cv.Invalid(
f'{CONF_POWER_SUPPLY} must be specified when {CONF_MODEL} is {config[CONF_MODEL]}"'
f"{CONF_POWER_SUPPLY} must be specified when {CONF_MODEL} is {config[CONF_MODEL]}"
)
if (