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:
@@ -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(
|
||||
|
Reference in New Issue
Block a user