From 0565f1d9a5a2bd63d647719f152fe715acf7cde4 Mon Sep 17 00:00:00 2001 From: Simon Reeves Date: Fri, 5 May 2023 21:12:46 +0100 Subject: [PATCH] client envmonitor was still using explicit ip --- an_farmview/client/envmonitor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/an_farmview/client/envmonitor.py b/an_farmview/client/envmonitor.py index c809ed2..970b81c 100644 --- a/an_farmview/client/envmonitor.py +++ b/an_farmview/client/envmonitor.py @@ -1,10 +1,11 @@ +import os import requests import pprint import an_farmview.snmp def post(): - url = 'http://127.0.0.1:5000/envmonitor' + url = f'{os.getenv("AN_FARMVIEW_API_URL")}/envmonitor' data = { "temperature01": an_farmview.snmp.get_temperature_rear(), @@ -15,7 +16,7 @@ def post(): pprint.pprint(r.json()) def get(): - url_get = 'http://127.0.0.1:5000/envmonitors' + url_get = f'{os.getenv("AN_FARMVIEW_API_URL")}/envmonitors' getr = requests.get(url_get) pprint.pprint(getr.json())