Closed
Description
The implementation of the adafruit_pcf8575.PCF8575.read_pin()
is:
def read_pin(self, pin: int) -> bool:
return (self.read_gpio() >> pin) & 0x1
The result of the calculation is an int
. A bool
should be constructed from the result before being passed back to the caller. (Aside: Doesn't mypy
catch this?)
Consequently the adafruit_pcf8575.DigitalInOut.value
does not adhere to the digitalio.DigitalInOut
interface.
This also applies to the PCF8574 implementation.
Metadata
Metadata
Assignees
Labels
No labels