From e9a285d190562341203947cb42dc878e2498ec67 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 2 Nov 2020 14:44:02 +0100 Subject: [PATCH] Hue: Fix bridge version checking --- philipshue/integrationpluginphilipshue.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/philipshue/integrationpluginphilipshue.cpp b/philipshue/integrationpluginphilipshue.cpp index 123281c1..24defaf1 100644 --- a/philipshue/integrationpluginphilipshue.cpp +++ b/philipshue/integrationpluginphilipshue.cpp @@ -1678,11 +1678,13 @@ void IntegrationPluginPhilipsHue::processBridgeRefreshResponse(Thing *thing, con // mark bridge as reachable bridgeReachableChanged(thing, true); - thing->setStateValue(bridgeApiVersionStateTypeId, configMap.value("apiversion").toString()); + QString bridgeApiVersion = configMap.value("apiversion").toString(); + thing->setStateValue(bridgeApiVersionStateTypeId, bridgeApiVersion); thing->setStateValue(bridgeCurrentVersionStateTypeId, configMap.value("swversion").toString()); HueBridge *bridge = m_bridges.key(thing); - if (bridge->apiVersion() < "1.20") { + bridge->setApiVersion(bridgeApiVersion); + if (bridgeApiVersion < "1.20") { int updateStatus = configMap.value("swupdate").toMap().value("updatestate").toInt(); switch (updateStatus) { case 0: