From a1d3770c7d01bd08e1be395763d1360c93d14278 Mon Sep 17 00:00:00 2001 From: Moritz Wirger Date: Fri, 26 Jan 2018 20:49:44 +0100 Subject: [PATCH] Refresh state before searching for light in Hue::lightExists This way deleted lights will not be returned --- hueplusplus/Hue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- libgit2 0.21.4