From 788ca2272417270a9767753eb1dbb533cc52b8dd Mon Sep 17 00:00:00 2001 From: Marcel Date: Sat, 24 Oct 2020 03:45:03 +0200 Subject: [PATCH] [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 --- .../binding/miio/internal/handler/MiIoBasicHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 72068c9d0c6..ee6422b33f2 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"); }