Compare commits

..
4 changed files with 24 additions and 19 deletions
+15 -1
View File
@@ -7,7 +7,13 @@ from esphome import pins
import esphome.codegen as cg
from esphome.components import uart
import esphome.config_validation as cv
from esphome.const import CONF_ADDRESS, CONF_CONTINUOUS, CONF_FLOW_CONTROL_PIN, CONF_ID
from esphome.const import (
CONF_ADDRESS,
CONF_CONTINUOUS,
CONF_DISABLE_CRC,
CONF_FLOW_CONTROL_PIN,
CONF_ID,
)
from esphome.cpp_generator import MockObj
from esphome.cpp_helpers import gpio_pin_expression
import esphome.final_validate as fv
@@ -159,6 +165,10 @@ CONFIG_SCHEMA = cv.typed_schema(
cv.Optional(
CONF_TURNAROUND_TIME, default="600ms"
): cv.positive_time_period_milliseconds,
# Remove before 2026.10.0
cv.Optional(CONF_DISABLE_CRC): cv.invalid(
"'disable_crc' has been removed. The parser no longer requires it — remove this option."
),
}
)
.extend(cv.COMPONENT_SCHEMA)
@@ -167,6 +177,10 @@ CONFIG_SCHEMA = cv.typed_schema(
{
cv.GenerateID(): cv.declare_id(ModbusServer),
cv.Optional(CONF_FLOW_CONTROL_PIN): pins.gpio_output_pin_schema,
# Remove before 2026.10.0
cv.Optional(CONF_DISABLE_CRC): cv.invalid(
"'disable_crc' has been removed. The parser no longer requires it — remove this option."
),
}
)
.extend(cv.COMPONENT_SCHEMA)
@@ -1,7 +1,5 @@
"""Speaker Media Player Setup."""
import logging
from esphome import automation
import esphome.codegen as cg
from esphome.components import (
@@ -33,9 +31,6 @@ from esphome.const import (
CONF_TASK_STACK_IN_PSRAM,
)
_LOGGER = logging.getLogger(__name__)
AUTO_LOAD = ["audio"]
DEPENDENCIES = ["network"]
@@ -44,7 +39,7 @@ DOMAIN = "media_player"
CONF_ANNOUNCEMENT = "announcement"
CONF_ANNOUNCEMENT_PIPELINE = "announcement_pipeline"
CONF_CODEC_SUPPORT_ENABLED = "codec_support_enabled" # Remove before 2026.10.0
CONF_CODEC_SUPPORT_ENABLED = "codec_support_enabled" # Remove before 2027.4.0
CONF_ENQUEUE = "enqueue"
CONF_MEDIA_FILE = "media_file"
CONF_MEDIA_PIPELINE = "media_pipeline"
@@ -103,15 +98,6 @@ def _validate_repeated_speaker(config):
def _final_validate(config):
# Remove before 2026.10.0
if CONF_CODEC_SUPPORT_ENABLED in config:
_LOGGER.warning(
"'%s' is deprecated and will be removed in 2026.10.0. "
"Codec support is now automatically determined from the pipeline "
"'format' setting. Set format to 'NONE' to enable all codecs.",
CONF_CODEC_SUPPORT_ENABLED,
)
# Request codecs based on pipeline formats. Codecs needed by local files are
# already requested during CONFIG_SCHEMA validation (via audio_files_schema).
media_player.request_codecs_for_format_configs(
@@ -151,8 +137,12 @@ CONFIG_SCHEMA = cv.All(
cv.Optional(CONF_BUFFER_SIZE, default=1000000): cv.int_range(
min=4000, max=4000000
),
# Remove before 2026.10.0
cv.Optional(CONF_CODEC_SUPPORT_ENABLED): cv.Any(cv.boolean, cv.string),
# Removed in 2026.10.0 - kept to provide helpful error message
cv.Optional(CONF_CODEC_SUPPORT_ENABLED): cv.invalid(
"The 'codec_support_enabled' option has been removed in ESPHome 2026.10.0.\n"
"Codec support is now determined from the pipeline 'format' setting.\n"
"Set 'format: NONE' on the pipeline to enable all codecs."
),
cv.Optional(CONF_FILES): audio_file.audio_files_schema(),
cv.Optional(CONF_TASK_STACK_IN_PSRAM): psram.validate_task_stack_in_psram,
cv.Optional(CONF_VOLUME_INCREMENT, default=0.05): cv.percentage,
+1
View File
@@ -352,6 +352,7 @@ CONF_DIRECTION = "direction"
CONF_DIRECTION_COMMAND_TOPIC = "direction_command_topic"
CONF_DIRECTION_OUTPUT = "direction_output"
CONF_DIRECTION_STATE_TOPIC = "direction_state_topic"
CONF_DISABLE_CRC = "disable_crc"
CONF_DISABLED = "disabled"
CONF_DISABLED_BY_DEFAULT = "disabled_by_default"
CONF_DISCONNECT_DELAY = "disconnect_delay"
+1 -1
View File
@@ -710,7 +710,7 @@ def lint_constants_usage():
# Maximum allowed CONF_ constants in esphome/const.py.
# This file is frozen — new constants go in esphome/components/const/__init__.py.
# Decrease this number when constants are moved out of const.py.
CONST_PY_MAX_CONF = 1016
CONST_PY_MAX_CONF = 1017
@lint_content_check(include=["esphome/const.py"])