From 1d9e5f5526d566d16b19c971228c2912c3cb28dd Mon Sep 17 00:00:00 2001 From: Foxy7 <37312469+Foxy7@users.noreply.github.com> Date: Tue, 5 Jan 2021 23:16:41 +0000 Subject: [PATCH] Update app.py to show sgv via workaround (#1391) As per @renegadeandy pull request https://github.com/renegadeandy/oref0/pull/1 just tested it and it works nicely, so making PR for Dev. --- www/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/app.py b/www/app.py index c6cecb868..84c1333bb 100644 --- a/www/app.py +++ b/www/app.py @@ -59,7 +59,7 @@ def enacted(): @app.route("/glucose") def glucose(): - if os.path.getmtime(myopenaps_dir + "xdrip/glucose.json") > os.path.getmtime(myopenaps_dir + "monitor/glucose.json"): + if os.path.getmtime(myopenaps_dir + "xdrip/glucose.json") > os.path.getmtime(myopenaps_dir + "monitor/glucose.json") and os.path.getsize(myopenaps_dir + "xdrip/glucose.json") > 0: json_url = os.path.join(myopenaps_dir + "xdrip/glucose.json") else: json_url = os.path.join(myopenaps_dir + "monitor/glucose.json")