correcao dos scripts para coletar os tokens e enviar as leituras
This commit is contained in:
+5
-23
@@ -7,29 +7,11 @@ with open("dispositivosdata.json", "r") as f:
|
||||
data=json.load(f);
|
||||
|
||||
for item in data:
|
||||
loops1 = randint(1,9)
|
||||
loops1 = randint(1,300);
|
||||
for i in range(loops1):
|
||||
temperatura = randint(10,40)
|
||||
umidade = randint(9,85)
|
||||
myURL = "http://nexuswebdigital.com:9999/feed/{}?temperatura={}&umidade={}".format(item[0]["chave"], temperatura, umidade)
|
||||
temperatura = randint(10,40);
|
||||
umidade = randint(9,85);
|
||||
myURL = "http://nexuswebdigital.com:9999/feed/{}?temperatura={}&umidade={}".format(item["chave"], temperatura, umidade);
|
||||
response = requests.post(url=myURL);
|
||||
print(response.text);
|
||||
time.sleep(0.1);
|
||||
|
||||
loops2 = randint(1,9)
|
||||
for i in range(loops2):
|
||||
temperatura = randint(10,40)
|
||||
umidade = randint(9,85)
|
||||
myURL = "http://nexuswebdigital.com:9999/feed/{}?temperatura={}&umidade={}".format(item[1]["chave"], temperatura, umidade)
|
||||
response = requests.post(url=myURL);
|
||||
print(response.text);
|
||||
time.sleep(0.1);
|
||||
|
||||
loops3 = randint(1,9)
|
||||
for i in range(loops3):
|
||||
temperatura = randint(10,40)
|
||||
umidade = randint(9,85)
|
||||
myURL = "http://nexuswebdigital.com:9999/feed/{}?temperatura={}&umidade={}".format(item[2]["chave"], temperatura, umidade)
|
||||
response = requests.post(url=myURL);
|
||||
print(response.text);
|
||||
time.sleep(0.1);
|
||||
time.sleep(0.05);
|
||||
|
||||
Reference in New Issue
Block a user