From db9d6b401a0898aabca9c5fd21ff381a6c3f41ef Mon Sep 17 00:00:00 2001 From: dupondje Date: Tue, 5 Dec 2023 14:28:57 +0100 Subject: [PATCH] Add optional dsmr timestamp sensor (#104979) * Add optional timestamp sensor * Apply suggestions from code review Remove "timestamp" translation Co-authored-by: Joost Lekkerkerker --------- Co-authored-by: Joost Lekkerkerker --- homeassistant/components/dsmr/sensor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/homeassistant/components/dsmr/sensor.py b/homeassistant/components/dsmr/sensor.py index 722b8eda326..6aadcd63d44 100644 --- a/homeassistant/components/dsmr/sensor.py +++ b/homeassistant/components/dsmr/sensor.py @@ -78,6 +78,13 @@ class DSMRSensorEntityDescription(SensorEntityDescription): SENSORS: tuple[DSMRSensorEntityDescription, ...] = ( + DSMRSensorEntityDescription( + key="timestamp", + obis_reference=obis_references.P1_MESSAGE_TIMESTAMP, + device_class=SensorDeviceClass.TIMESTAMP, + entity_category=EntityCategory.DIAGNOSTIC, + entity_registry_enabled_default=False, + ), DSMRSensorEntityDescription( key="current_electricity_usage", translation_key="current_electricity_usage",