Skip to content
This repository has been archived by the owner on Dec 29, 2024. It is now read-only.

Integration is using deprecated DEVICE_CLASS_* constants #85

Closed
frenck opened this issue Jan 3, 2023 · 3 comments
Closed

Integration is using deprecated DEVICE_CLASS_* constants #85

frenck opened this issue Jan 3, 2023 · 3 comments

Comments

@frenck
Copy link

frenck commented Jan 3, 2023

This custom integration uses deprecated DEVICE_CLASS_* constants in its codebase.

The DEVICE_CLASS_* constants have been deprecated and replaced in Home Assistant Core 2021.12 (over a year ago). I would highly suggest updating/migrating this integration to the new enums.

For example, for the device classes supported by the sensor platform, there is now a SensorDeviceClass enum. So if a sensor previously used the DEVICE_CLASS_ENERGY constant, it should now use SensorDeviceClass.ENERGY. Other platforms (like binary_sensor, and number) provide similar enumerations for their supported device classes.

The migration thus only consists of replacing constants with an enumeration member and is, therefore, very low impact and should be fairly straightforward.

If I can help resolve any questions regarding this change or migration, feel free to ask or respond to this issue. I'm happy to help!

Kindest regards,

../Frenck

@briis
Copy link
Owner

briis commented Jan 4, 2023

Thanks for the info Frenck. I am in the process of fixing this.

@briis
Copy link
Owner

briis commented Jan 5, 2023

All done. 😁

@briis briis closed this as completed Jan 5, 2023
@frenck
Copy link
Author

frenck commented Jan 5, 2023

Awesome! Thanks, @briis 👍

Happy New Year 🥂

../Frenck

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

No branches or pull requests

2 participants