本文整理匯總了Python中ATT_IOT.sendValueHTTP方法的典型用法代碼示例。如果您正苦於以下問題:Python ATT_IOT.sendValueHTTP方法的具體用法?Python ATT_IOT.sendValueHTTP怎麽用?Python ATT_IOT.sendValueHTTP使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ATT_IOT
的用法示例。
在下文中一共展示了ATT_IOT.sendValueHTTP方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: sendSamplepack
# 需要導入模塊: import ATT_IOT [as 別名]
# 或者: from ATT_IOT import sendValueHTTP [as 別名]
def sendSamplepack():
## send values to Sample sensor
## sample Arduino
IOT.DeviceId = "ucbSbmSsfTS3MpDOdP780pW"
IOT.connect()
val = random.uniform(29,31)
IOT.sendValueHTTP(val,0)
sleep(2)
val = randint(0,1)
if val== 0:
IOT.sendValueHTTP("False",1)
elif val == 1:
IOT.sendValueHTTP("True",1)
else:
pass
sleep(2)
示例2: sendpack
# 需要導入模塊: import ATT_IOT [as 別名]
# 或者: from ATT_IOT import sendValueHTTP [as 別名]
def sendpack():
###### sending vallues to created devices
results=[]
with open('devicess.txt') as inputfile:
results = list(csv.reader(inputfile))
str1 = ""
for line in results:
str1 = ''.join(line)
a = str1.split('\t')
name= a[0]
idd = 0
IOT.DeviceId = str(a[1])
print "This id deviceid:" + '\n'
print IOT.DeviceId
idd = int(a[3])
IOT.connect()
if a[2] == 'T':
val = random.uniform(float(a[4]),float(a[5]))
IOT.sendValueHTTP(val,idd)
#IOT.send(val,idd)
sleep(1)
elif a[2] == 'L':
val = randint(int(a[4]),int(a[5]))
IOT.sendValueHTTP(val,idd)
sleep(1)
elif a[2] == 'D':
val = randint(0,1)
if val== 0:
booll= "True"
else:
booll = "False"
IOT.sendValueHTTP(booll,idd)
sleep(1)
else :
print "Wromg entry"