* 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
+19 -12
View File
@@ -1,21 +1,28 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import pins
from esphome.const import (CONF_CLOCK_PIN, CONF_DATA_PIN, CONF_ID,
CONF_NUM_CHANNELS, CONF_NUM_CHIPS)
from esphome.const import (
CONF_CLOCK_PIN,
CONF_DATA_PIN,
CONF_ID,
CONF_NUM_CHANNELS,
CONF_NUM_CHIPS,
)
AUTO_LOAD = ['output']
sm16716_ns = cg.esphome_ns.namespace('sm16716')
SM16716 = sm16716_ns.class_('SM16716', cg.Component)
AUTO_LOAD = ["output"]
sm16716_ns = cg.esphome_ns.namespace("sm16716")
SM16716 = sm16716_ns.class_("SM16716", cg.Component)
MULTI_CONF = True
CONFIG_SCHEMA = cv.Schema({
cv.GenerateID(): cv.declare_id(SM16716),
cv.Required(CONF_DATA_PIN): pins.gpio_output_pin_schema,
cv.Required(CONF_CLOCK_PIN): pins.gpio_output_pin_schema,
cv.Optional(CONF_NUM_CHANNELS, default=3): cv.int_range(min=3, max=255),
cv.Optional(CONF_NUM_CHIPS, default=1): cv.int_range(min=1, max=85),
}).extend(cv.COMPONENT_SCHEMA)
CONFIG_SCHEMA = cv.Schema(
{
cv.GenerateID(): cv.declare_id(SM16716),
cv.Required(CONF_DATA_PIN): pins.gpio_output_pin_schema,
cv.Required(CONF_CLOCK_PIN): pins.gpio_output_pin_schema,
cv.Optional(CONF_NUM_CHANNELS, default=3): cv.int_range(min=3, max=255),
cv.Optional(CONF_NUM_CHIPS, default=1): cv.int_range(min=1, max=85),
}
).extend(cv.COMPONENT_SCHEMA)
def to_code(config):
+10 -8
View File
@@ -4,16 +4,18 @@ from esphome.components import output
from esphome.const import CONF_CHANNEL, CONF_ID
from . import SM16716
DEPENDENCIES = ['sm16716']
DEPENDENCIES = ["sm16716"]
Channel = SM16716.class_('Channel', output.FloatOutput)
Channel = SM16716.class_("Channel", output.FloatOutput)
CONF_SM16716_ID = 'sm16716_id'
CONFIG_SCHEMA = output.FLOAT_OUTPUT_SCHEMA.extend({
cv.GenerateID(CONF_SM16716_ID): cv.use_id(SM16716),
cv.Required(CONF_ID): cv.declare_id(Channel),
cv.Required(CONF_CHANNEL): cv.int_range(min=0, max=65535),
}).extend(cv.COMPONENT_SCHEMA)
CONF_SM16716_ID = "sm16716_id"
CONFIG_SCHEMA = output.FLOAT_OUTPUT_SCHEMA.extend(
{
cv.GenerateID(CONF_SM16716_ID): cv.use_id(SM16716),
cv.Required(CONF_ID): cv.declare_id(Channel),
cv.Required(CONF_CHANNEL): cv.int_range(min=0, max=65535),
}
).extend(cv.COMPONENT_SCHEMA)
def to_code(config):