Skip to content

Commit

Permalink
Allow usage_to_date and cost_to_date to be missing
Browse files Browse the repository at this point in the history
  • Loading branch information
tronikos committed May 12, 2023
1 parent 750e480 commit e39695a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "opower"
version = "0.0.5"
version = "0.0.6"
license = {text = "Apache-2.0"}
authors = [
{ name="tronikos", email="[email protected]" },
Expand Down
4 changes: 2 additions & 2 deletions src/opower/opower.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ async def async_get_forecast(self) -> list[Forecast]:
end_date=date.fromisoformat(forecast["endDate"]),
current_date=date.fromisoformat(forecast["currentDate"]),
unit_of_measure=UnitOfMeasure(forecast["unitOfMeasure"]),
usage_to_date=float(forecast["usageToDate"]),
cost_to_date=float(forecast["costToDate"]),
usage_to_date=float(forecast.get("usageToDate", 0)),
cost_to_date=float(forecast.get("costToDate", 0)),
forecasted_usage=float(forecast.get("forecastedUsage", 0)),
forecasted_cost=float(forecast.get("forecastedCost", 0)),
typical_usage=float(forecast.get("typicalUsage", 0)),
Expand Down

0 comments on commit e39695a

Please sign in to comment.