Skip to content

Commit

Permalink
fix: Fixed expectation that charge_in_kwh is available in local intel…
Browse files Browse the repository at this point in the history
…ligent dispatch data
  • Loading branch information
BottlecapDave committed Nov 28, 2023
1 parent 00ec35c commit 6e0c3ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(
self,
start: datetime,
end: datetime,
charge_in_kwh: int,
charge_in_kwh: float,
source: str,
location: str
):
Expand Down
2 changes: 1 addition & 1 deletion custom_components/octopus_energy/intelligent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def dictionary_list_to_dispatches(dispatches: list):
IntelligentDispatchItem(
parse_datetime(dispatch["start"]),
parse_datetime(dispatch["end"]),
int(dispatch["charge_in_kwh"]),
float(dispatch["charge_in_kwh"]) if "charge_in_kwh" in dispatch and dispatch["charge_in_kwh"] is not None else None,
dispatch["source"] if "source" in dispatch else "",
dispatch["location"] if "location" in dispatch else ""
)
Expand Down

0 comments on commit 6e0c3ed

Please sign in to comment.