Skip to content

Commit e38ca19

Browse files
committed
fixes to requested changes
1 parent b7fbce5 commit e38ca19

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

adafruit_veml6070.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ def __init__(self, i2c_bus, _veml6070_it="VEML6070_1_T", ack=False):
144144
i2c_cmd.write(self.buf)
145145

146146

147-
148147
@property
149148
def read(self):
150149
"""
@@ -171,8 +170,8 @@ def ack(self):
171170
return self._ack
172171

173172
@ack.setter
174-
def ack(self, new_ack=False):
175-
if new_ack not in (True, False):
173+
def ack(self, new_ack):
174+
if new_ack != bool(new_ack):
176175
raise ValueError("ACK must be 'True' or 'False'.")
177176
self._ack = int(new_ack)
178177
self.buf[0] = (self._ack << 5 | self._ack_thd << 4 |
@@ -190,7 +189,7 @@ def ack_threshold(self):
190189
return self._ack_thd
191190

192191
@ack_threshold.setter
193-
def ack_threshold(self, new_ack_thd=0):
192+
def ack_threshold(self, new_ack_thd):
194193
if new_ack_thd not in (0, 1):
195194
raise ValueError("ACK Threshold must be '0' or '1'.")
196195
self._ack_thd = int(new_ack_thd)

0 commit comments

Comments
 (0)