Skip to content

Commit

Permalink
Merge pull request #8 from FoamyGuy/value_return_bool
Browse files Browse the repository at this point in the history
return bool from value() & Fix typos
  • Loading branch information
FoamyGuy authored Jan 2, 2025
2 parents 7b93715 + 366cd94 commit eba437a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions adafruit_pcf8575.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def write_pin(self, pin: int, val: bool) -> None:
"""Set a single GPIO pin high/pulled-up or driven low
:param int pin: The pin number
:param bool vale: The state to set
:param bool val: The state to set
"""

buff = self._writebuf[0] | (self._writebuf[1] << 8)
Expand All @@ -104,7 +104,7 @@ def read_pin(self, pin: int) -> bool:
:param int pin: The pin number
"""

return (self.read_gpio() >> pin) & 0x1
return bool((self.read_gpio() >> pin) & 0x1)


"""
Expand All @@ -131,7 +131,7 @@ def __init__(self, pin_number: int, pcf: PCF8575) -> None:
"""Specify the pin number of the PCF8575 0..15, and instance.
:param int pin_number: The pin number
:param PCF8575 pfc: The associated PCF8575 instance
:param PCF8575 pcf: The associated PCF8575 instance
"""

self._pin = pin_number
Expand Down

0 comments on commit eba437a

Please sign in to comment.