mirror of
https://github.com/esphome/esphome.git
synced 2025-10-30 06:33:51 +00:00
[ruff] Enable SIM rules and fix code simplification violations (#9872)
This commit is contained in:
@@ -204,13 +204,14 @@ def _validate_pipeline(config):
|
||||
|
||||
|
||||
def _validate_repeated_speaker(config):
|
||||
if (announcement_config := config.get(CONF_ANNOUNCEMENT_PIPELINE)) and (
|
||||
media_config := config.get(CONF_MEDIA_PIPELINE)
|
||||
if (
|
||||
(announcement_config := config.get(CONF_ANNOUNCEMENT_PIPELINE))
|
||||
and (media_config := config.get(CONF_MEDIA_PIPELINE))
|
||||
and announcement_config[CONF_SPEAKER] == media_config[CONF_SPEAKER]
|
||||
):
|
||||
if announcement_config[CONF_SPEAKER] == media_config[CONF_SPEAKER]:
|
||||
raise cv.Invalid(
|
||||
"The announcement and media pipelines cannot use the same speaker. Use the `mixer` speaker component to create two source speakers."
|
||||
)
|
||||
raise cv.Invalid(
|
||||
"The announcement and media pipelines cannot use the same speaker. Use the `mixer` speaker component to create two source speakers."
|
||||
)
|
||||
|
||||
return config
|
||||
|
||||
|
||||
Reference in New Issue
Block a user