Fix json format changed since v3 61/18261/1 6.99.1 6.99.2 guppy/6.99.1 guppy/6.99.2 guppy_6.99.1 guppy_6.99.2
authorLoïc Collignon <loic.collignon@iot.bzh>
Fri, 23 Nov 2018 08:38:30 +0000 (09:38 +0100)
committerLoïc Collignon <loic.collignon@iot.bzh>
Fri, 23 Nov 2018 08:38:30 +0000 (09:38 +0100)
Using APIv3 the json format for a response of an API call has changed a
bit, removing one extra useless level.

BUG: SPECT-1973

Change-Id: If5cfcda5740cf48637257a510f030dc84e853057
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
app/mixer.cpp

index f231b6d..ccb16d6 100644 (file)
@@ -83,7 +83,7 @@ void Mixer::getVolume(const QString& name)
         {
                        // TODO: Success, update the slider
             qDebug() << "Volume changed: " << v;
-            int newVolume = v.toObject()["response"].toObject()["response"].toObject()["volnew"].toInt();
+            int newVolume = v.toObject()["response"].toObject()["volnew"].toInt();
             auto currentVolume = volumes_.find(name);
             if (currentVolume != volumes_.end() && *currentVolume == newVolume)
                 return;