[hub75] Remove deprecated scan_wiring name aliases (#17118)

This commit is contained in:
J. Nick Koston
2026-06-21 16:21:50 -05:00
committed by GitHub
parent 036768c399
commit 6c10fc1272

View File

@@ -1,4 +1,3 @@
import logging
from typing import Any from typing import Any
from esphome import automation, pins from esphome import automation, pins
@@ -27,8 +26,6 @@ from esphome.types import ConfigType
from . import boards, hub75_ns from . import boards, hub75_ns
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ["esp32"] DEPENDENCIES = ["esp32"]
CODEOWNERS = ["@stuartparmenter"] CODEOWNERS = ["@stuartparmenter"]
@@ -133,30 +130,11 @@ SCAN_WIRINGS = {
"SCAN_1_8_64PX_HIGH": Hub75ScanWiring.SCAN_1_8_64PX_HIGH, "SCAN_1_8_64PX_HIGH": Hub75ScanWiring.SCAN_1_8_64PX_HIGH,
} }
# Deprecated scan wiring names - mapped to new names
DEPRECATED_SCAN_WIRINGS = {
"FOUR_SCAN_16PX_HIGH": "SCAN_1_4_16PX_HIGH",
"FOUR_SCAN_32PX_HIGH": "SCAN_1_8_32PX_HIGH",
"FOUR_SCAN_64PX_HIGH": "SCAN_1_8_64PX_HIGH",
}
def _validate_scan_wiring(value): def _validate_scan_wiring(value):
"""Validate scan_wiring with deprecation warnings for old names.""" """Validate scan_wiring against the allowed names."""
value = cv.string(value).upper().replace(" ", "_") value = cv.string(value).upper().replace(" ", "_")
# Check if using deprecated name
# Remove deprecated names in 2026.7.0
if value in DEPRECATED_SCAN_WIRINGS:
new_name = DEPRECATED_SCAN_WIRINGS[value]
_LOGGER.warning(
"Scan wiring '%s' is deprecated and will be removed in ESPHome 2026.7.0. "
"Please use '%s' instead.",
value,
new_name,
)
value = new_name
# Validate against allowed values # Validate against allowed values
if value not in SCAN_WIRINGS: if value not in SCAN_WIRINGS:
raise cv.Invalid( raise cv.Invalid(