mirror of
https://github.com/esphome/esphome.git
synced 2026-10-22 05:46:12 +00:00
Match the calibration hint count to the hub method and note why copy keeps COMPONENT_SCHEMA
This commit is contained in:
@@ -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)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user