Fix custom components

This commit is contained in:
Otto Winter 2019-02-10 14:15:20 +01:00
parent 6a76a3642e
commit 6ccb68aaf1
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E
4 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,7 @@ def to_code(config):
for i, conf in enumerate(config[CONF_BINARY_SENSORS]): for i, conf in enumerate(config[CONF_BINARY_SENSORS]):
var = Pvariable(conf[CONF_ID], custom.get_binary_sensor(i)) var = Pvariable(conf[CONF_ID], custom.get_binary_sensor(i))
add(var.set_name(conf[CONF_NAME])) add(var.set_name(conf[CONF_NAME]))
binary_sensor.register_binary_sensor(var, conf) binary_sensor.setup_binary_sensor(var, conf)
BUILD_FLAGS = '-DUSE_CUSTOM_BINARY_SENSOR' BUILD_FLAGS = '-DUSE_CUSTOM_BINARY_SENSOR'

View File

@ -27,7 +27,7 @@ def to_code(config):
for i, conf in enumerate(config[CONF_SENSORS]): for i, conf in enumerate(config[CONF_SENSORS]):
var = Pvariable(conf[CONF_ID], custom.get_sensor(i)) var = Pvariable(conf[CONF_ID], custom.get_sensor(i))
add(var.set_name(conf[CONF_NAME])) add(var.set_name(conf[CONF_NAME]))
sensor.register_sensor(var, conf) sensor.setup_sensor(var, conf)
BUILD_FLAGS = '-DUSE_CUSTOM_SENSOR' BUILD_FLAGS = '-DUSE_CUSTOM_SENSOR'

View File

@ -28,7 +28,7 @@ def to_code(config):
for i, conf in enumerate(config[CONF_SWITCHES]): for i, conf in enumerate(config[CONF_SWITCHES]):
var = Pvariable(conf[CONF_ID], custom.get_switch(i)) var = Pvariable(conf[CONF_ID], custom.get_switch(i))
add(var.set_name(conf[CONF_NAME])) add(var.set_name(conf[CONF_NAME]))
switch.register_switch(var, conf) switch.setup_switch(var, conf)
BUILD_FLAGS = '-DUSE_CUSTOM_SWITCH' BUILD_FLAGS = '-DUSE_CUSTOM_SWITCH'

View File

@ -28,7 +28,7 @@ def to_code(config):
for i, conf in enumerate(config[CONF_TEXT_SENSORS]): for i, conf in enumerate(config[CONF_TEXT_SENSORS]):
var = Pvariable(conf[CONF_ID], custom.get_text_sensor(i)) var = Pvariable(conf[CONF_ID], custom.get_text_sensor(i))
add(var.set_name(conf[CONF_NAME])) add(var.set_name(conf[CONF_NAME]))
text_sensor.register_text_sensor(var, conf) text_sensor.setup_text_sensor(var, conf)
BUILD_FLAGS = '-DUSE_CUSTOM_TEXT_SENSOR' BUILD_FLAGS = '-DUSE_CUSTOM_TEXT_SENSOR'