chore: better error log

This commit is contained in:
Florian Bezannier
2026-05-20 18:58:51 +02:00
committed by Florian BEZANNIER
parent ac8c029727
commit b8bb6b23fe
@@ -138,7 +138,9 @@ class ElectricityPriceConfig(BaseModel):
date = date + timedelta(minutes=30)
try:
res = round(consumption * mean(prices) / self.charger_efficiency, 2)
except (TypeError, StatisticsError) as e:
except StatisticsError as e:
logger.error("Can't get_price of charge: %s-%s prices: %s", start, end, prices, exc_info=e)
except TypeError as e:
logger.error("Can't get_price of charge, check config", exc_info=e)
return res