1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-06 21:32:21 +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

@@ -4,15 +4,24 @@ from esphome import pins
from esphome.components import sensor
from esphome.const import CONF_ID, CONF_PIN, DEVICE_CLASS_EMPTY, UNIT_SECOND, ICON_TIMER
pulse_width_ns = cg.esphome_ns.namespace('pulse_width')
pulse_width_ns = cg.esphome_ns.namespace("pulse_width")
PulseWidthSensor = pulse_width_ns.class_('PulseWidthSensor', sensor.Sensor, cg.PollingComponent)
PulseWidthSensor = pulse_width_ns.class_(
"PulseWidthSensor", sensor.Sensor, cg.PollingComponent
)
CONFIG_SCHEMA = sensor.sensor_schema(UNIT_SECOND, ICON_TIMER, 3, DEVICE_CLASS_EMPTY).extend({
cv.GenerateID(): cv.declare_id(PulseWidthSensor),
cv.Required(CONF_PIN): cv.All(pins.internal_gpio_input_pin_schema,
pins.validate_has_interrupt),
}).extend(cv.polling_component_schema('60s'))
CONFIG_SCHEMA = (
sensor.sensor_schema(UNIT_SECOND, ICON_TIMER, 3, DEVICE_CLASS_EMPTY)
.extend(
{
cv.GenerateID(): cv.declare_id(PulseWidthSensor),
cv.Required(CONF_PIN): cv.All(
pins.internal_gpio_input_pin_schema, pins.validate_has_interrupt
),
}
)
.extend(cv.polling_component_schema("60s"))
)
def to_code(config):