Add additional custom lint checks (#790)

This commit is contained in:
Otto Winter
2019-10-23 14:43:27 +02:00
committed by GitHub
parent 3f0503c296
commit d63cd8b4cd
28 changed files with 209 additions and 118 deletions
@@ -5,7 +5,7 @@ from esphome.const import CONF_ID
from .. import SX1509Component, sx1509_ns, CONF_SX1509_ID
CONF_ROW = 'row'
CONF_COLUMN = 'col'
CONF_COL = 'col'
DEPENDENCIES = ['sx1509']
@@ -15,7 +15,7 @@ CONFIG_SCHEMA = binary_sensor.BINARY_SENSOR_SCHEMA.extend({
cv.GenerateID(): cv.declare_id(SX1509BinarySensor),
cv.GenerateID(CONF_SX1509_ID): cv.use_id(SX1509Component),
cv.Required(CONF_ROW): cv.int_range(min=0, max=4),
cv.Required(CONF_COLUMN): cv.int_range(min=0, max=4),
cv.Required(CONF_COL): cv.int_range(min=0, max=4),
})
@@ -23,6 +23,6 @@ def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
yield binary_sensor.register_binary_sensor(var, config)
hub = yield cg.get_variable(config[CONF_SX1509_ID])
cg.add(var.set_row_col(config[CONF_ROW], config[CONF_COLUMN]))
cg.add(var.set_row_col(config[CONF_ROW], config[CONF_COL]))
cg.add(hub.register_keypad_binary_sensor(var))