Fix Custom Components No Name (#395)

* Fix Custom Components No Name

Fixes https://github.com/esphome/ESPHome-Core/issues/445

* Fix
This commit is contained in:
Otto Winter
2019-01-29 16:39:29 +01:00
committed by GitHub
parent e3f7e0d14a
commit 92e909568c
5 changed files with 28 additions and 19 deletions
+4 -3
View File
@@ -3,7 +3,7 @@ import voluptuous as vol
from esphomeyaml.components import output
import esphomeyaml.config_validation as cv
from esphomeyaml.const import CONF_ID, CONF_LAMBDA, CONF_OUTPUTS, CONF_TYPE
from esphomeyaml.cpp_generator import process_lambda, variable
from esphomeyaml.cpp_generator import process_lambda, variable, Pvariable
from esphomeyaml.cpp_types import std_vector
CustomBinaryOutputConstructor = output.output_ns.class_('CustomBinaryOutputConstructor')
@@ -61,8 +61,9 @@ def to_code(config):
rhs = klass(template_)
custom = variable(config[CONF_ID], rhs)
for i, sens in enumerate(config[CONF_OUTPUTS]):
output.register_output(custom.get_output(i), sens)
for i, conf in enumerate(config[CONF_OUTPUTS]):
var = Pvariable(conf[CONF_ID], custom.get_output(i))
output.register_output(var, conf)
BUILD_FLAGS = '-DUSE_CUSTOM_OUTPUT'