Skip to content

return bool from value() & Fix typos #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading