dreame-vacuum: AttributeError: object has no attribute '_webrtc_provider'

Describe the bug Getting the following webrtc error since the introduction in HA 2024.11

To Reproduce Update HA core to 2024.11.0b0 and check the logs.

Expected behavior No errors in the log.

Additional Information (please complete the following information)

  • Model Name [e.g. dreame.vacuum.p2028]: n/a
  • Firmware Version [e.g. 1156]: n/a
  • Home Assistant Version: 2024.11
  • Configuration Type [With or without map support]: with map
  • Errors or warnings shown in the HA logs (if applicable):
Logger: homeassistant.components.camera
Source: helpers/entity_platform.py:599
integration: Camera (documentation, issues)
First occurred: 20:54:52 (3 occurrences)
Last logged: 20:54:59

Error adding entity camera.d10s_pro_map for domain camera with platform dreame_vacuum
Error adding entity camera.d10s_pro_map_1 for domain camera with platform dreame_vacuum
Error adding entity camera.d10s_pro_map_2 for domain camera with platform dreame_vacuum
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 599, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 918, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1366, in add_to_platform_finish
    await self.async_internal_added_to_hass()
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 782, in async_internal_added_to_hass
    await self.async_refresh_providers(write_state=False)
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 790, in async_refresh_providers
    old_provider = self._webrtc_provider
                   ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'DreameVacuumCameraEntity' object has no attribute '_webrtc_provider'

Confirmed as not a core issue https://github.com/home-assistant/core/issues/129532. “The issue is in the CC not initializing the Camera Entity by calling the parent class init method when defining its own init method.”

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 15 (2 by maintainers)

Commits related to this issue

Most upvoted comments

To resolve the issue temporarily, I added the missing attributes to the DreameVacuumCameraEntity class in the camera.py file of the integration. Specifically, I added the following lines to the class:

_webrtc_provider = None
_legacy_webrtc_provider = None
_supports_native_sync_webrtc = False
_supports_native_async_webrtc = False

After adding these attributes, the errors stopped appearing in the logs, and the integration started working as expected.

Thanks, working!

@taifunk since you deserve the credit, you should create a PR to fix this

Hi there, can you please tell exactly where I should add those values in the camera.py file?

This is my version:

image

The problem still persists on the Home Assistant Core 2024.11.3?

yes