Fix error
This commit is contained in:
@@ -38,7 +38,8 @@ def post_reading(config: dict, humidity: float, temperature: float):
|
|||||||
print("Unauthorised: Trying to re-register")
|
print("Unauthorised: Trying to re-register")
|
||||||
config["id"] = register_id(config)
|
config["id"] = register_id(config)
|
||||||
update_config(config)
|
update_config(config)
|
||||||
raise Exception(f"Reading: server returned {response.status_code}: {response.reason}")
|
else:
|
||||||
|
raise Exception(f"Reading: server returned {response.status_code}: {response.reason}")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
config = load_config()
|
config = load_config()
|
||||||
@@ -56,7 +57,7 @@ def main():
|
|||||||
try:
|
try:
|
||||||
post_reading(config, humidity, temperature)
|
post_reading(config, humidity, temperature)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e.message) # Continue for now
|
print(e) # Continue for now
|
||||||
sensor_fail_count = 0
|
sensor_fail_count = 0
|
||||||
else:
|
else:
|
||||||
sensor_fail_count = sensor_fail_count + 1
|
sensor_fail_count = sensor_fail_count + 1
|
||||||
|
|||||||
Reference in New Issue
Block a user