diff --git a/light/Light.cpp b/light/Light.cpp index c243a130..7effab80 100644 --- a/light/Light.cpp +++ b/light/Light.cpp @@ -224,7 +224,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); @@ -246,15 +245,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; }