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

Clear deprecated constants on 2025.1 #492

Closed
Nemesis24 opened this issue Dec 28, 2023 · 2 comments
Closed

Clear deprecated constants on 2025.1 #492

Nemesis24 opened this issue Dec 28, 2023 · 2 comments

Comments

@Nemesis24
Copy link

Description

SUPPORT_TONES was used from tapo_control, this is a deprecated constant which will be removed in HA Core 2025.1. Use SirenEntityFeature.TONES instead, please create a bug report at https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues
SUPPORT_TURN_OFF was used from tapo_control, this is a deprecated constant which will be removed in HA Core 2025.1. Use SirenEntityFeature.TURN_OFF instead, please create a bug report at https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues
SUPPORT_TURN_ON was used from tapo_control, this is a deprecated constant which will be removed in HA Core 2025.1. Use SirenEntityFeature.TURN_ON instead, please create a bug report at https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues
SUPPORT_DURATION was used from tapo_control, this is a deprecated constant which will be removed in HA Core 2025.1. Use SirenEntityFeature.DURATION instead, please create a bug report at https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues

Reproduction Steps

go to system logs

Expected behavior

don't have this advertissement

If applicable, add error logs.

No response

Device Firmware

1.3.11

Integration Version

5.4.12

Using stream component

Yes

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

pi

Search for similar issues

Yes

Additional information

No response

@tjorim
Copy link

tjorim commented Dec 28, 2023

Not sure what you mean by 'advertissement' but it's a warning.
Please note this is related to Home Assistant version 2024.1.0b0!
(Please mention this next time @Nemesis24)

Furthermore these deprecations are also present:

@JurajNyiri JurajNyiri changed the title Advertissement on home assistant Clear deprecated constants on 2025.1 Dec 28, 2023
@ChristophCaina
Copy link
Contributor

ChristophCaina commented Dec 31, 2023

nearly all "SUPPORT_" features for different devices (Climate, Camera, Cover, Vaccuum, ....) will be depricated with 2024.1.

With one the first beta releases, an Error was logged, but this was due to a missing dependency - since 0b1 or 0b2 only a deprication warning will be shown.

After a short look into the code, I guess, the following lines needs to be changed:

from homeassistant.components.camera import (
    SUPPORT_ON_OFF,
    SUPPORT_STREAM,
    Camera,
)

to:

from homeassistant.components.camera import  CameraEntityFeature, Camera
    def supported_features(self):
        if self._enable_stream:
            return SUPPORT_STREAM | SUPPORT_ON_OFF
        else:
            return SUPPORT_ON_OFF

to:

    def supported_features(self):
        if self._enable_stream:
            return CameraEntityFeature.STREAM | CameraEntityFeature.ON_OFF
        else:
            return CameraEntityFeature.ON_OFF

<--- these are just examples, because I do not have TAPO installed and can't test any change.
Also, I am not sure, if other files might be affected, too...

here's the blog post about the deprication:

https://developers.home-assistant.io/blog/2022/04/02/support-constants-deprecation
https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants