From 0d62cf11e41400a0b28e3d84f2a6a3d9ecfcb48f Mon Sep 17 00:00:00 2001 From: janolehuebner Date: Sat, 19 Jul 2025 02:16:18 +0200 Subject: [PATCH] Update DataPoints.py fix: udate price accessing to handle nulls --- DataPoints.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DataPoints.py b/DataPoints.py index 6ce07b6..724e99e 100755 --- a/DataPoints.py +++ b/DataPoints.py @@ -30,8 +30,8 @@ class Price: measurement = data.cache current_time_utc = datetime.utcnow() timestamp = current_time_utc.isoformat() - total = measurement["total"] - tax = measurement["tax"] + total = measurement.get("total", 0) + tax = measurement.get("tax", 0) tags = {self.label: ""} fields = { "total": float(total),