1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-06 20:03:46 +01:00

[config] Use `cv.UNDEFINED instead of adhoc _UNDEF` objects (#8725)

This commit is contained in:
Jesse Hills
2025-05-09 20:18:52 +12:00
committed by GitHub
parent e1732c4945
commit 8399d894c1
12 changed files with 82 additions and 102 deletions

View File

@@ -123,11 +123,8 @@ def microphone_source_schema(
)
_UNDEF = object()
def final_validate_microphone_source_schema(
component_name: str, sample_rate: int = _UNDEF
component_name: str, sample_rate: int = cv.UNDEFINED
):
"""Validates that the microphone source can provide audio in the correct format. In particular it validates the sample rate and the enabled channels.
@@ -141,7 +138,7 @@ def final_validate_microphone_source_schema(
"""
def _validate_audio_compatability(config):
if sample_rate is not _UNDEF:
if sample_rate is not cv.UNDEFINED:
# Issues require changing the microphone configuration
# - Verifies sample rates match
audio.final_validate_audio_schema(