Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SU GSP NCS API WTF
import os
import requests
import json
# Photoresistor - light levels
#results = requests.get('https://api.particle.io/v1/devices/53ff6e066678505543482367/analog_value?access_token=3766bed852ce344d768142fe1cb41d4416d58b5d')
# Sound sensor
#results = requests.get('https://api.particle.io/v1/devices/54ff66066678574935400667/analog_value?access_token=3766bed852ce344d768142fe1cb41d4416d58b5d')
# Tilt sensor
#results = requests.get('https://api.particle.io/v1/devices/54ff70066678574953520267/analog_value?access_token=3766bed852ce344d768142fe1cb41d4416d58b5d')
# Force sensor
results = requests.get('https://api.particle.io/v1/devices/54ff70066678574942581067/analog_value?access_token=3766bed852ce344d768142fe1cb41d4416d58b5d')
# Print the results... or you can make a decision about the value and post to Slack!
json = results.json()
print(json['result'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.