1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-20 10:43:48 +01:00

Cleanup AS3935

This commit is contained in:
Otto Winter
2019-10-12 17:03:01 +02:00
parent 68e7e5a51c
commit fa351cd37c
13 changed files with 165 additions and 135 deletions

View File

@@ -0,0 +1,16 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import binary_sensor
from . import AS3935, CONF_AS3935_ID
DEPENDENCIES = ['as3935']
CONFIG_SCHEMA = binary_sensor.BINARY_SENSOR_SCHEMA.extend({
cv.GenerateID(CONF_AS3935_ID): cv.use_id(AS3935),
})
def to_code(config):
hub = yield cg.get_variable(config[CONF_AS3935_ID])
var = yield binary_sensor.new_binary_sensor(config)
cg.add(hub.set_thunder_alert_binary_sensor(var))