@@ -161,13 +161,17 @@ def read(self):
161
161
162
162
return uvi
163
163
164
- def set_ack (self , new_ack = False ):
164
+ @property
165
+ def ack (self ):
165
166
"""
166
167
Turns on or off the ACKnowledge function of the sensor. The ACK function will send
167
168
a signal to the host when the value of the sensed UV light changes beyond the
168
- programmed threshold. Use ``[veml6070].set_ack_threshold`` to change between the two
169
- available threshold settings.
169
+ programmed threshold.
170
170
"""
171
+ return self ._ack
172
+
173
+ @ack .setter
174
+ def ack (self , new_ack = False ):
171
175
if new_ack not in (True , False ):
172
176
raise ValueError ("ACK must be 'True' or 'False'." )
173
177
self ._ack = int (new_ack )
@@ -176,12 +180,17 @@ def set_ack(self, new_ack=False):
176
180
with self .i2c_cmd as i2c_cmd :
177
181
i2c_cmd .write (self .buf )
178
182
179
- def set_ack_threshold (self , new_ack_thd = 0 ):
183
+ @property
184
+ def ack_threshold (self ):
180
185
"""
181
- Sets the ACKnowledge Threshold, which alerts the host controller to value changes
186
+ The ACKnowledge Threshold, which alerts the host controller to value changes
182
187
greater than the threshold. Available settings are: ``0`` = 102 steps; ``1`` = 145 steps.
183
188
``0`` is the default setting.
184
189
"""
190
+ return self ._ack_thd
191
+
192
+ @ack_threshold .setter
193
+ def ack_threshold (self , new_ack_thd = 0 ):
185
194
if new_ack_thd not in (0 , 1 ):
186
195
raise ValueError ("ACK Threshold must be '0' or '1'." )
187
196
self ._ack_thd = int (new_ack_thd )
@@ -190,14 +199,18 @@ def set_ack_threshold(self, new_ack_thd=0):
190
199
with self .i2c_cmd as i2c_cmd :
191
200
i2c_cmd .write (self .buf )
192
201
193
-
194
- def set_integration_time (self , new_it ):
202
+ @ property
203
+ def integration_time (self ):
195
204
"""
196
- Sets the Integration Time of the sensor. This is the refresh interval of the
205
+ The Integration Time of the sensor, which is the refresh interval of the
197
206
sensor. The higher the refresh interval, the more accurate the reading is (at
198
207
the cost of less sampling). The available settings are: ``VEML6070_HALF_T``,
199
208
``VEML6070_1_T``, ``VEML6070_2_T``, ``VEML6070_4_T``.
200
209
"""
210
+ return self ._it
211
+
212
+ @integration_time .setter
213
+ def integration_time (self , new_it ):
201
214
if new_it not in _VEML6070_INTEGRATION_TIME :
202
215
raise ValueError ("Integration Time invalid. Valid values are: " ,
203
216
_VEML6070_INTEGRATION_TIME .keys ())
0 commit comments