Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Integration is using deprecated DEVICE_CLASS_* constant #20

Closed
frenck opened this issue Jan 3, 2023 · 2 comments · Fixed by #21
Closed

Integration is using deprecated DEVICE_CLASS_* constant #20

frenck opened this issue Jan 3, 2023 · 2 comments · Fixed by #21
Assignees
Labels
bug Something isn't working

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

@PiotrMachowski
Copy link
Owner

Thanks @frenck, I need to finally address this issue

@PiotrMachowski PiotrMachowski self-assigned this Jan 3, 2023
@PiotrMachowski PiotrMachowski added the bug Something isn't working label Jan 3, 2023
@PiotrMachowski PiotrMachowski linked a pull request Jul 13, 2023 that will close this issue
@PiotrMachowski
Copy link
Owner

Fixed in v2.0.0

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants