Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depreciation warning of supported features for Vacuum and Camera entities #349

Closed
ChristophCaina opened this issue Dec 28, 2023 · 10 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@ChristophCaina
Copy link
Contributor

Describe the bug
The following errors are logged:

Logger: homeassistant.components.camera
Source: helpers/entity_platform.py:368
Integration: Camera (documentation, issues)
First occurred: 1:19:00 PM (1 occurrences)
Last logged: 1:19:00 PM

Error while setting up dreame_vacuum platform for camera
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 368, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1273, in add_to_platform_finish
    await self.async_internal_added_to_hass()
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 744, in async_internal_added_to_hass
    self._rtsp_to_webrtc = await self._async_use_rtsp_to_webrtc()
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 761, in _async_use_rtsp_to_webrtc
    if CameraEntityFeature.STREAM not in self.supported_features:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'int' is not iterable
Logger: homeassistant.components.camera
Source: helpers/entity_platform.py:507
Integration: Camera (documentation, issues)
First occurred: 1:19:00 PM (2 occurrences)
Last logged: 1:19:00 PM

Error adding entities for domain camera with platform dreame_vacuum
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1273, in add_to_platform_finish
    await self.async_internal_added_to_hass()
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 744, in async_internal_added_to_hass
    self._rtsp_to_webrtc = await self._async_use_rtsp_to_webrtc()
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 761, in _async_use_rtsp_to_webrtc
    if CameraEntityFeature.STREAM not in self.supported_features:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'int' is not iterable

To Reproduce
Steps to reproduce the behavior.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional Information (please complete the following information)

  • Model Name [e.g. dreame.vacuum.p2028]: L10 Ultra
  • Firmware Version [e.g. 1156]:
  • Home Assistant Version: 2024.1.0b0
  • Configuration Type:
  • Errors or warnings shown in the HA logs (if applicable): see above
@ChristophCaina ChristophCaina added bug Something isn't working question Further information is requested labels Dec 28, 2023
@ChristophCaina
Copy link
Contributor Author

ChristophCaina commented Dec 28, 2023

@Tasshack
Copy link
Owner

Tasshack commented Dec 29, 2023

Not sure how to fix this without breaking the compatibility of previous HA versions.

@ChristophCaina
Copy link
Contributor Author

hm.. let's wait until the linked PRs are merged and available and see, if this might solve the issue.

@Tasshack
Copy link
Owner

By the way probably same issue exists with the Vacuum entity too since it also uses the depreciated supported features.

@ChristophCaina
Copy link
Contributor Author

it seems, that there are a lot of integrations affected by this change...
Also alexa_mediaplayer seems to be affected:

Here's the PR they have created:
alandtse/alexa_media_player#2150

@ChristophCaina
Copy link
Contributor Author

2024.1.0b2 is fixing the error - and now there's only a deprication warning in the logs :)

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:1515
First occurred: 1:00:32 PM (58 occurrences)
Last logged: 1:01:03 PM

Entity camera.dreamebot_l10s_ultra_map (<class 'custom_components.dreame_vacuum.camera.DreameVacuumCameraEntity'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <CameraEntityFeature: 0>, please create a bug report at https://github.com/Tasshack/dreame-vacuum/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation
Entity camera.dreamebot_l10s_ultra_map_data (<class 'custom_components.dreame_vacuum.camera.DreameVacuumCameraEntity'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <CameraEntityFeature: 0>, please create a bug report at https://github.com/Tasshack/dreame-vacuum/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation
Entity camera.dreamebot_l10s_ultra_map_1 (<class 'custom_components.dreame_vacuum.camera.DreameVacuumCameraEntity'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <CameraEntityFeature: 0>, please create a bug report at https://github.com/Tasshack/dreame-vacuum/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation
Entity camera.dreamebot_l10s_ultra_wifi_map_1 (<class 'custom_components.dreame_vacuum.camera.DreameVacuumCameraEntity'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <CameraEntityFeature: 0>, please create a bug report at https://github.com/Tasshack/dreame-vacuum/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation
Entity None (<class 'custom_components.alexa_media.media_player.AlexaClient'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <MediaPlayerEntityFeature.PAUSE|VOLUME_SET|VOLUME_MUTE|PREVIOUS_TRACK|NEXT_TRACK|TURN_ON|TURN_OFF|PLAY_MEDIA|SELECT_SOURCE|STOP|PLAY|SHUFFLE_SET: 56253>, please create a bug report at https://github.com/alandtse/alexa_media_player/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation

So - with this, there's time until 2025.1 when it will stop working again.

@Tasshack
Copy link
Owner

@ChristophCaina that was a close call, I really don't want to release another hotfix for the stable version but I am going to address this with a backwards compatible solution on the next beta release.
Thanks.

@Tasshack Tasshack changed the title With HA 2024.1.0b0 and the latest Dreame_Vaccuum 2.0.0b11 the following errors are logged. Depreciation warning of supported features for Vacuum and Camera entities Dec 30, 2023
@kovacsla
Copy link

kovacsla commented Jan 7, 2024

Hello,

I have the same problem.

2024-01-07 03:27:43.220 WARNING (MainThread) [homeassistant.helpers.entity] Entity camera.consuela_map (<class 'custom_components.dreame_vacuum.camera.DreameVacuumCameraEntity'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <CameraEntityFeature: 0>, please create a bug report at https://github.com/Tasshack/dreame-vacuum/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation

@Tasshack
Copy link
Owner

Tasshack commented Jan 7, 2024

@kovacsla this is not a problem and currently does not effect anything, you can ignore it until the next Beta release.

@Tasshack
Copy link
Owner

Fixed.
https://github.com/Tasshack/dreame-vacuum/releases/tag/v2.0.0b12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants