pippyn / Home-Assistant-Sensor-Afvalbeheer

Provides Home Assistant sensors for multiple Dutch and Belgium waste collectors
Apache License 2.0
272 stars 85 forks source link

Task exception was never received #463

Closed LeandroMarceddu closed 6 months ago

LeandroMarceddu commented 6 months ago

This is in the logs:

2024-02-14 19:53:32.560 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/afvalbeheer/API.py", line 147, in async_update
await self.collector.update()
File "/config/custom_components/afvalbeheer/API.py", line 660, in update
response = await self.hass.async_add_executor_job(self.__get_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/afvalbeheer/API.py", line 647, in __get_data
data = data + month_json['events']
~~~~~~~~~~^^^^^^^^^^
KeyError: 'events'

I've been trying to get the Limburg.NET one working. Configuration.yaml: image

pippyn commented 6 months ago

Do you have an address for me to test with?

Ps please don't post code or configs as an image

LeandroMarceddu commented 6 months ago

Do you have an address for me to test with?

Ps please don't post code or configs as an image

Here you go


afvalbeheer:
  wastecollector: Limburg.NET
  resources:
    - restafval
    - gft
    - papier
    - pmd
  postcode: 3600
  streetnumber: 7A
  streetname: Koebaan
  cityname: Genk
  upcomingsensor: 0
  dateformat: '%d-%m-%Y'
  dateonly: 0
  alwaysshowday: 1
  name: ''
  nameprefix: 1
  builtinicons: 0```
pippyn commented 6 months ago

Thank you! It should be:

afvalbeheer:
  - afvalbeheer:
    wastecollector: Limburg.NET
    resources:
    - restafval
    - gft
    - papier
    - pmd
    postcode: 3600
    streetnumber: 7
    suffix: A
    streetname: Koebaan
    cityname: Genk
    upcomingsensor: 0
    dateformat: '%d-%m-%Y'
    dateonly: 0
    alwaysshowday: 1
    name: ''
    nameprefix: 1
    builtinicons: 0
LeandroMarceddu commented 6 months ago

Thanks! Totally read over the suffix: param. Sorry