1 parent b0fdfc8 commit 3bfaa73Copy full SHA for 3bfaa73
1 file changed
custom_components/victron_mqtt/sensor.py
@@ -41,8 +41,10 @@
41
MetricType.SPEED: SensorDeviceClass.SPEED,
42
MetricType.LIQUID_VOLUME: SensorDeviceClass.VOLUME_STORAGE,
43
MetricType.DURATION: SensorDeviceClass.DURATION,
44
- MetricType.IRRADIANCE: SensorDeviceClass.IRRADIANCE,
45
MetricType.ENUM: SensorDeviceClass.ENUM,
+ # IRRADIANCE added dynamically — older library versions (pre-2026.5.6) lack it,
46
+ # and HA Docker images may ship with the older version pre-installed.
47
+ **({MetricType.IRRADIANCE: SensorDeviceClass.IRRADIANCE} if hasattr(MetricType, "IRRADIANCE") else {}),
48
}
49
50
METRIC_NATURE_TO_STATE_CLASS: dict[MetricNature, SensorStateClass] = {
0 commit comments