From cd960815faed3ce2631da29ce2d9928feb7f7586 Mon Sep 17 00:00:00 2001 From: Michael Doppler <76885460+mdop@users.noreply.github.com> Date: Sun, 7 Jul 2024 13:29:13 +0200 Subject: [PATCH] streamline sensor/__init__.py Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- esphome/components/mcp3428/sensor/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/esphome/components/mcp3428/sensor/__init__.py b/esphome/components/mcp3428/sensor/__init__.py index f61f97f1ba..41447cd62b 100644 --- a/esphome/components/mcp3428/sensor/__init__.py +++ b/esphome/components/mcp3428/sensor/__init__.py @@ -65,8 +65,7 @@ CONFIG_SCHEMA = ( async def to_code(config): - var = cg.new_Pvariable(config[CONF_ID]) - await sensor.register_sensor(var, config) + var = await sensor.new_sensor(config) await cg.register_component(var, config) await cg.register_parented(var, config[CONF_MCP3428_ID])