Http Data sources |
import httplib
import time
def data(device_ID,device_point,value):
conn = httplib.HTTPConnection("localhost",8080)
data="/httpds?__device"+'='+str(device_ID)+'&'+str(device_point)+'='+str(value)
conn.request("GET", data)
for i in range(100):
data('Home','current',float(i)/100)
data('Home','voltage',230)
data('Home','temp',32)
data('Home','KW',(i*230*0.8/1000))
#print i
time.sleep(3)
No comments:
Post a Comment