Skip to content

Commit 2e7de3a

Browse files
committed
修复“控制面板中出现重复的属性”的问题
Change-Id: Iee6189afd106c3538d44411a8326e40557f5df73
1 parent 06c0a79 commit 2e7de3a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/main/java/com/tencent/iot/explorer/link/mvp/model/ControlPanelModel.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import com.tencent.iot.explorer.link.mvp.ParentModel
2626
import com.tencent.iot.explorer.link.mvp.view.ControlPanelView
2727
import java.util.*
2828
import kotlin.collections.ArrayList
29+
import kotlin.collections.LinkedHashSet
2930

3031

3132
/**
@@ -55,7 +56,7 @@ class ControlPanelModel(view: ControlPanelView) : ParentModel<ControlPanelView>(
5556
private val deviceDataList = arrayListOf<DeviceDataEntity>()
5657

5758
//设备产品信息及面板数据
58-
val devicePropertyList = LinkedList<DevicePropertyEntity>()
59+
var devicePropertyList = LinkedList<DevicePropertyEntity>()
5960

6061
//是否显示导航栏
6162
private var navBar: NavBar? = null
@@ -325,6 +326,7 @@ class ControlPanelModel(view: ControlPanelView) : ParentModel<ControlPanelView>(
325326
devicePropertyList.add(devicePropertyEntity)
326327
}
327328
}
329+
devicePropertyList = LinkedList(LinkedHashSet(devicePropertyList))
328330
L.e("devicePropertyList", JsonManager.toJson(devicePropertyList) ?: "")
329331
view?.showControlPanel(navBar, hasTimerCloud)
330332
}

0 commit comments

Comments
 (0)