Closed frenck closed 1 year ago
@frenck as you said, fairly easy to fix 😄
Just out of curiosity, do you scan custom intagration listed in HACS for deprecations like this or how did you noticed this?
Highly appreciate that you opened this issue and all the work you put into Home Assistant 🙏🏽
Just out of curiosity, do you scan custom intagration listed in HACS for deprecations like this or how did you noticed this?
Yeah, I made a folder, and used the following command to clone every custom integration listed in HACS:
for repo in $(curl -sSL https://raw.githubusercontent.com/hacs/default/master/integration | jq -r '.[]'); do echo mkdir "${repo%%/*}" && git clone "https://github.com/${repo}" "${repo}"; done
Once that was done, it was an easy rgrep on those constants to find integrations which had these.
Highly appreciate that you opened this issue and all the work you put into Home Assistant 🙏🏽
Your welcome, thanks for your contributions as well ❤️
../Frenck
Awesome @Bouni 👍
../Frenck
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 aSensorDeviceClass
enum. So if a sensor previously used theDEVICE_CLASS_ENERGY
constant, it should now useSensorDeviceClass.ENERGY
. Other platforms (likebinary_sensor
, andnumber
) 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