From a6476b3304a08d69d42f898b2023f88e7ca2e05a Mon Sep 17 00:00:00 2001 From: Brayan Almonte Date: Tue, 19 Mar 2024 14:24:00 -0400 Subject: [PATCH] fix(hepa-uv): Set the UV pushbutton status led correctly. (#759) --- include/hepa-uv/core/uv_task.hpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/hepa-uv/core/uv_task.hpp b/include/hepa-uv/core/uv_task.hpp index aad6fdfcd..81981809b 100644 --- a/include/hepa-uv/core/uv_task.hpp +++ b/include/hepa-uv/core/uv_task.hpp @@ -111,10 +111,14 @@ class UVMessageHandler { }; can_client.send_can_message(can::ids::NodeId::host, resp); } - led_control_client.send_led_control_message( - // Set the push button LED's to user intervention (blue) - led_control_task_messages::PushButtonLED(UV_BUTTON, 0, 0, 50, - 0)); + // Set the push button LED's to user intervention (blue) when + // attempting to turn on the uv light while the door is opened or + // reed switch is not set. + if (light_on) { + led_control_client.send_led_control_message( + led_control_task_messages::PushButtonLED(UV_BUTTON, 0, 0, + 50, 0)); + } uv_push_button = false; uv_light_on = false; return;