diff --git a/light/Light.cpp b/light/Light.cpp index f8929998..64fa9f6f 100644 --- a/light/Light.cpp +++ b/light/Light.cpp @@ -195,7 +195,6 @@ namespace implementation { Return Light::setLight(Type type, const LightState& state) { LightStateHandler handler = nullptr; - bool handled = false; /* Lock global mutex until light state is updated. */ std::lock_guard lock(globalLock); @@ -217,15 +216,12 @@ Return Light::setLight(Type type, const LightState& state) { for (LightBackend& backend : backends) { if (handler == backend.handler && isLit(backend.state)) { handler(backend.state); - handled = true; - break; + return Status::SUCCESS; } } /* If no type has been lit up, then turn off the hardware. */ - if (!handled) { - handler(state); - } + handler(state); return Status::SUCCESS; }