pawelhulek / pgnig-sensor

This sensor is gathering gas usage data from PGNIG ebok page.
MIT License
31 stars 8 forks source link

Error on device update – prawdopodobnie związany z ostatnią aktualizacją #13

Closed fi-sch closed 2 years ago

fi-sch commented 2 years ago

Nie patrzyłem dawno w logi, ani nie robiłem nic przy instancji. Po update HA do 2022.4 i zaktualizowaniu integracji w logach mam poniższy błąd.

Logger: homeassistant.components.sensor
Source: custom_components/pgnig_gas_sensor/sensor.py:173 
Integration: Sensor (documentation, issues) 
First occurred: 14:31:26 (1 occurrences) 
Last logged: 14:31:26

pgnig_gas_sensor: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 735, in async_device_update
    await task
  File "/config/custom_components/pgnig_gas_sensor/sensor.py", line 164, in async_update
    self._state = await self.hass.async_add_executor_job(self.invoicesSummary)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/pgnig_gas_sensor/sensor.py", line 173, in invoicesSummary
    next_payment_item = min(filter(closestPaymentDate, self.api.invoices().invoices_list), key=lambda z: z)
ValueError: min() arg is an empty sequence
Yamaha0014 commented 2 years ago

u mnie to samo: ` Logger: homeassistant.components.sensor Source: custom_components/pgnig_gas_sensor/sensor.py:173 Integration: Sensor (documentation, issues) First occurred: 18:07:03 (1 occurrences) Last logged: 18:07:03

pgnig_gas_sensor: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 735, in async_device_update await task File "/config/custom_components/pgnig_gas_sensor/sensor.py", line 164, in async_update self._state = await self.hass.async_add_executor_job(self.invoicesSummary) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/pgnig_gas_sensor/sensor.py", line 173, in invoicesSummary next_payment_item = min(filter(closestPaymentDate, self.api.invoices().invoices_list), key=lambda z: z) ValueError: min() arg is an empty sequence `

pawelhulek commented 2 years ago

Dzieki za szybki feedback. Poprawka z 1.0.3 powinna naprawic problem.