From d57fa19252d82fc94a387f3e0a9deb177701fa81 Mon Sep 17 00:00:00 2001 From: zhangji <125540670@qq.com> Date: Thu, 26 Oct 2023 14:00:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=AE=BE=E5=A4=87=E6=B6=88=E6=81=AF):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=BE=E5=A4=87=E6=B6=88=E6=81=AF=E8=AE=A2?= =?UTF-8?q?=E9=98=85=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PropertyMessage类型没有默认的解码实现,已改为订阅ThingMessage --- .../things/data/AutoUpdateThingsDataManager.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/jetlinks-components/things-component/src/main/java/org/jetlinks/community/things/data/AutoUpdateThingsDataManager.java b/jetlinks-components/things-component/src/main/java/org/jetlinks/community/things/data/AutoUpdateThingsDataManager.java index 110f0e093..61518dfe6 100644 --- a/jetlinks-components/things-component/src/main/java/org/jetlinks/community/things/data/AutoUpdateThingsDataManager.java +++ b/jetlinks-components/things-component/src/main/java/org/jetlinks/community/things/data/AutoUpdateThingsDataManager.java @@ -8,6 +8,7 @@ import org.jetlinks.community.things.ThingConstants; import org.jetlinks.core.event.EventBus; import org.jetlinks.core.event.Subscription; +import org.jetlinks.core.message.ThingMessage; import org.jetlinks.core.message.property.PropertyMessage; import org.jetlinks.core.things.ThingId; import org.jetlinks.core.things.ThingProperty; @@ -173,14 +174,17 @@ public Updater(String thingType, String thingId) { .broker() .priority(Integer.MIN_VALUE) .build(), - PropertyMessage.class + ThingMessage.class ) .doOnNext(this::doUpdate) .subscribe(); } - private void doUpdate(PropertyMessage message) { - + private void doUpdate(ThingMessage thingMessage) { + if (!(thingMessage instanceof PropertyMessage)) { + return; + } + PropertyMessage message = (PropertyMessage) thingMessage; try { Map properties = message.getProperties(); if (properties == null) {