本文整理汇总了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"