From: Marcel Date: Sat, 24 Oct 2020 01:45:03 +0000 (+0200) Subject: [miio] delay refresh to avoid devices not ready yet (#8838) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=788ca2272417270a9767753eb1dbb533cc52b8dd;p=openhab-addons.git [miio] delay refresh to avoid devices not ready yet (#8838) * [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 * [miio] remove change from PR --- diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoBasicHandler.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoBasicHandler.java index 72068c9d0c..ee6422b33f 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoBasicHandler.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoBasicHandler.java @@ -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"); }