mirror of
https://github.com/esphome/esphome.git
synced 2026-09-29 16:00:23 +00:00
[core] Hide build & framework internals from the visual editor (#17449)
This commit is contained in:
@@ -601,6 +601,40 @@ def test_network_wifi_ble_coexistence_reconciles_end_to_end(
|
||||
assert "CONFIG_ESP_WIFI_ENABLED" not in sdkconfig
|
||||
|
||||
|
||||
def test_esp32_build_internals_are_yaml_only() -> None:
|
||||
"""ESP32 raw framework / build inputs are ``YAML_ONLY``.
|
||||
|
||||
The framework block's PlatformIO package pins, raw ESP-IDF
|
||||
sdkconfig options, the low-level ``advanced`` block, extra IDF
|
||||
component sources, plus the partition table and toolchain override
|
||||
on the main schema are build internals — never UI form fields.
|
||||
User-facing choices (framework type/version, board, variant, …)
|
||||
stay on the main form.
|
||||
"""
|
||||
from esphome.components.esp32 import CONFIG_SCHEMA, FRAMEWORK_SCHEMA
|
||||
|
||||
fw_markers = {str(k): k for k in FRAMEWORK_SCHEMA.schema}
|
||||
for field in (
|
||||
"release",
|
||||
"source",
|
||||
"platform_version",
|
||||
"sdkconfig_options",
|
||||
"advanced",
|
||||
"components",
|
||||
):
|
||||
assert fw_markers[field].visibility is cv.Visibility.YAML_ONLY, field
|
||||
# Framework type/version remain user-facing.
|
||||
assert fw_markers["type"].visibility is None
|
||||
assert fw_markers["version"].visibility is None
|
||||
|
||||
main_markers = {str(k): k for k in CONFIG_SCHEMA.validators[0].schema}
|
||||
assert main_markers["partitions"].visibility is cv.Visibility.YAML_ONLY
|
||||
# toolchain is a real but rarely-touched override -> advanced disclosure.
|
||||
assert main_markers["toolchain"].visibility is cv.Visibility.ADVANCED
|
||||
assert main_markers["board"].visibility is None
|
||||
assert main_markers["flash_size"].visibility is None
|
||||
|
||||
|
||||
def test_downgrade_protection_passes_with_numeric_version_and_signing() -> None:
|
||||
assert _ota_downgrade_protection_errors("1.2.3", signed_ota_enabled=True) == []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user