Skip to content

Update uv_index to uvs #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)