1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00: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,17 +3,23 @@ import esphome.config_validation as cv
from esphome import pins
from esphome.const import CONF_ENABLE_TIME, CONF_ID, CONF_KEEP_ON_TIME, CONF_PIN
CODEOWNERS = ['@esphome/core']
power_supply_ns = cg.esphome_ns.namespace('power_supply')
PowerSupply = power_supply_ns.class_('PowerSupply', cg.Component)
CODEOWNERS = ["@esphome/core"]
power_supply_ns = cg.esphome_ns.namespace("power_supply")
PowerSupply = power_supply_ns.class_("PowerSupply", cg.Component)
MULTI_CONF = True
CONFIG_SCHEMA = cv.Schema({
cv.Required(CONF_ID): cv.declare_id(PowerSupply),
cv.Required(CONF_PIN): pins.gpio_output_pin_schema,
cv.Optional(CONF_ENABLE_TIME, default='20ms'): cv.positive_time_period_milliseconds,
cv.Optional(CONF_KEEP_ON_TIME, default='10s'): cv.positive_time_period_milliseconds,
}).extend(cv.COMPONENT_SCHEMA)
CONFIG_SCHEMA = cv.Schema(
{
cv.Required(CONF_ID): cv.declare_id(PowerSupply),
cv.Required(CONF_PIN): pins.gpio_output_pin_schema,
cv.Optional(
CONF_ENABLE_TIME, default="20ms"
): cv.positive_time_period_milliseconds,
cv.Optional(
CONF_KEEP_ON_TIME, default="10s"
): cv.positive_time_period_milliseconds,
}
).extend(cv.COMPONENT_SCHEMA)
def to_code(config):
@@ -25,4 +31,4 @@ def to_code(config):
cg.add(var.set_enable_time(config[CONF_ENABLE_TIME]))
cg.add(var.set_keep_on_time(config[CONF_KEEP_ON_TIME]))
cg.add_define('USE_POWER_SUPPLY')
cg.add_define("USE_POWER_SUPPLY")