diff --git a/mqtt_io/modules/gpio/pcf8574.py b/mqtt_io/modules/gpio/pcf8574.py index 96ef3df1..51870025 100644 --- a/mqtt_io/modules/gpio/pcf8574.py +++ b/mqtt_io/modules/gpio/pcf8574.py @@ -35,7 +35,7 @@ def setup_pin( pin_config: ConfigType, initial: Optional[str] = None, ) -> None: - if direction == PinDirection.INPUT and pullup is not None: + if direction == PinDirection.INPUT and self.pullup_map[pullup] is not None: self.io.port[pin] = self.pullup_map[pullup] initial = pin_config.get("initial") if initial is not None: diff --git a/mqtt_io/modules/gpio/pcf8575.py b/mqtt_io/modules/gpio/pcf8575.py index 988a46a1..d2d95720 100644 --- a/mqtt_io/modules/gpio/pcf8575.py +++ b/mqtt_io/modules/gpio/pcf8575.py @@ -35,7 +35,7 @@ def setup_pin( pin_config: ConfigType, initial: Optional[str] = None, ) -> None: - if direction == PinDirection.INPUT and pullup is not None: + if direction == PinDirection.INPUT and self.pullup_map[pullup] is not None: self.io.port[pin] = self.pullup_map[pullup] initial = pin_config.get("initial") if initial is not None: