mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-19 04:33:27 +02:00
cb9f36a153
* setting up non i2c ttp229 * add component * fixed const and multiconf * fixed issues with i2c address (it is fixed for this device renamed component and platform to ttp229_lsf => i2c device. There is another ttp229_bsf device that uses a proprietary bus protocol * max channels is 0 to 15 * folow up on code review * fixed Component ttf229_lsf
26 lines
699 B
Python
26 lines
699 B
Python
from esphome.components import binary_sensor
|
|
import esphome.config_validation as cv
|
|
from esphome.const import CONF_ID
|
|
from esphome.cpp_generator import Pvariable
|
|
from esphome.cpp_helpers import setup_component
|
|
from esphome.cpp_types import App, Component
|
|
|
|
DEPENDENCIES = ['i2c']
|
|
|
|
CONF_TTP229_ID = 'ttp229_id'
|
|
TTP229LSFComponent = binary_sensor.binary_sensor_ns.class_('TTP229LSFComponent', Component)
|
|
|
|
CONFIG_SCHEMA = cv.Schema({
|
|
cv.GenerateID(): cv.declare_variable_id(TTP229LSFComponent),
|
|
}).extend(cv.COMPONENT_SCHEMA.schema)
|
|
|
|
|
|
def to_code(config):
|
|
rhs = App.make_ttp229_lsf()
|
|
var = Pvariable(config[CONF_ID], rhs)
|
|
|
|
setup_component(var, config)
|
|
|
|
|
|
BUILD_FLAGS = '-DUSE_TTP229_LSF'
|