From 18242b71d762486bddedcafaef9575de51d44da7 Mon Sep 17 00:00:00 2001 From: Oliver Kleinecke Date: Sun, 9 Feb 2025 18:38:36 +0100 Subject: [PATCH] Update __init__.py --- esphome/components/mcp4461/output/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/esphome/components/mcp4461/output/__init__.py b/esphome/components/mcp4461/output/__init__.py index e535037157..49ff806f0f 100644 --- a/esphome/components/mcp4461/output/__init__.py +++ b/esphome/components/mcp4461/output/__init__.py @@ -46,9 +46,12 @@ async def to_code(config): parent, config[CONF_CHANNEL], ) - cg.add(parent.set_initial_terminal_state(config[CONF_CHANNEL], config[CONF_TERMINAL_A])) - cg.add(parent.set_initial_terminal_state(config[CONF_CHANNEL], config[CONF_TERMINAL_B])) - cg.add(parent.set_initial_terminal_state(config[CONF_CHANNEL], config[CONF_TERMINAL_W])) + if not config[CONF_TERMINAL_A]: + cg.add(parent.initialize_terminal_disabled(config[CONF_CHANNEL], 'a')) + if not config[CONF_TERMINAL_B]: + cg.add(parent.initialize_terminal_disabled(config[CONF_CHANNEL], 'b')) + if not config[CONF_TERMINAL_W]: + cg.add(parent.initialize_terminal_disabled(config[CONF_CHANNEL], 'w')) if CONF_INITIAL_VALUE in config: cg.add( parent.set_initial_value(config[CONF_CHANNEL], config[CONF_INITIAL_VALUE])