Match the calibration hint count to the hub method and note why copy keeps COMPONENT_SCHEMA

This commit is contained in:
J. Nick Koston
2026-10-19 13:07:30 -10:00
parent 2bab0c5306
commit fe3fb5fea2
2 changed files with 6 additions and 2 deletions
@@ -31,8 +31,11 @@ CONFIG_SCHEMA = {
}
def _press(action: str, *hints: str) -> str:
args = "".join(f", LOG_STR({cpp_string_escape(hint)})" for hint in hints)
def _press(action: str, hint: str | None = None, hint2: str | None = None) -> str:
"""press_calibration_button() logs at most two hint lines."""
args = "".join(
f", LOG_STR({cpp_string_escape(h)})" for h in (hint, hint2) if h is not None
)
return f"press_calibration_button(entity, &{ATM90E32Component}::{action}{args})"
@@ -16,6 +16,7 @@ CONFIG_SCHEMA = (
cv.Required(CONF_SOURCE_ID): cv.use_id(button.Button),
}
)
# Kept so configs with setup_priority still validate; the Apply button is not a Component
.extend(cv.COMPONENT_SCHEMA)
)