mirror of
https://github.com/esphome/esphome.git
synced 2025-09-14 09:12:19 +01:00
add-black (#1593)
* Add black Update pre commit Update pre commit add empty line * Format with black
This commit is contained in:
committed by
GitHub
parent
2b60b0f1fa
commit
69879920eb
@@ -5,23 +5,29 @@ from esphome.components import i2c
|
||||
from esphome.const import CONF_ON_TAG, CONF_TRIGGER_ID, CONF_RESET_PIN
|
||||
from esphome.core import coroutine
|
||||
|
||||
CODEOWNERS = ['@glmnet']
|
||||
AUTO_LOAD = ['binary_sensor']
|
||||
CODEOWNERS = ["@glmnet"]
|
||||
AUTO_LOAD = ["binary_sensor"]
|
||||
MULTI_CONF = True
|
||||
|
||||
CONF_RC522_ID = 'rc522_id'
|
||||
CONF_RC522_ID = "rc522_id"
|
||||
|
||||
rc522_ns = cg.esphome_ns.namespace('rc522')
|
||||
RC522 = rc522_ns.class_('RC522', cg.PollingComponent, i2c.I2CDevice)
|
||||
RC522Trigger = rc522_ns.class_('RC522Trigger', automation.Trigger.template(cg.std_string))
|
||||
rc522_ns = cg.esphome_ns.namespace("rc522")
|
||||
RC522 = rc522_ns.class_("RC522", cg.PollingComponent, i2c.I2CDevice)
|
||||
RC522Trigger = rc522_ns.class_(
|
||||
"RC522Trigger", automation.Trigger.template(cg.std_string)
|
||||
)
|
||||
|
||||
RC522_SCHEMA = cv.Schema({
|
||||
cv.GenerateID(): cv.declare_id(RC522),
|
||||
cv.Optional(CONF_RESET_PIN): pins.gpio_output_pin_schema,
|
||||
cv.Optional(CONF_ON_TAG): automation.validate_automation({
|
||||
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(RC522Trigger),
|
||||
}),
|
||||
}).extend(cv.polling_component_schema('1s'))
|
||||
RC522_SCHEMA = cv.Schema(
|
||||
{
|
||||
cv.GenerateID(): cv.declare_id(RC522),
|
||||
cv.Optional(CONF_RESET_PIN): pins.gpio_output_pin_schema,
|
||||
cv.Optional(CONF_ON_TAG): automation.validate_automation(
|
||||
{
|
||||
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(RC522Trigger),
|
||||
}
|
||||
),
|
||||
}
|
||||
).extend(cv.polling_component_schema("1s"))
|
||||
|
||||
|
||||
@coroutine
|
||||
@@ -35,4 +41,4 @@ def setup_rc522(var, config):
|
||||
for conf in config.get(CONF_ON_TAG, []):
|
||||
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID])
|
||||
cg.add(var.register_trigger(trigger))
|
||||
yield automation.build_automation(trigger, [(cg.std_string, 'x')], conf)
|
||||
yield automation.build_automation(trigger, [(cg.std_string, "x")], conf)
|
||||
|
Reference in New Issue
Block a user