From ebb5fadba1c463d4723fd103ce7c8b958b7f9d7c Mon Sep 17 00:00:00 2001 From: Anders Persson Date: Tue, 7 May 2019 21:39:13 +0200 Subject: [PATCH] Fix custom_sensor codegen (#526) --- esphome/components/custom/sensor/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/custom/sensor/__init__.py b/esphome/components/custom/sensor/__init__.py index 6503cc0c69..284c24e4f0 100644 --- a/esphome/components/custom/sensor/__init__.py +++ b/esphome/components/custom/sensor/__init__.py @@ -20,6 +20,6 @@ def to_code(config): rhs = CustomSensorConstructor(template_) var = cg.variable(config[CONF_ID], rhs) for i, conf in enumerate(config[CONF_SENSORS]): - sens = cg.new_Pvariable(conf[CONF_ID], var.get_switch(i)) + sens = cg.new_Pvariable(conf[CONF_ID], var.get_sensor(i)) cg.add(sens.set_name(conf[CONF_NAME])) yield sensor.register_sensor(sens, conf)