diff --git a/hueplusplus/Hue.cpp b/hueplusplus/Hue.cpp index d78e50c..70228ae 100755 --- a/hueplusplus/Hue.cpp +++ b/hueplusplus/Hue.cpp @@ -262,12 +262,12 @@ std::vector> Hue::getAllLights() bool Hue::lightExists(int id) { + refreshState(); auto pos = lights.find(id); if (pos != lights.end()) { return true; } - refreshState(); if (state["lights"].isMember(std::to_string(id))) { return true;