...
|
...
|
@@ -17,7 +17,7 @@ |
17
|
17
|
import { DeviceModelOfMatterAttrs } from '/@/api/device/model/deviceModel';
|
18
|
18
|
import { computed } from '@vue/reactivity';
|
19
|
19
|
import { Specs, StructJSON } from '/@/api/device/model/modelOfMatterModel';
|
20
|
|
- import { isObject } from '/@/utils/is';
|
|
20
|
+ import { isArray, isObject } from '/@/utils/is';
|
21
|
21
|
|
22
|
22
|
interface ReceiveMessage {
|
23
|
23
|
data: {
|
...
|
...
|
@@ -137,9 +137,9 @@ |
137
|
137
|
|
138
|
138
|
const { send, close, data } = useWebSocket(socketInfo.origin, {
|
139
|
139
|
async onConnected() {
|
140
|
|
- const { id, deviceProfileId } = props.deviceDetail;
|
141
|
|
- const value = await getDeviceAttrs(deviceProfileId, id);
|
142
|
|
- socketInfo.attrKeys = value;
|
|
140
|
+ const { deviceProfileId } = props.deviceDetail;
|
|
141
|
+ const value = await getDeviceAttrs({ deviceProfileId });
|
|
142
|
+ socketInfo.attrKeys = isArray(value) ? value : [];
|
143
|
143
|
send(JSON.stringify(unref(getSendValue)));
|
144
|
144
|
},
|
145
|
145
|
async onMessage() {
|
...
|
...
|
|