-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cae5705
commit 292ea66
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import esphome.codegen as cg | ||
import esphome.config_validation as cv | ||
from esphome.components import text_sensor | ||
from esphome.const import CONF_ID | ||
|
||
cst816s_touchscreen_ns = cg.esphome_ns.namespace('cst816s_touchscreen') | ||
CST816STouchScreen = cst816s_touchscreen_ns.class_('CST816STouchScreen', text_sensor.TextSensor, cg.Component) | ||
|
||
CONFIG_SCHEMA = text_sensor.TEXT_SENSOR_SCHEMA.extend({ | ||
cv.GenerateID(): cv.declare_id(CST816STouchScreen) | ||
}).extend(cv.COMPONENT_SCHEMA) | ||
|
||
|
||
def to_code(config): | ||
var = cg.new_Pvariable(config[CONF_ID]) | ||
yield text_sensor.register_text_sensor(var, config) | ||
yield cg.register_component(var, config) | ||
cg.add_library( | ||
name="CST816S", | ||
repository="https://github.com/GadgetFactory/CST816S.git", | ||
version="1.1.1", | ||
) |