Skip to content

Commit

Permalink
fix: Updated home pro to ignore total_consumption of zero (15 minutes…
Browse files Browse the repository at this point in the history
… dev)
  • Loading branch information
BottlecapDave committed Jun 28, 2024
1 parent 1ece6df commit 4a110f3
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ async def async_get_home_pro_consumption(
try:
data = await client.async_get_consumption(is_electricity)
if data is not None:
if len(data) < 1 or data[0]["total_consumption"] is None or data[0]["total_consumption"] <= 0:
raise ApiException('total_consumption invalid')
_LOGGER.debug(f'Retrieved current consumption data from home pro for {"electricity" if is_electricity else "gas"}')
return CurrentConsumptionCoordinatorResult(current_date, 1, REFRESH_RATE_IN_MINUTES_HOME_PRO_CONSUMPTION, data)
except Exception as e:
Expand Down

0 comments on commit 4a110f3

Please sign in to comment.