FL550 / dwd_weather

Deutscher Wetterdienst integration for Home-Assistant
MIT License
173 stars 11 forks source link

Error adding entities for domain sensor with platform dwd_weather Error while setting up dwd_weather platform for sensor #70

Closed Johnyboy1984 closed 11 months ago

Johnyboy1984 commented 1 year ago

Version of home_assistant

Home Assistant 2023.6.2 -->

Version of the custom_component

v1.2.28

Describe the bug

There was a sensor report, it's gone now. I think that's why an error is cropping up in the log. Log next point.

Debug log

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: homeassistant Source: custom_components/dwd_weather/sensor.py:233 Integration: Deutscher Wetterdienst (documentation, issues) First occurred: 23:24:37 (1 occurrences) Last logged: 23:24:37

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 229, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 374, in _async_refresh self.async_update_listeners() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in async_update_listeners update_callback() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 654, in _async_write_ha_state state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 596, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/config/custom_components/dwd_weather/sensor.py", line 233, in state ).group() ^^^^^ AttributeError: 'NoneType' object has no attribute 'group'

Logger: homeassistant.components.sensor Source: custom_components/dwd_weather/sensor.py:233 Integration: Sensor (documentation, issues) First occurred: 23:23:37 (2 occurrences) Last logged: 23:23:37

Error adding entities for domain sensor with platform dwd_weather Error while setting up dwd_weather platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 471, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 749, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 850, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 654, in _async_write_ha_state state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 596, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/config/custom_components/dwd_weather/sensor.py", line 233, in state ).group() ^^^^^ AttributeError: 'NoneType' object has no attribute 'group'

nima-1102 commented 1 year ago

Same Problem for me:

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 229, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 374, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 654, in _async_write_ha_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 596, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/config/custom_components/dwd_weather/sensor.py", line 233, in state
    ).group()
      ^^^^^
AttributeError: 'NoneType' object has no attribute 'group'
FL550 commented 1 year ago

Thanks for the report.

Should be fixed now, can you please confirm this?