frlequ/homeassistant-mojelektro

Unexpected error fetching mojelektro_sensor data

Closed this issue · 9 comments

V log viewerju je razvidno spodnje. Uporabljam 0.2.4 verzijo.
Hvala za korekcijo.

2024-11-05 19:00:43.919 ERROR (MainThread) [custom_components.mojelektro.sensor] Unexpected error fetching mojelektro_sensor data
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data
return await self.update_method()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mojelektro/moj_elektro_api.py", line 80, in getData
sensor_return.update(self.consumption_by_block(cache.get('15'), json.loads(SETUP_TAG_BLOCKS_ARRAY)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mojelektro/moj_elektro_api.py", line 348, in consumption_by_block
block_num = self.calculate_tariff(timestamp)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mojelektro/moj_elektro_api.py", line 436, in calculate_tariff
weekend_or_holiday = self.is_weekend_or_holiday(date)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mojelektro/moj_elektro_api.py", line 413, in is_weekend_or_holiday
easter_saturday, easter_monday = self.get_easter_saturday_monday(date.year)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mojelektro/moj_elektro_api.py", line 385, in get_easter_saturday_monday
easter_sunday = self.calculate_easter(year)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/mojelektro/moj_elektro_api.py", line 381, in calculate_easter
return datetime.date(year, month, day)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: descriptor 'date' for 'datetime.datetime' objects doesn't apply to a 'int' object

Isto.
Od včeraj (6. 11., 18:00) ne dela. Mislim, da sem takrat naredil update.

Bugfix #40

Bugfix #40

Thank you. Did some other fixes and version bumps. #41
Latest release is up https://github.com/frlequ/homeassistant-mojelektro/releases

PS: do you guys get an updates notifications via HACS automaticaly or you do it manualy?

Depends. Sometimes, you see the HACS updates as notification in HA. Usualy i need to go to specific plugin and click refresh and then HA makes notification about available update. So all in all the notifications for HACS plugins are working funny.

Thanks for the info. I've noticed the same behavior.

Depends. Sometimes, you see the HACS updates as notification in HA. Usualy i need to go to specific plugin and click refresh and then HA makes notification about available update. So all in all the notifications for HACS plugins are working funny.

Lahko prosim natančneje razložiš postopek? Meni namreč ne uspe priti do možnosti nadgradnje.

Da odgovorim sam sebi: po reloadu HACS integracije se je pokazalo obvestilo za nadgradnjo.

Update information ponavadi pomaga:

image

Update information ponavadi pomaga:

image

This was exactly what i was writing about.