* added tx20 wind speed sensor * added test * fixed lint errors * fixed more lint errors * updated tx20 * updated tx20 sensor * updated to new structure and removed static variables * removed content from __init__.py * fixing lint errors * resolved issues from review * added as3935 sensor * updated as3935 with more settings * update * support for i2c + spi updated * added tests and various fixes * added tx20 wind speed sensor * fixed lint errors * fixed more lint errors * updated tx20 * updated tx20 sensor * updated to new structure and removed static variables * removed content from __init__.py * fixing lint errors * resolved issues from review * added as3935 sensor * updated as3935 with more settings * update * support for i2c + spi updated * added tests and various fixes * updated tests * fixed style issues * Remove debug line * Update log levels * Reformat * Auto-convert to int Co-authored-by: Thomas <thomas.eckerstorfer@mic-cust.com> Co-authored-by: Otto Winter <otto@otto-winter.com>
17 lines
488 B
Python
17 lines
488 B
Python
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_base']
|
|
|
|
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))
|