@@ -105,7 +105,7 @@ class VEML6070:
105
105
106
106
# take 10 readings
107
107
for j in range(10):
108
- uv_raw = uv.read
108
+ uv_raw = uv.raw_uv
109
109
risk_level = uv.get_index(uv_raw)
110
110
print('Reading: ', uv_raw, ' | Risk Level: ', risk_level)
111
111
time.sleep(1)
@@ -145,18 +145,18 @@ def __init__(self, i2c_bus, _veml6070_it="VEML6070_1_T", ack=False):
145
145
146
146
147
147
@property
148
- def read (self ):
148
+ def raw_uv (self ):
149
149
"""
150
150
Reads and returns the value of the UV intensity.
151
151
"""
152
- read_buf = bytearray (2 )
152
+ uv_buf = bytearray (2 )
153
153
with self .i2c_low as i2c_low :
154
- i2c_low .readinto (read_buf , end = 1 )
154
+ i2c_low .readinto (uv_buf , end = 1 )
155
155
156
156
with self .i2c_high as i2c_high :
157
- i2c_high .readinto (read_buf , start = 1 )
157
+ i2c_high .readinto (uv_buf , start = 1 )
158
158
159
- uvi = read_buf [1 ] << 8 | read_buf [0 ]
159
+ uvi = uv_buf [1 ] << 8 | uv_buf [0 ]
160
160
161
161
return uvi
162
162
@@ -231,7 +231,7 @@ def sleep(self):
231
231
232
232
def wake (self ):
233
233
"""
234
- Wakes the VEML6070 from sleep. ``[veml6070].read `` will also wake from sleep.
234
+ Wakes the VEML6070 from sleep. ``[veml6070].raw_uv `` will also wake from sleep.
235
235
"""
236
236
self .buf [0 ] = (self ._ack << 5 | self ._ack_thd << 4 |
237
237
_VEML6070_INTEGRATION_TIME [self ._it ][0 ] << 2 | 0x02 )
@@ -241,7 +241,7 @@ def wake(self):
241
241
def get_index (self , _raw ):
242
242
"""
243
243
Calculates the UV Risk Level based on the captured UV reading. Requres the ``_raw``
244
- argument (from ``veml6070.read ``). Risk level is available for Integration Times (IT)
244
+ argument (from ``veml6070.raw_uv ``). Risk level is available for Integration Times (IT)
245
245
1, 2, & 4. The result is automatically scaled to the current IT setting.
246
246
247
247
LEVEL* UV Index
0 commit comments