Autodiscovery: value is not allowed for dictionary value @ data['device_class']

Message:

{
    "name": "gridPower",
    "state_topic": "evcc/site/gridPower",
    "device_class": "power"
}

Topic: homeassistant/sensor/evcc/config

Why shouldn’t device_class be allowed in this context according to MQTT Discovery - Home Assistant?

It works without device_class or basically any other additional attribute:

2022-03-19 14:03:25 INFO (MainThread) [homeassistant.components.mqtt.discovery] Component has already been discovered: sensor evcc, sending update
2022-03-19 14:03:25 INFO (MainThread) [homeassistant.components.mqtt] Got update for entity with hash: ('sensor', 'evcc') '{'name': 'gridPower', 'state_topic': 'evcc/site/gridPower', 'platform': 'mqtt', 'discovery_hash': ('sensor', 'evcc')}'
2022-03-19 14:03:25 INFO (MainThread) [homeassistant.components.mqtt] Updating component: sensor.mqtt_sensor

However, even then the mqtt integration does not show the device although values are visible in the history view?

Nvm. I’ve run an ha container from 2019 :open_mouth: