1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-11 22:33:49 +01:00
* Add black

Update pre commit

Update pre commit

add empty line

* Format with black
This commit is contained in:
Guillermo Ruffino
2021-03-07 16:03:16 -03:00
committed by GitHub
parent 2b60b0f1fa
commit 69879920eb
398 changed files with 21624 additions and 12644 deletions

View File

@@ -3,18 +3,26 @@ import esphome.config_validation as cv
from esphome.components import i2c
from esphome.const import CONF_ID
DEPENDENCIES = ['i2c']
AUTO_LOAD = ['binary_sensor']
DEPENDENCIES = ["i2c"]
AUTO_LOAD = ["binary_sensor"]
CONF_TTP229_ID = 'ttp229_id'
ttp229_lsf_ns = cg.esphome_ns.namespace('ttp229_lsf')
CONF_TTP229_ID = "ttp229_id"
ttp229_lsf_ns = cg.esphome_ns.namespace("ttp229_lsf")
TTP229LSFComponent = ttp229_lsf_ns.class_('TTP229LSFComponent', cg.Component, i2c.I2CDevice)
TTP229LSFComponent = ttp229_lsf_ns.class_(
"TTP229LSFComponent", cg.Component, i2c.I2CDevice
)
MULTI_CONF = True
CONFIG_SCHEMA = cv.Schema({
cv.GenerateID(): cv.declare_id(TTP229LSFComponent),
}).extend(cv.COMPONENT_SCHEMA).extend(i2c.i2c_device_schema(0x57))
CONFIG_SCHEMA = (
cv.Schema(
{
cv.GenerateID(): cv.declare_id(TTP229LSFComponent),
}
)
.extend(cv.COMPONENT_SCHEMA)
.extend(i2c.i2c_device_schema(0x57))
)
def to_code(config):

View File

@@ -4,14 +4,16 @@ from esphome.components import binary_sensor
from esphome.const import CONF_CHANNEL, CONF_ID
from . import ttp229_lsf_ns, TTP229LSFComponent, CONF_TTP229_ID
DEPENDENCIES = ['ttp229_lsf']
TTP229Channel = ttp229_lsf_ns.class_('TTP229Channel', binary_sensor.BinarySensor)
DEPENDENCIES = ["ttp229_lsf"]
TTP229Channel = ttp229_lsf_ns.class_("TTP229Channel", binary_sensor.BinarySensor)
CONFIG_SCHEMA = binary_sensor.BINARY_SENSOR_SCHEMA.extend({
cv.GenerateID(): cv.declare_id(TTP229Channel),
cv.GenerateID(CONF_TTP229_ID): cv.use_id(TTP229LSFComponent),
cv.Required(CONF_CHANNEL): cv.int_range(min=0, max=15),
})
CONFIG_SCHEMA = binary_sensor.BINARY_SENSOR_SCHEMA.extend(
{
cv.GenerateID(): cv.declare_id(TTP229Channel),
cv.GenerateID(CONF_TTP229_ID): cv.use_id(TTP229LSFComponent),
cv.Required(CONF_CHANNEL): cv.int_range(min=0, max=15),
}
)
def to_code(config):