Skip to content

Commit eba437a

Browse files
authored
Merge pull request #8 from FoamyGuy/value_return_bool
return bool from value() & Fix typos
2 parents 7b93715 + 366cd94 commit eba437a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_pcf8575.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def write_pin(self, pin: int, val: bool) -> None:
8787
"""Set a single GPIO pin high/pulled-up or driven low
8888
8989
:param int pin: The pin number
90-
:param bool vale: The state to set
90+
:param bool val: The state to set
9191
"""
9292

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

107-
return (self.read_gpio() >> pin) & 0x1
107+
return bool((self.read_gpio() >> pin) & 0x1)
108108

109109

110110
"""
@@ -131,7 +131,7 @@ def __init__(self, pin_number: int, pcf: PCF8575) -> None:
131131
"""Specify the pin number of the PCF8575 0..15, and instance.
132132
133133
:param int pin_number: The pin number
134-
:param PCF8575 pfc: The associated PCF8575 instance
134+
:param PCF8575 pcf: The associated PCF8575 instance
135135
"""
136136

137137
self._pin = pin_number

0 commit comments

Comments
 (0)