Skip to content

Commit e712bd8

Browse files
committed
Map MetricType.TIMESTAMP to SensorDeviceClass.TIMESTAMP
This enables Home Assistant to automatically localize epoch timestamps to the user's configured timezone instead of displaying them as UTC strings. Fixes #430
1 parent 88d1de0 commit e712bd8

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

custom_components/victron_mqtt/sensor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
MetricType.DURATION: SensorDeviceClass.DURATION,
4949
MetricType.ENUM: SensorDeviceClass.ENUM,
5050
MetricType.IRRADIANCE: SensorDeviceClass.IRRADIANCE,
51+
MetricType.TIMESTAMP: SensorDeviceClass.TIMESTAMP,
5152
}
5253

5354
METRIC_NATURE_TO_STATE_CLASS: dict[MetricNature, SensorStateClass] = {

0 commit comments

Comments
 (0)