From d8a958bdc5dc1eceda62f9534d9b5fef247b5b32 Mon Sep 17 00:00:00 2001 From: GSzabados <35445496+GSzabados@users.noreply.github.com> Date: Sun, 8 Dec 2024 22:26:09 +0100 Subject: [PATCH 1/2] Add Last Audio Self Test and Last Manual Self Test Adding two more datetime sensors for test times. --- custom_components/nest_protect/sensor.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/custom_components/nest_protect/sensor.py b/custom_components/nest_protect/sensor.py index 2b19e09..f4dfe7b 100644 --- a/custom_components/nest_protect/sensor.py +++ b/custom_components/nest_protect/sensor.py @@ -98,6 +98,20 @@ class NestProtectSensorDescription(SensorEntityDescription): device_class=SensorDeviceClass.DATE, entity_category=EntityCategory.DIAGNOSTIC, ), + NestProtectSensorDescription( + name="Last Audio Self Test", + key="last_audio_self_test_end_utc_secs", + value_fn=lambda state: datetime.datetime.utcfromtimestamp(state), + device_class=SensorDeviceClass.DATE, + entity_category=EntityCategory.DIAGNOSTIC, + ), + NestProtectSensorDescription( + name="Last Manual Test", + key="latest_manual_test_end_utc_secs", + value_fn=lambda state: datetime.datetime.utcfromtimestamp(state), + device_class=SensorDeviceClass.DATE, + entity_category=EntityCategory.DIAGNOSTIC, + ), NestProtectSensorDescription( name="Temperature", key="current_temperature", From 280d13aa94a2b6fff9d31e576d897a477d3d8431 Mon Sep 17 00:00:00 2001 From: GSzabados <35445496+GSzabados@users.noreply.github.com> Date: Sun, 8 Dec 2024 22:32:17 +0100 Subject: [PATCH 2/2] Add Removed from Base sensor I have chosen tray-remove as icon, as it looks similar to the protect being removed. --- custom_components/nest_protect/binary_sensor.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/custom_components/nest_protect/binary_sensor.py b/custom_components/nest_protect/binary_sensor.py index 3bd2f1c..f3f0dbb 100644 --- a/custom_components/nest_protect/binary_sensor.py +++ b/custom_components/nest_protect/binary_sensor.py @@ -140,6 +140,14 @@ class NestProtectBinarySensorDescription( icon="mdi:water-percent", value_fn=lambda state: not state, ), + NestProtectBinarySensorDescription( + key="removed_from_base", + name="Removed from Base", + device_class=BinarySensorDeviceClass.PROBLEM, + entity_category=EntityCategory.DIAGNOSTIC, + icon="mdi:tray-remove", + value_fn=lambda state: state, + ), NestProtectBinarySensorDescription( key="auto_away", name="Occupancy",