Skip to content

Commit f59bfac

Browse files
committed
Adjust whitespace in qwiic_relay.py
Lets have things line up, shall we?
1 parent 2e7e053 commit f59bfac

File tree

1 file changed

+22
-25
lines changed

1 file changed

+22
-25
lines changed

qwiic_relay.py

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@
6969
# Some devices have multiple available addresses - this is a list of these addresses.
7070
# NOTE: The first address in this list is considered the default I2C address for the
7171
# device.
72-
SINGLE_RELAY_DEFUALT_ADDR = 0x18
73-
SINGLE_RELAY_JUMPER_CLOSE_ADDR = 0x19
74-
QUAD_RELAY_DEFUALT_ADDR = 0x6D
75-
QUAD_RELAY_JUMPER_CLOSE_ADDR = 0x6C
72+
SINGLE_RELAY_DEFUALT_ADDR = 0x18
73+
SINGLE_RELAY_JUMPER_CLOSE_ADDR = 0x19
74+
QUAD_RELAY_DEFUALT_ADDR = 0x6D
75+
QUAD_RELAY_JUMPER_CLOSE_ADDR = 0x6C
7676
DUAL_SOLID_STATE_RELAY_DEFUALT_ADDR = 0x0A
7777
DUAL_SOLID_STATE_RELAY_JUMPER_CLOSE_ADDR = 0x0B
7878
QUAD_SOLID_STATE_RELAY_DEFUALT_ADDR = 0x08
@@ -89,26 +89,27 @@
8989
QUAD_SOLID_STATE_RELAY_JUMPER_CLOSE_ADDR]
9090

9191
# Define the register offsets of each relay
92-
RELAY_ONE = 1
93-
RELAY_TWO = 2
94-
RELAY_THREE = 3
95-
RELAY_FOUR = 4
96-
97-
#define register start positions
98-
DUAL_QUAD_TOGGLE_BASE = 0x00
99-
STATUS_BASE = 0x04
100-
DUAL_QUAD_PWM_BASE = 0x0F
101-
TURN_ALL_OFF = 0x0A
102-
TURN_ALL_ON = 0x0B
103-
TOGGLE_ALL = 0x0C
104-
105-
SINGLE_OFF = 0x00
106-
SINGLE_ON = 0x01
92+
RELAY_ONE = 1
93+
RELAY_TWO = 2
94+
RELAY_THREE = 3
95+
RELAY_FOUR = 4
96+
97+
# Define register start positions
98+
DUAL_QUAD_TOGGLE_BASE = 0x00
99+
STATUS_BASE = 0x04
100+
DUAL_QUAD_PWM_BASE = 0x0F
101+
TURN_ALL_OFF = 0x0A
102+
TURN_ALL_ON = 0x0B
103+
TOGGLE_ALL = 0x0C
104+
105+
# Special values for single relay
106+
SINGLE_OFF = 0x00
107+
SINGLE_ON = 0x01
107108
SINGLE_FIRMWARE_VERSION = 0x04
108-
SINGLE_STATUS = 0x05
109+
SINGLE_STATUS = 0x05
109110

110111
# Define the value of an "Off" relay
111-
STATUS_OFF = 0
112+
STATUS_OFF = 0
112113

113114
# define the class that encapsulates the device being created. All information associated with this
114115
# device is encapsulated by this class. The device class should be the only value exported
@@ -182,7 +183,6 @@ def begin(self):
182183

183184
return self.is_connected()
184185

185-
186186
#----------------------------------------------------------------
187187
# set_relay_on(relayNum)
188188
#
@@ -319,9 +319,6 @@ def get_relay_state(self, relayNum=None):
319319
else:
320320
return True
321321

322-
323-
324-
325322
#----------------------------------------------------------------
326323
# get_version()
327324
#

0 commit comments

Comments
 (0)