If I create a template sensor to represent a battery give it the device class of battery then it automatically gets the right icon to represent the charge level. Great!
I notice battery sensors provided by integrations do the same thing but have different icons depending on whether they’re charging (and my phone even gets different icons when wireless charging!) which is very neat.
Can I get the same effect in my template sensor without having to code for all 20+ different icon states?