用于设备属性集合的本地缓存工具类
Examples
//加载根设备的属性缓存对象
import {Device, DeviceProperties} from "miot"
const eventSubscription = DeviceProperties.addListener(["prop1", "prop2"], (deviceProps, changeProps)=>{
})
...
Device.getDeviceWifi().loadProperties("prop1", "prop2")
.then(propsMap=>{
DeviceProperties.setProperties(propsMap).notifyPropertiesChanged();
})
.catch(err=>{})
...
eventSubscription.remove()
//创建新的设备属性缓存对象
import {createProperties} from "miot/Properties"
const myDeviceProperties = createProperties();
...
myDeviceProperties.clear();
Interfaces
Members
(static, constant) createProperties
创建一个新的属性缓存对象
(static, constant) RootDeviceProperties
根设备属性缓存对象