From fc22cb9ed2e8db40d6b049dedaa79a4c99dfb38a Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Sat, 25 Oct 2025 10:49:19 -0500 Subject: [PATCH 1/2] change moving_distance and still_distance to report last value instead of NAN Change return value from NAN to an empty value when radar sensor is off. https://github.com/ApolloAutomation/MSR-2/issues/30 hoping it fixes this issue --- Integrations/ESPHome/Core.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 13ca0e1..4dd3849 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -382,7 +382,7 @@ sensor: // Check if the radar_has_moving_target sensor is off if (!id(radar_has_moving_target).state) { - return NAN; + return {}; } // Check if the reduce_db_reporting switch is on @@ -410,7 +410,7 @@ sensor: // Check if the radar_has_still_target sensor is off if (!id(radar_has_still_target).state) { - return NAN; + return {}; } // Check if the reduce_db_reporting switch is on From fbb5b8ca92924e943becc177243169fe6cd75239 Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Sat, 25 Oct 2025 11:18:50 -0500 Subject: [PATCH 2/2] radar detection distance needed the same fix radar detection distance needed the same fix --- Integrations/ESPHome/Core.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 4dd3849..b4dbabd 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -452,7 +452,7 @@ sensor: // Check if the radar_has_target sensor is off if (!id(radar_has_target).state) { - return NAN; + return {}; } // Check if the reduce_db_reporting switch is on