Skip to content

Commit

Permalink
Calculate current bill with two or more days
Browse files Browse the repository at this point in the history
  • Loading branch information
yinyang17 committed Feb 23, 2024
1 parent 28250d8 commit e7e9427
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/pvpc_energy/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ async def calculate_bills(billing_periods, consumptions, hass):
PvpcCoordinator.save_billing_periods(BILLING_PERIODS_FILE, billing_periods)

current_billing_period = None
if (last_consumption_date - billing_periods[-1]['end_date']).days > 2:
if (last_consumption_date - billing_periods[-1]['end_date']).days >= 2:
current_billing_period = {'start_date': billing_periods[-1]['end_date'] + datetime.timedelta(days=1), 'end_date':last_consumption_date}
current_billing_period = await PvpcCoordinator.get_bill(current_billing_period, consumptions)

Expand Down

0 comments on commit e7e9427

Please sign in to comment.