diff --git a/src/hss_led/LedController.cpp b/src/hss_led/LedController.cpp index c61a3cb4..8d0f3916 100644 --- a/src/hss_led/LedController.cpp +++ b/src/hss_led/LedController.cpp @@ -418,7 +418,8 @@ static std::string dispatch(State& state, const std::string& message, uid_t uid, bool valid = false; if (v[1] == "status" && v.size() == 2) { return "OK owner=" + std::string(state.overrideActive ? "override" : state.automatic ? "auto" : "system") + - " backend=" + backend.name + " pending=" + std::to_string(dirty) + " pattern=" + state.effective().wire(); + " backend=" + backend.name + " pending=" + std::to_string(dirty) + + " disabled=" + std::to_string(exists(disabled)) + " pattern=" + state.effective().wire(); } if ((uid == administrator || uid == reporter) && v[1] == "report" && v.size() == 6) { valid = parsePattern(v, 2, changed.report); @@ -598,6 +599,7 @@ static const char usage[] = " Maximum: 86400000 ms. Alternate/blink require positive durations.\n" " COLOR 0 selects a steady color; unequal phase durations are allowed.\n\n" "Commands return after acceptance; status shows pending hardware updates.\n" + " disabled=1: /etc/config/disableLED forces the radio LED off.\n" "Control changes require root. The hss_led daemon must be running.\n\n" "Examples:\n" " hss_ledctl --led rpi-rf-mod alternate blue red slow\n" diff --git a/src/hss_led/tests/LedControllerTest.cpp b/src/hss_led/tests/LedControllerTest.cpp index cb3e6bec..aa846ee3 100644 --- a/src/hss_led/tests/LedControllerTest.cpp +++ b/src/hss_led/tests/LedControllerTest.cpp @@ -108,7 +108,10 @@ int main() { check(state.effective().a == 3); check(command("1 system 3 3 0 0") == "OK accepted" && !state.overrideActive && !state.automatic); check(command("1 report 4 4 0 0", 1234) == "OK accepted" && state.effective().a == 3); - put(disabled, ""); check(state.effective().a == 0); unlink(disabled.c_str()); + check(command("1 status").find(" disabled=0 ") != std::string::npos); + put(disabled, ""); check(state.effective().a == 0); + check(command("1 status").find(" disabled=1 pattern=0 0 0 0") != std::string::npos); + unlink(disabled.c_str()); std::string before = state.wire(); for (const auto& msg : {"1 override 9 0 10 10", "1 report 1 2 0 0", "1 auto extra", "2 release", "1 system 1 2 0 1"}) check(command(msg).compare(0, 3, "ERR") == 0 && state.wire() == before);