Skip to content

Commit

Permalink
hasattr()
Browse files Browse the repository at this point in the history
  • Loading branch information
ubahnverleih committed Oct 25, 2019
1 parent fc0ec01 commit 00948af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def uplink_callback(msg, client):
'lat': data.latitude,
'lng': data.longitude
}
if data.vbat:
if hasattr(data, 'vbat'):
update['battery_voltage'] = data.vbat
resp = requests.post(endpoint, headers=headers, data=update)
print(resp)
Expand Down

0 comments on commit 00948af

Please sign in to comment.