commonsense-python-lib
SenseAPITest Namespace Reference

Variables

tuple f = open('credentials.txt', 'r')
 I M P O R T A N T #.
tuple creds = json.load(f)
list username = creds['username']
list password = creds['password']
tuple oauth_token_key = str(creds['oauth_token_key'])
tuple oauth_token_secret = str(creds['oauth_token_secret'])
tuple oauth_consumer_key = str(creds['oauth_consumer_key'])
tuple oauth_consumer_secret = str(creds['oauth_consumer_secret'])
 AUTHENTICATE_SESSIONID = True
 AUTHENTICATE_OAUTH = False
 TEST_GETSENSORS = False
 TEST_GETSENSORDATA = False
 TEST_POSTSENSORS = True
 TEST_POSTSENSORDATA = True
 TEST_CREATESERVICE = False
 TEST_CREATENOTIFICATION = False
 TEST_CREATETRIGGER = False
 TEST_OAUTHAUTHORIZATION = False
 TEST_OAUTHAUTHENTICATION = False
tuple api = senseapi.SenseAPI()
tuple password_md5 = senseapi.MD5Hash(password)
tuple parameters = api.SensorsGet_Parameters()
list sensor_id = response['sensor']
dictionary data = {'data':[{'value':10, 'date':1343055000},{'value':11, 'date':1343055001}]}
list service_id = response['service[id]']
list trigger_id = resp['trigger']
list notification_id = resp['notification']
string result = ''
dictionary token = {}

Detailed Description

Copyright (©) [2012] Sense Observation Systems B.V.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
 
http://www.apache.org/licenses/LICENSE-2.0
 
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Variable Documentation

tuple SenseAPITest::f = open('credentials.txt', 'r')

I M P O R T A N T #.

This test script will attempt to open a file to read credentials with which it will authenticate at CommonSense. Make sure this file is present!

 All Classes Namespaces Functions Variables