當前位置: 首頁>>代碼示例>>Python>>正文


Python ATT_IOT.createDevice方法代碼示例

本文整理匯總了Python中ATT_IOT.createDevice方法的典型用法代碼示例。如果您正苦於以下問題:Python ATT_IOT.createDevice方法的具體用法?Python ATT_IOT.createDevice怎麽用?Python ATT_IOT.createDevice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ATT_IOT的用法示例。


在下文中一共展示了ATT_IOT.createDevice方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setup

# 需要導入模塊: import ATT_IOT [as 別名]
# 或者: from ATT_IOT import createDevice [as 別名]
def setup(mylist):
    R=int(mylist[1])
    A=int(mylist[2])
    E=int(mylist[3])
    IOT.connect()
    
    for x in range(0, R):
        dtype = "RaspberryPi" + str(x)
        print("complete device name: "+dtype)
        devlist=IOT.createDevice(dtype, "lightSensor", True)
        with open('devicess.txt', 'a') as file_:
            file_.write(devlist[1] + " "+devlist [0] + '\n')

    for x in range(0, A):
        dtype = "Arduino" +str(x)
        devlist=IOT.createDevice(dtype, "lightSensor", True)
        with open('devicess.txt', 'a') as file_:
            file_.write(devlist[1] + " "+devlist [0] + '\n')

    for x in range(0, E):
        dtype = "IntelDevice"+str(x)
        devlist=IOT.createDevice(dtype, "lightSensor", True)
        with open('devicess.txt', 'a') as file_:
            file_.write(devlist[1] + " "+devlist [0] + '\n')
        IOT.deleteDevice()
開發者ID:samrudh,項目名稱:finalRound_teamOops_IndiaHacks,代碼行數:27,代碼來源:create_d_test.py

示例2: randint

# 需要導入模塊: import ATT_IOT [as 別名]
# 或者: from ATT_IOT import createDevice [as 別名]
    val = randint(0,1)
    if val== 0:
        IOT.sendValueHTTP("False",1)
    elif val == 1:
        IOT.sendValueHTTP("True",1)
    else:
        pass
    sleep(2)



for x in range(0, int(R0)):
    appstr = str(x)
    dtype = "SimulatedRPi" + appstr   
    idtype = "Rpi" + appstr         
    devlist=IOT.createDevice(dtype, "RaspberryPi Board", False)
    with open('devicess.txt', 'a') as file_:
        
        for y in range(0, int(R1[0])):
            sensName= "Temperature Sensor" + str(y)
            IOT.addAsset(y, sensName, "Temparaure sensor", False, "number", "Undefined")
            file_.write(devlist[1] + '\t'+devlist [0] + '\t'+'T'+'\t'+ str(y) +'\t'+str(R1[1])+'\t'+str(R1[2]) +'\n')
            
        for y in range(0, int(R2[0])):
            sensName= "Level Sensor" + str(y)
            k=(y + int(R1[0]))
            IOT.addAsset(k, sensName, "Level sensor", False, 'integer', 'Undefined')
            file_.write(devlist[1] + '\t'+devlist [0] + '\t'+'L'+'\t'+str(k )+ '\t'+str(R2[1])+'\t'+str(R2[2]) + '\n')
            
        for y in range(0, int(R3[0])):
            sensName= "Door Sensor" + str(y)
開發者ID:samrudh,項目名稱:finalRound_teamOops_IndiaHacks,代碼行數:33,代碼來源:main.py


注:本文中的ATT_IOT.createDevice方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。