Skip to content

Instantly share code, notes, and snippets.

@calderonroberto
Created July 13, 2015 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calderonroberto/ecb9fcbeb3ef99b6af55 to your computer and use it in GitHub Desktop.
Save calderonroberto/ecb9fcbeb3ef99b6af55 to your computer and use it in GitHub Desktop.
#!/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