Mark esp32_touch supported only on standard esp32 variant (#4562)

* Mark esp32_touch supported only on standard esp32 variant

* Add back default
This commit is contained in:
Jesse Hills 2023-03-15 20:42:33 +13:00 committed by GitHub
parent d3f2b93c42
commit 215107e8ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@ from esphome.const import (
CONF_VOLTAGE_ATTENUATION,
)
from esphome.core import TimePeriod
from esphome.components import esp32
AUTO_LOAD = ["binary_sensor"]
DEPENDENCIES = ["esp32"]
@ -50,7 +51,8 @@ VOLTAGE_ATTENUATION = {
"0V": cg.global_ns.TOUCH_HVOLT_ATTEN_0V,
}
CONFIG_SCHEMA = cv.Schema(
CONFIG_SCHEMA = cv.All(
cv.Schema(
{
cv.GenerateID(): cv.declare_id(ESP32TouchComponent),
cv.Optional(CONF_SETUP_MODE, default=False): cv.boolean,
@ -73,7 +75,13 @@ CONFIG_SCHEMA = cv.Schema(
VOLTAGE_ATTENUATION
),
}
).extend(cv.COMPONENT_SCHEMA)
).extend(cv.COMPONENT_SCHEMA),
esp32.only_on_variant(
supported=[
esp32.const.VARIANT_ESP32,
]
),
)
async def to_code(config):