homecontrol-dht: minor updates
This commit is contained in:
parent
dbdf3e0207
commit
7d213a4665
1 changed files with 3 additions and 3 deletions
6
main.py
6
main.py
|
@ -7,8 +7,8 @@ import ujson
|
||||||
import wifi
|
import wifi
|
||||||
|
|
||||||
CONFIG = "config.json"
|
CONFIG = "config.json"
|
||||||
ADDRESS="http://192.168.11.21:5000"
|
ADDRESS="http://192.168.11.11:5000"
|
||||||
TIMEOUT_UPDATE = 5
|
TIMEOUT_UPDATE = 600
|
||||||
|
|
||||||
class SensorDHT:
|
class SensorDHT:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -43,7 +43,7 @@ class SensorDHT:
|
||||||
self.send_update(self.id_h, "humidity", h)
|
self.send_update(self.id_h, "humidity", h)
|
||||||
|
|
||||||
def send_update(self, id_s, type_s, value):
|
def send_update(self, id_s, type_s, value):
|
||||||
url = "%s/sensors/update" % ADDRESS
|
url = "%s/sensor/update" % ADDRESS
|
||||||
data = {"id": id_s, "type": type_s, "value": value}
|
data = {"id": id_s, "type": type_s, "value": value}
|
||||||
try:
|
try:
|
||||||
r = requests.post(url, json=data)
|
r = requests.post(url, json=data)
|
||||||
|
|
Loading…
Reference in a new issue