rroller / dahua

Dahua Camera and Doorbell Home Assistant Integration
MIT License
387 stars 73 forks source link

2024.1 deprecates constants and features used by Dahua #328

Closed sure-fire closed 5 months ago

sure-fire commented 9 months ago

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
nawwman commented 9 months ago

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
pollinolas commented 8 months ago

I also have the SUPPORT_STREAM alert for a dahua doorbell VTO2202F

TheAlphaLaw commented 8 months ago

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

Masterz69 commented 6 months ago

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
thecode commented 6 months ago

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

rroller commented 5 months ago

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 commented 5 months ago

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