mirror of
https://github.com/esphome/esphome.git
synced 2024-11-29 12:55:46 +01:00
Define touchscreen support when in use. (#3296)
This commit is contained in:
parent
7f7175b184
commit
9de61fcf58
@ -4,6 +4,7 @@ import esphome.codegen as cg
|
|||||||
from esphome.components import display
|
from esphome.components import display
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
from esphome.const import CONF_ON_TOUCH
|
from esphome.const import CONF_ON_TOUCH
|
||||||
|
from esphome.core import coroutine_with_priority
|
||||||
|
|
||||||
CODEOWNERS = ["@jesserockz"]
|
CODEOWNERS = ["@jesserockz"]
|
||||||
DEPENDENCIES = ["display"]
|
DEPENDENCIES = ["display"]
|
||||||
@ -39,3 +40,9 @@ async def register_touchscreen(var, config):
|
|||||||
[(TouchPoint, "touch")],
|
[(TouchPoint, "touch")],
|
||||||
config[CONF_ON_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_SWITCH
|
||||||
#define USE_TEXT_SENSOR
|
#define USE_TEXT_SENSOR
|
||||||
#define USE_TIME
|
#define USE_TIME
|
||||||
|
#define USE_TOUCHSCREEN
|
||||||
#define USE_UART_DEBUGGER
|
#define USE_UART_DEBUGGER
|
||||||
#define USE_WIFI
|
#define USE_WIFI
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user