faanskit/ha-checkwatt

Division by zero

Closed this issue · 2 comments

Logger: custom_components.checkwatt
Källa: helpers/update_coordinator.py:318
integration: CheckWatt (dokumentation, ärenden)
Inträffade först: 28 mars 2024 kl. 23:11:35 (37 händelser)
Senast loggade: 08:48:31

Unexpected error fetching checkwatt data: float division by zero
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 318, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/checkwatt/init.py", line 388, in _async_update_data
if not await cw_inst.get_fcrd_month_net_revenue():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pycheckwatt/init.py", line 393, in get_fcrd_month_net_revenue
self.dailyaverage = self.revenuemonth / int(dayswithmoney)
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: float division by zero

This is not a ha-checkwatt error, but a pyCheckwatt isssue (which ha-checkwatt depend upon).
It will be kept open until pyCheckwatt us updated.
@flopp999, I will assign this to you in pyCheckwatt as this is "your" code causing the issue.