1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-21 20:52:20 +01:00

Let esphomeyaml know about class inheritance (#229)

* Allow overriding setup priority

* Add inheritance tree

* Global variables

* Tests and better validation

* Fix

* Lint
This commit is contained in:
Otto Winter
2018-11-12 23:30:31 +01:00
committed by GitHub
parent 4f375757a5
commit 15331edb78
128 changed files with 1572 additions and 989 deletions

View File

@@ -7,8 +7,8 @@ import esphomeyaml.config_validation as cv
from esphomeyaml.const import CONF_ARGS, CONF_BAUD_RATE, CONF_FORMAT, CONF_ID, CONF_LEVEL, \
CONF_LOGS, CONF_TAG, CONF_TX_BUFFER_SIZE
from esphomeyaml.core import ESPHomeYAMLError, Lambda
from esphomeyaml.helpers import App, Pvariable, TemplateArguments, add, esphomelib_ns, global_ns, \
process_lambda, RawExpression, statement
from esphomeyaml.helpers import App, Pvariable, RawExpression, TemplateArguments, add, \
esphomelib_ns, global_ns, process_lambda, statement, Component
LOG_LEVELS = {
'NONE': global_ns.ESPHOMELIB_LOG_LEVEL_NONE,
@@ -44,7 +44,7 @@ def validate_local_no_higher_than_global(value):
return value
LogComponent = esphomelib_ns.LogComponent
LogComponent = esphomelib_ns.class_('LogComponent', Component)
CONFIG_SCHEMA = vol.All(vol.Schema({
cv.GenerateID(): cv.declare_variable_id(LogComponent),
@@ -79,6 +79,7 @@ def maybe_simple_message(schema):
if isinstance(value, dict):
return vol.Schema(schema)(value)
return vol.Schema(schema)({CONF_FORMAT: value})
return validator