Closed frenck closed 1 year ago
Thanks for the message, i tried editing it but the energy dashboard now gives me the following error?
That would not be caused by this change, as both SensorDeviceClass.ENERGY
and DEVICE_CLASS_ENERGY
do that same things (providing the string energy
), as they are both a constant.
Entity has non-numeric state The following entities have a state that cannot be parsed as a number: sensor.esolar_sellelec (None)
It probably means you end up sending "None"
as a string as a state, instead of sending a NoneType
non-string None
value for the state.
../Frenck
You are quick :)
And you are right, found it couple of minutes after posting my reply. I would like to improve the addon even more. Move it from configuration.yaml to the UI but can't seem to some good examples, would you maybe have some tips on how to do this ?
I would like to improve the addon even more.
Integration. Add-ons are different things 😉
Move it from configuration.yaml to the UI but can't seem to some good examples, would you maybe have some tips on how to do this ?
The best place to start on that, is just going to the Home Assistant Core codebase. Every integration that has an config_flow.py
basically implemented this (and thus can be an example). This gives you instantly hundreds of examples :)
../Frenck
Thanks will have a look!
Fixed, thanks!
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