Skip to content

Commit

Permalink
Update home.py (#311)
Browse files Browse the repository at this point in the history
Solves lastMeterProduction null error.
  • Loading branch information
jyourstone authored Sep 30, 2024
1 parent 6606cef commit f9c70a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tibber/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def _add_extra_data(data: dict[str, Any]) -> dict[str, Any]:

self._rt_power.append((_timestamp, live_data["power"] / 1000))
if "lastMeterProduction" in live_data:
live_data["lastMeterProduction"] = max(0, live_data["lastMeterProduction"])
live_data["lastMeterProduction"] = max(0, live_data["lastMeterProduction"] or 0)

if (
(power_production := live_data.get("powerProduction"))
Expand Down

0 comments on commit f9c70a3

Please sign in to comment.