Skip to content

Commit

Permalink
fix: Added check for when standing charge can't be retrieved
Browse files Browse the repository at this point in the history
  • Loading branch information
BottlecapDave committed May 11, 2023
1 parent 64f30ef commit 383ec65
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def async_fetch_consumption_and_rates(
rate_data = await client.async_get_gas_rates(tariff_code, period_from, period_to)
standing_charge = await client.async_get_gas_standing_charge(tariff_code, period_from, period_to)

if consumption_data is not None and len(consumption_data) > 0 and rate_data is not None and len(rate_data) > 0:
if consumption_data is not None and len(consumption_data) > 0 and rate_data is not None and len(rate_data) > 0 and standing_charge is not None:
consumption_data = __sort_consumption(consumption_data)

return {
Expand Down

0 comments on commit 383ec65

Please sign in to comment.