scaarup / aula

Fetches information from Aula about your children
GNU General Public License v3.0
54 stars 14 forks source link

Efter seneste upgrade af aula plugin får jeg ingen data ind i systemet #75

Closed tocDK closed 1 year ago

tocDK commented 1 year ago

Describe the bug or problem (In Danish is OK) Efter seneste upgrade af aula plugin får jeg ingen data ind i systemet. Jeg har vedhæftet de 2 fejl jeg får i loggen

Please answer the following

Please provide debug log from the integration

Logger: homeassistant.components.sensor
Source: custom_components/aula/client.py:155
Integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 10:19:52 (1 occurrences)
Last logged: 10:19:52

Error while setting up aula platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/aula/sensor.py", line 58, in async_setup_entry
    await hass.async_add_executor_job(client.update_data)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/aula/client.py", line 155, in update_data
    self.message["text"] = message["text"]["html"]
TypeError: 'NoneType' object is not subscriptable
Logger: custom_components.aula.sensor
Source: custom_components/aula/client.py:155
Integration: Aula ([documentation](https://github.com/scaarup/aula/blob/main/README.md), [issues](https://github.com/scaarup/aula/issues))
First occurred: 10:19:50 (1 occurrences)
Last logged: 10:19:50

Unexpected error fetching sensor data: 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 181, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/aula/sensor.py", line 43, in async_update_data
    await hass.async_add_executor_job(client.update_data)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/aula/client.py", line 155, in update_data
    self.message["text"] = message["text"]["html"]
TypeError: 'NoneType' object is not subscriptable
scaarup commented 1 year ago

Hej Thomas. Tak for din bugreport. Jeg blev så småt opmærksom på fejlen i går.

Har du mod på at teste om denne branch løser problemet: https://github.com/scaarup/aula/tree/hot-fix-messages ?

tocDK commented 1 year ago

@scaarup Ja. Jeg er semi ny i HA. Skal den installeres som en manuel installation?

scaarup commented 1 year ago

Du kan egentlig bare finde client.py (normalt i /config/custom_components/aula/client.py) og copy/paste det hele herfra: https://github.com/scaarup/aula/blob/hot-fix-messages/custom_components/aula/client.py og så genstarte HA.

scaarup commented 1 year ago

Hvis det er noget rod, så kan jeg lave en beta/prelease, der kan installeres via HACS.

tocDK commented 1 year ago

@scaarup nej, jeg finder ud af det. giv mig lige 10 min

tocDK commented 1 year ago

@scaarup det virker

scaarup commented 1 year ago

Fedt - mange tak for at teste. Jeg releaser den med det samme.