homecontrol-bh1750: minor updates

This commit is contained in:
Konstantin Koslowski 2019-11-06 00:03:29 +01:00
parent 09ef8e2f1a
commit 93bb49295b

View file

@ -7,8 +7,8 @@ import wifi
import bh1750 import bh1750
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 SensorBH1750: class SensorBH1750:
def __init__(self): def __init__(self):
@ -39,7 +39,7 @@ class SensorBH1750:
self.send_update(self.id_s, "luminance", l) self.send_update(self.id_s, "luminance", l)
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)