Energy Dashboard sensor missing device_class; how to add

Enery dashboad configuration, individual devices gives me an error:
Unexpected device class:
The following entities do not have the expected device class: sensor.auto_charged
The sensor.auto_charged is a an ‘integration’ in my sensor configuration:

sensor:
  - platform: integration
    source: sensor.autoladen_in_w
    name: car-charged
    unit_prefix: k
    unit_time: h
    round: 2

According the reported fault the sensor should contain a device_class.
I’v added the line below:
device_class: energy
But when I restart HA it comes up with an error that this sensor is not correctly configured.
No idea what to change. Thanks for your help

Does sensor.autoladen_in_w have a device_class power ?

I believe it will be correctly inferred by integration based on the source entity device class. The device class for the integration helper itself is not directly settable.

Thanks to point in the right direction.
I’ve added

device_class: power

tot the sensor.autoladen_in_w and the error is gone in the energy dashboard setup.