1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

Bug/fix internal flag in binary sensor (#1136)

This commit is contained in:
Peter Kuehne
2020-07-14 16:59:03 +01:00
committed by GitHub
parent 1ccc6e342c
commit 5776e70d7c
4 changed files with 50 additions and 1 deletions

View File

@@ -131,6 +131,11 @@ def wrap_to_code(name, comp):
def write_cpp(config):
generate_cpp_contents(config)
return write_cpp_file()
def generate_cpp_contents(config):
_LOGGER.info("Generating C++ source...")
for name, component, conf in iter_components(CORE.config):
@@ -140,6 +145,8 @@ def write_cpp(config):
CORE.flush_tasks()
def write_cpp_file():
writer.write_platformio_project()
code_s = indent(CORE.cpp_main_section)

View File

@@ -224,7 +224,7 @@ BINARY_SENSOR_SCHEMA = cv.MQTT_COMPONENT_SCHEMA.extend({
def setup_binary_sensor_core_(var, config):
cg.add(var.set_name(config[CONF_NAME]))
if CONF_INTERNAL in config:
cg.add(var.set_internal(CONF_INTERNAL))
cg.add(var.set_internal(config[CONF_INTERNAL]))
if CONF_DEVICE_CLASS in config:
cg.add(var.set_device_class(config[CONF_DEVICE_CLASS]))
if CONF_INVERTED in config: