diff --git a/light/Light.cpp b/light/Light.cpp index 7a19a58..7afff31 100644 --- a/light/Light.cpp +++ b/light/Light.cpp @@ -179,18 +179,22 @@ static std::vector> notificationStates = { }; static void handleNotification(Type type, const LightState& state) { + bool handled = false; + for(auto it : notificationStates) { if (it.first == type) { it.second = state; } - if (isLit(it.second)) { + if (!handled && isLit(it.second)) { setNotification(it.second); - return; + handled = true; } } - setNotification(offState); + if (!handled) { + setNotification(offState); + } } static std::map> lights = {