From 39805002d2ff17fb37114aa586323a7246173fdf Mon Sep 17 00:00:00 2001 From: sleevezipper Date: Fri, 19 Feb 2021 22:43:58 +0100 Subject: [PATCH] use timestamp as device class for sensors reporting time --- hass-workstation-service/Domain/Sensors/LastActiveSensor.cs | 3 ++- hass-workstation-service/Domain/Sensors/LastBootSensor.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hass-workstation-service/Domain/Sensors/LastActiveSensor.cs b/hass-workstation-service/Domain/Sensors/LastActiveSensor.cs index 8bcfdc4..ac1acdf 100644 --- a/hass-workstation-service/Domain/Sensors/LastActiveSensor.cs +++ b/hass-workstation-service/Domain/Sensors/LastActiveSensor.cs @@ -18,7 +18,8 @@ namespace hass_workstation_service.Domain.Sensors Device = this.Publisher.DeviceConfigModel, State_topic = $"homeassistant/{this.Domain}/{Publisher.DeviceConfigModel.Name}/{this.Name}/state", Icon = "mdi:clock-time-three-outline", - Availability_topic = $"homeassistant/{this.Domain}/{Publisher.DeviceConfigModel.Name}/availability" + Availability_topic = $"homeassistant/{this.Domain}/{Publisher.DeviceConfigModel.Name}/availability", + Device_class = "timestamp" }); } diff --git a/hass-workstation-service/Domain/Sensors/LastBootSensor.cs b/hass-workstation-service/Domain/Sensors/LastBootSensor.cs index 963e858..464fdd4 100644 --- a/hass-workstation-service/Domain/Sensors/LastBootSensor.cs +++ b/hass-workstation-service/Domain/Sensors/LastBootSensor.cs @@ -22,7 +22,8 @@ namespace hass_workstation_service.Domain.Sensors Device = this.Publisher.DeviceConfigModel, State_topic = $"homeassistant/{this.Domain}/{Publisher.DeviceConfigModel.Name}/{this.Name}/state", Icon = "mdi:clock-time-three-outline", - Availability_topic = $"homeassistant/{this.Domain}/{Publisher.DeviceConfigModel.Name}/availability" + Availability_topic = $"homeassistant/{this.Domain}/{Publisher.DeviceConfigModel.Name}/availability", + Device_class = "timestamp" }); }