-
Notifications
You must be signed in to change notification settings - Fork 5
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
Integration is using deprecated DEVICE_CLASS_*
constants
#27
Comments
Thanks. I have already moved most of the sensor to the new So to the question: Is there another way of doing this for a custom component? Or any other suggestion on how I can avoid to break this, when removing the local device class? {
"state": {
"aqi_description": {
"excellent": "Sehr gut",
"fine": "Gut",
"moderate": "Mittelmäßig",
"poor": "Ausreichend",
"very_poor": "Schlecht",
"severe": "Sehrt schlecht"
},
"trend": {
"falling": "Falling",
"rising": "Rising",
"steady": "Steady"
},
"beaufort": {
"calm": "Windstille",
"light_air": "Leiser Zug",
"light_breeze": "Leichte Brise",
"gentle_breeze": "Schwache Brise",
"moderate_breeze": "Mäßige Brise",
"fresh_breeze": "Frische Brise",
"strong_breeze": "Starker Wind",
"moderate_gale": "Steifer Wind",
"fresh_gale": "Stürmischer Wind",
"strong_gale": "Sturm",
"storm": "Schwerer Sturm",
"violent_storm": "Orkanartiger Sturm",
"hurricane": "Orkan"
},
"wind_cardinal": {
"n": "N",
"nne": "NNO",
"ne": "NO",
"ene": "ONO",
"e": "O",
"ese": "OSO",
"se": "SO",
"sse": "SSO",
"s": "S",
"ssw": "SSW",
"sw": "SW",
"wsw": "WSW",
"w": "W",
"wnw": "WNW",
"nw": "NW",
"nnw": "NNW"
},
"uv_description": {
"extreme": "Extrem",
"very-high": "Sehr hoch",
"high": "Hoch",
"moderate": "Mittel",
"low": "Gering",
"none": "Kein"
}
}
} |
@briis As per 2023.1 release you do not need custom device classes for those anymore. See: https://developers.home-assistant.io/blog/2022/12/01/entity_translations ../Frenck |
How did I miss that 👏 Thanks. I have a little work to do. |
All done, and after a bit of struggle I found the right json structure for my local translations to use the |
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
The text was updated successfully, but these errors were encountered: