Update __init__.py (#1454)

:cherry: picked from esphome/esphome@32a4680 branch (fix-sn74hc595-optional-oe-pin) by @OttoWinter
This commit is contained in:
rradar 2021-01-08 03:12:55 +00:00 committed by GitHub
parent 9586fb95d1
commit 34df25da39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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]))