Skip to content

Commit

Permalink
Merge pull request #1 from kattni/uv_index_fix
Browse files Browse the repository at this point in the history
Update uv_index to uvs
  • Loading branch information
kattni authored Dec 29, 2020
2 parents 582055a + ee52d64 commit c56b18c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Usage Example
ltr = adafruit_ltr390.LTR390(i2c)
while True:
print("UV Index:", ltr.uv_index, "\t\tAmbient Light:", ltr.light)
print("UV:", ltr.uvs, "\t\tAmbient Light:", ltr.light)
time.sleep(1.0)
Expand Down
4 changes: 2 additions & 2 deletions adafruit_ltr390.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ def _mode(self, value):

# something is wrong here; I had to add a sleep to the loop to get both to update correctly
@property
def uv_index(self):
"""The calculated UV Index"""
def uvs(self):
"""The calculated UV value"""
self._mode = UV
while not self.data_ready:
sleep(0.010)
Expand Down
2 changes: 1 addition & 1 deletion examples/ltr390_alert_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
while True:

if ltr.threshold_passed:
print("UV Index:", ltr.uv_index)
print("UV:", ltr.uvs)
print("threshold", THRESHOLD_VALUE, "passed!")
print("")
else:
Expand Down
2 changes: 1 addition & 1 deletion examples/ltr390_configuration_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
print("Measurement delay is", MeasurementDelay.string[ltr.measurement_delay])
print("")
while True:
print("UV Index:", ltr.uv_index, "\t\tAmbient Light:", ltr.light)
print("UV:", ltr.uvs, "\t\tAmbient Light:", ltr.light)

# for shorter measurement delays you may need to make this sleep shorter to see a change
time.sleep(1.0)
2 changes: 1 addition & 1 deletion examples/ltr390_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
ltr = adafruit_ltr390.LTR390(i2c)

while True:
print("UV Index:", ltr.uv_index, "\t\tAmbient Light:", ltr.light)
print("UV:", ltr.uvs, "\t\tAmbient Light:", ltr.light)
time.sleep(1.0)

0 comments on commit c56b18c

Please sign in to comment.