mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 05:24:53 +01:00
Define touchscreen support when in use. (#3296)
This commit is contained in:
parent
7f7175b184
commit
9de61fcf58
2 changed files with 8 additions and 0 deletions
|
@ -4,6 +4,7 @@ import esphome.codegen as cg
|
|||
from esphome.components import display
|
||||
from esphome import automation
|
||||
from esphome.const import CONF_ON_TOUCH
|
||||
from esphome.core import coroutine_with_priority
|
||||
|
||||
CODEOWNERS = ["@jesserockz"]
|
||||
DEPENDENCIES = ["display"]
|
||||
|
@ -39,3 +40,9 @@ async def register_touchscreen(var, config):
|
|||
[(TouchPoint, "touch")],
|
||||
config[CONF_ON_TOUCH],
|
||||
)
|
||||
|
||||
|
||||
@coroutine_with_priority(100.0)
|
||||
async def to_code(config):
|
||||
cg.add_global(touchscreen_ns.using)
|
||||
cg.add_define("USE_TOUCHSCREEN")
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#define USE_SWITCH
|
||||
#define USE_TEXT_SENSOR
|
||||
#define USE_TIME
|
||||
#define USE_TOUCHSCREEN
|
||||
#define USE_UART_DEBUGGER
|
||||
#define USE_WIFI
|
||||
|
||||
|
|
Loading…
Reference in a new issue