garo_wallbox icon indicating copy to clipboard operation
garo_wallbox copied to clipboard

Integration is using deprecated `DEVICE_CLASS_*` constants

Open frenck opened this issue 2 years ago • 2 comments

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

frenck avatar Jan 03 '23 17:01 frenck

Hi @frenck, I'll try to fix this as soon as I have some free time.

sockless-coding avatar Jan 12 '23 19:01 sockless-coding

Hi @sockless-coding it seems there is a commit #40 with a fix even. (Though I'm not good enough at programming to tell if it is any good.) I'm getting a little worried this problem is forgotten until the integration breaks next year. Any chance you have the time to take a look? :)

malgoe avatar Jun 26 '24 16:06 malgoe

Fixed in version 2024.9.0

sockless-coding avatar Sep 14 '24 19:09 sockless-coding