Update DataPoints.py
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 59s

fix: udate price accessing to handle nulls
This commit is contained in:
janolehuebner 2025-07-19 02:16:18 +02:00
parent a03df231f4
commit 0d62cf11e4

View file

@ -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),