mirror of
https://github.com/esphome/esphome.git
synced 2024-11-21 11:37:27 +01:00
Added codeowners (#1487)
This commit is contained in:
parent
04d8593f38
commit
23cf120977
@ -45,6 +45,7 @@ esphome/components/json/* @OttoWinter
|
||||
esphome/components/ledc/* @OttoWinter
|
||||
esphome/components/light/* @esphome/core
|
||||
esphome/components/logger/* @esphome/core
|
||||
esphome/components/max7219digit/* @rspaargaren
|
||||
esphome/components/mcp23s08/* @SenexCrenshaw
|
||||
esphome/components/mcp23s17/* @SenexCrenshaw
|
||||
esphome/components/mcp2515/* @danielschramm @mvturnho
|
||||
|
@ -3,45 +3,61 @@ import esphome.config_validation as cv
|
||||
from esphome.components import display, spi
|
||||
from esphome.const import CONF_ID, CONF_INTENSITY, CONF_LAMBDA, CONF_NUM_CHIPS
|
||||
|
||||
DEPENDENCIES = ['spi']
|
||||
CODEOWNERS = ["@rspaargaren"]
|
||||
DEPENDENCIES = ["spi"]
|
||||
|
||||
CONF_ROTATE_CHIP = 'rotate_chip'
|
||||
CONF_SCROLL_SPEED = 'scroll_speed'
|
||||
CONF_SCROLL_DWELL = 'scroll_dwell'
|
||||
CONF_SCROLL_DELAY = 'scroll_delay'
|
||||
CONF_SCROLL_ENABLE = 'scroll_enable'
|
||||
CONF_SCROLL_MODE = 'scroll_mode'
|
||||
CONF_REVERSE_ENABLE = 'reverse_enable'
|
||||
CONF_ROTATE_CHIP = "rotate_chip"
|
||||
CONF_SCROLL_SPEED = "scroll_speed"
|
||||
CONF_SCROLL_DWELL = "scroll_dwell"
|
||||
CONF_SCROLL_DELAY = "scroll_delay"
|
||||
CONF_SCROLL_ENABLE = "scroll_enable"
|
||||
CONF_SCROLL_MODE = "scroll_mode"
|
||||
CONF_REVERSE_ENABLE = "reverse_enable"
|
||||
|
||||
SCROLL_MODES = {
|
||||
'CONTINUOUS': 0,
|
||||
'STOP': 1,
|
||||
"CONTINUOUS": 0,
|
||||
"STOP": 1,
|
||||
}
|
||||
|
||||
CHIP_MODES = {
|
||||
'0': 0,
|
||||
'90': 1,
|
||||
'180': 2,
|
||||
'270': 3,
|
||||
"0": 0,
|
||||
"90": 1,
|
||||
"180": 2,
|
||||
"270": 3,
|
||||
}
|
||||
|
||||
max7219_ns = cg.esphome_ns.namespace('max7219digit')
|
||||
MAX7219Component = max7219_ns.class_('MAX7219Component', cg.PollingComponent, spi.SPIDevice,
|
||||
display.DisplayBuffer)
|
||||
MAX7219ComponentRef = MAX7219Component.operator('ref')
|
||||
max7219_ns = cg.esphome_ns.namespace("max7219digit")
|
||||
MAX7219Component = max7219_ns.class_(
|
||||
"MAX7219Component", cg.PollingComponent, spi.SPIDevice, display.DisplayBuffer
|
||||
)
|
||||
MAX7219ComponentRef = MAX7219Component.operator("ref")
|
||||
|
||||
CONFIG_SCHEMA = display.BASIC_DISPLAY_SCHEMA.extend({
|
||||
cv.GenerateID(): cv.declare_id(MAX7219Component),
|
||||
cv.Optional(CONF_NUM_CHIPS, default=4): cv.int_range(min=1, max=255),
|
||||
cv.Optional(CONF_INTENSITY, default=15): cv.int_range(min=0, max=15),
|
||||
cv.Optional(CONF_ROTATE_CHIP, default='0'): cv.enum(CHIP_MODES, upper=True),
|
||||
cv.Optional(CONF_SCROLL_MODE, default='CONTINUOUS'): cv.enum(SCROLL_MODES, upper=True),
|
||||
cv.Optional(CONF_SCROLL_ENABLE, default=True): cv.boolean,
|
||||
cv.Optional(CONF_SCROLL_SPEED, default='250ms'): cv.positive_time_period_milliseconds,
|
||||
cv.Optional(CONF_SCROLL_DELAY, default='1000ms'): cv.positive_time_period_milliseconds,
|
||||
cv.Optional(CONF_SCROLL_DWELL, default='1000ms'): cv.positive_time_period_milliseconds,
|
||||
cv.Optional(CONF_REVERSE_ENABLE, default=False): cv.boolean,
|
||||
}).extend(cv.polling_component_schema('500ms')).extend(spi.spi_device_schema(cs_pin_required=True))
|
||||
CONFIG_SCHEMA = (
|
||||
display.BASIC_DISPLAY_SCHEMA.extend(
|
||||
{
|
||||
cv.GenerateID(): cv.declare_id(MAX7219Component),
|
||||
cv.Optional(CONF_NUM_CHIPS, default=4): cv.int_range(min=1, max=255),
|
||||
cv.Optional(CONF_INTENSITY, default=15): cv.int_range(min=0, max=15),
|
||||
cv.Optional(CONF_ROTATE_CHIP, default="0"): cv.enum(CHIP_MODES, upper=True),
|
||||
cv.Optional(CONF_SCROLL_MODE, default="CONTINUOUS"): cv.enum(
|
||||
SCROLL_MODES, upper=True
|
||||
),
|
||||
cv.Optional(CONF_SCROLL_ENABLE, default=True): cv.boolean,
|
||||
cv.Optional(
|
||||
CONF_SCROLL_SPEED, default="250ms"
|
||||
): cv.positive_time_period_milliseconds,
|
||||
cv.Optional(
|
||||
CONF_SCROLL_DELAY, default="1000ms"
|
||||
): cv.positive_time_period_milliseconds,
|
||||
cv.Optional(
|
||||
CONF_SCROLL_DWELL, default="1000ms"
|
||||
): cv.positive_time_period_milliseconds,
|
||||
cv.Optional(CONF_REVERSE_ENABLE, default=False): cv.boolean,
|
||||
}
|
||||
)
|
||||
.extend(cv.polling_component_schema("500ms"))
|
||||
.extend(spi.spi_device_schema(cs_pin_required=True))
|
||||
)
|
||||
|
||||
|
||||
def to_code(config):
|
||||
@ -61,6 +77,7 @@ def to_code(config):
|
||||
cg.add(var.set_reverse(config[CONF_REVERSE_ENABLE]))
|
||||
|
||||
if CONF_LAMBDA in config:
|
||||
lambda_ = yield cg.process_lambda(config[CONF_LAMBDA], [(MAX7219ComponentRef, 'it')],
|
||||
return_type=cg.void)
|
||||
lambda_ = yield cg.process_lambda(
|
||||
config[CONF_LAMBDA], [(MAX7219ComponentRef, "it")], return_type=cg.void
|
||||
)
|
||||
cg.add(var.set_writer(lambda_))
|
||||
|
Loading…
Reference in New Issue
Block a user