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
parent 83f8e84247
commit 11567085d8
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A

View file

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