1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-05 21:02:20 +01:00

feat(packages): support removing components (#5821)

This commit is contained in:
Subhash Chandra
2023-12-06 06:34:17 +05:30
committed by GitHub
parent 89d7cdf86b
commit 8f70ef24a2
6 changed files with 240 additions and 5 deletions

View File

@@ -13,7 +13,7 @@ import voluptuous as vol
from esphome import core
import esphome.codegen as cg
from esphome.config_helpers import Extend
from esphome.config_helpers import Extend, Remove
from esphome.const import (
ALLOWED_NAME_CHARS,
CONF_AVAILABILITY,
@@ -532,6 +532,10 @@ def declare_id(type):
if isinstance(value, Extend):
raise Invalid(f"Source for extension of ID '{value.value}' was not found.")
if isinstance(value, Remove):
raise Invalid(f"Source for Removal of ID '{value.value}' was not found.")
return core.ID(validate_id_name(value), is_declaration=True, type=type)
return validator