Skip to content

Commit

Permalink
Fix manual consumptuion bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fboundy committed Apr 4, 2024
1 parent f9938a3 commit 6a91ce3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/pv_opt/pv_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2271,6 +2271,8 @@ def load_consumption(self, start, end):
self.log(
f"Getting expected consumption data for {start.strftime(DATE_TIME_FORMAT_LONG)} to {end.strftime(DATE_TIME_FORMAT_LONG)}:"
)
index = pd.date_range(start, end, inclusive="left", freq="30min")
consumption = pd.DataFrame(index=index, data={"consumption": 0})

if self.get_config("use_consumption_history"):
time_now = pd.Timestamp.now(tz="UTC")
Expand All @@ -2280,8 +2282,6 @@ def load_consumption(self, start, end):
else:
days = int(self.get_config("consumption_history_days"))

index = pd.date_range(start, end, inclusive="left", freq="30min")
consumption = pd.DataFrame(index=index, data={"consumption": 0})
df = None

entity_ids = []
Expand Down

0 comments on commit 6a91ce3

Please sign in to comment.