Created
July 13, 2015 20:50
-
-
Save calderonroberto/ecb9fcbeb3ef99b6af55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
import stsplatform.client as sts | |
SENSOR_NAME = 'mike.yvr-arrive' | |
def main(): | |
conf = { | |
"url":"http://wotkit.sensetecnic.com/api", | |
} | |
#create an stsplatform client with custom configuration | |
w = sts.Client(conf) | |
# Print a sensor hosted in the sts platform | |
s = sts.Sensors(w, SENSOR_NAME) | |
print "\n\nSensor %s has the current structure: \n" % SENSOR_NAME | |
print s.get().data | |
# Print some data (last event) that lives in this sensor according to: | |
# http://wotkit.readthedocs.org/en/latest/api_v1/api_sensor_data.html#raw-data-retrieval | |
d = sts.Data(s) | |
print "\n\nSensor %s's last data point is: \n" % SENSOR_NAME | |
print d.get({'beforeE':1}).data | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment