dahua icon indicating copy to clipboard operation
dahua copied to clipboard

2024.1 deprecates constants and features used by Dahua

Open sure-fire opened this issue 1 year ago • 5 comments

I updated to 2024.1 and got the following warnings which link to this page: Deprecating all magic numbers for supported features


Logger: homeassistant.components.camera
Source: helpers/deprecation.py:204
Integration: Camera (documentation, issues)
First occurred: 17:14:29 (2 occurrences)
Last logged: 17:14:30

SUPPORT_STREAM was used from dahua, this is a deprecated constant which will be removed in HA Core 2025.1. Use CameraEntityFeature.STREAM instead, please create a bug report at https://github.com/rroller/dahua/issues 

Logger: homeassistant.components.light
Source: components/light/__init__.py:1194
Integration: Light (documentation, issues)
First occurred: 17:14:30 (1 occurrences)
Last logged: 17:14:30

Entity None (<class 'custom_components.dahua.light.DahuaInfraredLight'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <LightEntityFeature: 1> and color modes, please create a bug report at https://github.com/rroller/dahua/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation 

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:1520
First occurred: 17:14:30 (1 occurrences)
Last logged: 17:14:30

Entity camera.front_door_main (<class 'custom_components.dahua.camera.DahuaCamera'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <CameraEntityFeature.STREAM: 2>, please create a bug report at https://github.com/rroller/dahua/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation

sure-fire avatar Jan 03 '24 23:01 sure-fire

also:

Logger: homeassistant.components.light
Source: components/light/__init__.py:1194
Integration: Light ([documentation](https://www.home-assistant.io/integrations/light), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+light%22))
First occurred: 20:34:28 (1 occurrences)
Last logged: 20:34:28
Entity None (<class 'custom_components.dahua.light.DahuaInfraredLight'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <LightEntityFeature: 1> and color modes, please create a bug report at https://github.com/rroller/dahua/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:1520
First occurred: 20:34:21 (9 occurrences)
Last logged: 20:34:28
Entity None (<class 'custom_components.localtuya.climate.LocaltuyaClimate'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <ClimateEntityFeature.TARGET_TEMPERATURE: 1>, please create a bug report at https://github.com/rospogrigio/localtuya/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation
Entity camera.dahua_vto_2202f_klingel_main (<class 'custom_components.dahua.camera.DahuaCamera'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <CameraEntityFeature.STREAM: 2>, please create a bug report at https://github.com/rroller/dahua/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation

nawwman avatar Jan 08 '24 20:01 nawwman

I also have the SUPPORT_STREAM alert for a dahua doorbell VTO2202F

pollinolas avatar Jan 16 '24 12:01 pollinolas

Seeing the same for AD410 Doorbell:

SUPPORT_STREAM was used from dahua, this is a deprecated constant which will be removed in HA Core 2025.1. Use CameraEntityFeature.STREAM instead, please create a bug report at https://github.com/rroller/dahua/issues

Entity None (<class 'custom_components.dahua.light.DahuaInfraredLight'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <LightEntityFeature: 1> and color modes, please create a bug report at https://github.com/rroller/dahua/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation

TheAlphaLaw avatar Feb 07 '24 15:02 TheAlphaLaw

More to fix till 2025.3:

Logger: homeassistant.components.light
Source: components/light/__init__.py:1269
integration: Light (documentation, issues)
First occurred: 14:08:27 (2 occurrences)
Last logged: 14:19:30

None (<class 'custom_components.dahua.light.DahuaInfraredLight'>) does not set supported color modes, this will stop working in Home Assistant Core 2025.3, please create a bug report at https://github.com/rroller/dahua/issues

Masterz69 avatar Mar 20 '24 12:03 Masterz69

More to fix till 2025.3:

Logger: homeassistant.components.light
Source: components/light/__init__.py:1269
integration: Light (documentation, issues)
First occurred: 14:08:27 (2 occurrences)
Last logged: 14:19:30

None (<class 'custom_components.dahua.light.DahuaInfraredLight'>) does not set supported color modes, this will stop working in Home Assistant Core 2025.3, please create a bug report at https://github.com/rroller/dahua/issues

I will push a PR to fix this also when the camera one is reviewed

thecode avatar Mar 23 '24 20:03 thecode

Sorry for the delay.

Fixed by merging adutchak's PR and released in 0.9.52 https://github.com/rroller/dahua/releases/tag/0.9.52

rroller avatar May 04 '24 19:05 rroller

https://github.com/rroller/dahua/releases/tag/0.9.53 released for the constant fix thanks to thecode

rroller avatar May 04 '24 20:05 rroller