]> git.basschouten.com Git - openhab-addons.git/commitdiff
[miio] delay refresh to avoid devices not ready yet (#8838)
authorMarcel <marcelrv@users.noreply.github.com>
Sat, 24 Oct 2020 01:45:03 +0000 (03:45 +0200)
committerGitHub <noreply@github.com>
Sat, 24 Oct 2020 01:45:03 +0000 (18:45 -0700)
* [miio] delay refresh to avoid devices not ready yet

Delay refresh after command is send as some devices are not ready yet
with the execution and will report wrong status.
This is confusing to the users.

Related forum topic:
https://community.openhab.org/t/xiaomi-mi-air-purifier-xiaomi-mi-io/34840/300

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
* [miio] remove change from PR

bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoBasicHandler.java

index 72068c9d0c660dbd39c3e0f16514ce7cf94480a5..ee6422b33f20e219081944005cf59c58fc90b35d 100644 (file)
@@ -222,7 +222,9 @@ public class MiIoBasicHandler extends MiIoAbstractHandler {
                 }
             }
             updateDataCache.invalidateValue();
-            updateData();
+            scheduler.schedule(() -> {
+                updateData();
+            }, 3000, TimeUnit.MILLISECONDS);
         } else {
             logger.debug("Actions not loaded yet");
         }