[miio] Update channels only if they are linked (#9163)
* [miio] Update channels only if they are linked With introduction of miot devices with enormous amount of channels refreshes can become slow. With this change only relevant updates are done. Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
This commit is contained in:
parent
a2bcb2ec7a
commit
852f19f5c2
@ -318,6 +318,11 @@ public class MiIoBasicHandler extends MiIoAbstractHandler {
|
||||
int maxProperties = device.getDevice().getMaxProperties();
|
||||
JsonArray getPropString = new JsonArray();
|
||||
for (MiIoBasicChannel miChannel : refreshList) {
|
||||
if (!isLinked(miChannel.getChannel())) {
|
||||
logger.debug("Skip refresh of channel {} for {} as it is not linked", miChannel.getChannel(),
|
||||
getThing().getUID());
|
||||
continue;
|
||||
}
|
||||
JsonElement property;
|
||||
if (miChannel.isMiOt()) {
|
||||
JsonObject json = new JsonObject();
|
||||
|
Loading…
x
Reference in New Issue
Block a user