Skip to content

Commit

Permalink
remove extra spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
bakerkj committed Jul 31, 2023
1 parent d0d34f8 commit e3d6978
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/user/purpleair.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def collect_data(session, hostname, port, timeout, api_key):
else:
r = session.get(url="http://%s:%s/json" % (hostname, port), timeout=timeout)
is_data_from_purpleair_website = False

# update data only when "last_seen/response_date" is not older than 10 minutes - makes sense for purpleair website only
valid_timeout = datetime.timedelta(minutes=10)

Expand Down Expand Up @@ -211,11 +211,11 @@ def get_and_update_missed(key):

if missed:
loginf("sensor didn't report field(s): %s" % ','.join(missed))

# when last seen field is older than 10 minutes do not return any particle data
if datetime.datetime.utcnow() - last_seen < valid_timeout:
# for each concentration counter grab the average of the A and B channels and push into the record

# NEWLY are values from PA website json with dot so it´s necessary to remap it
remap_dot = {'pm1_0_cf_1':'pm1.0_cf_1','pm1_0_atm':'pm1.0_atm','pm2_5_cf_1':'pm2.5_cf_1',\
'pm2_5_atm':'pm2.5_atm','pm10_0_cf_1':'pm10.0_cf_1','pm10_0_atm':'pm10.0_atm'}
Expand Down

0 comments on commit e3d6978

Please sign in to comment.