mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 09:26:16 +00:00
chore: better error log
This commit is contained in:
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user