We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f59bfac commit 453a3c8Copy full SHA for 453a3c8
qwiic_relay.py
@@ -312,12 +312,12 @@ def get_relay_state(self, relayNum=None):
312
"""
313
314
if relayNum is None:
315
- return self._i2c.readByte(self.address, SINGLE_STATUS)
+ relayNum = 1
316
+
317
+ if self._i2c.readByte(self.address, STATUS_BASE + relayNum) is STATUS_OFF:
318
+ return False
319
else:
- if self._i2c.readByte(self.address, STATUS_BASE + relayNum) is STATUS_OFF:
- return False
- else:
320
- return True
+ return True
321
322
#----------------------------------------------------------------
323
# get_version()
0 commit comments