From 34df25da39df897db0707233f0a6d3dd89c71aab Mon Sep 17 00:00:00 2001 From: rradar <34582688+rradar@users.noreply.github.com> Date: Fri, 8 Jan 2021 03:12:55 +0000 Subject: [PATCH] Update __init__.py (#1454) :cherry: picked from esphome/esphome@32a4680 branch (fix-sn74hc595-optional-oe-pin) by @OttoWinter --- esphome/components/sn74hc595/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/esphome/components/sn74hc595/__init__.py b/esphome/components/sn74hc595/__init__.py index de80c38214..369fc41fac 100644 --- a/esphome/components/sn74hc595/__init__.py +++ b/esphome/components/sn74hc595/__init__.py @@ -34,8 +34,9 @@ def to_code(config): cg.add(var.set_clock_pin(clock_pin)) latch_pin = yield cg.gpio_pin_expression(config[CONF_LATCH_PIN]) cg.add(var.set_latch_pin(latch_pin)) - oe_pin = yield cg.gpio_pin_expression(config[CONF_OE_PIN]) - cg.add(var.set_oe_pin(oe_pin)) + if CONF_OE_PIN in config: + oe_pin = yield cg.gpio_pin_expression(config[CONF_OE_PIN]) + cg.add(var.set_oe_pin(oe_pin)) cg.add(var.set_sr_count(config[CONF_SR_COUNT]))