Device class for a localtuya device

Hello,

So I have this wifi smart plug that’s used to monitor the electricity production of a couple of PV panels. I was able to add them to HA using the TUYA integration. But this does not seem to be very stable. I therefore wanna use the localtuya integration. While I was able to add the sensor, I don’t know how to define its class as ‘power’ to use it in the energy dashboard.

I don’t find any point in the process that allows to define the class. How could I do that?

Thanks!

My configuration:

3192c48e57ed626fc04fdb118763c6d294944e05_2_336x375

0df97f23ca3cd1ee79a6cb8334df7d9176499610

sensor.yaml

  - platform: template
    sensors:
      tuya_local_watt:
        friendly_name: "Tuya local Watt"
        unit_of_measurement: 'W'
        value_template: "{{ state_attr('switch.tuya_ha_local','current_consumption') }}"
        icon_template: "mdi:air-conditioner"
        device_class: power
        unique_id: tuya_local_watt


        #   watt to kWh
  - platform: integration
    source: sensor.tuya_local_watt
    unit_prefix: k    
    round: 2
    name: Tuya Local kWh
    unique_id: tuyalocalkWh

customize.yaml

sensor.tuya_local_kwh:
  state_class: total_increasing