@cpzxrobot/sdk 1.0.80 → 1.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/camera_gateway.ts +11 -4
- package/dist/camera_gateway.js +9 -2
- package/package.json +1 -1
- package/readme.md +1 -0
- package/types.d.ts +1 -0
package/camera_gateway.ts
CHANGED
|
@@ -59,14 +59,21 @@ export class CameraGateway extends Object {
|
|
|
59
59
|
| "right_down"
|
|
60
60
|
| "up"
|
|
61
61
|
| "down"
|
|
62
|
+
| "focus_near"
|
|
63
|
+
| "focus_far"
|
|
62
64
|
| "zoom_in"
|
|
63
65
|
| "zoom_out",
|
|
64
|
-
start
|
|
66
|
+
start?: boolean,
|
|
67
|
+
stop?: boolean
|
|
65
68
|
): Promise<any> {
|
|
66
69
|
var axios = await this.context.ready;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
var url = `/api/v1/camera/${data.id}/control/${action}`;
|
|
71
|
+
if (start) {
|
|
72
|
+
url += `?start=${start}`;
|
|
73
|
+
} else if (stop) {
|
|
74
|
+
url += `?stop=${stop}`;
|
|
75
|
+
}
|
|
76
|
+
const response = await axios.get(url);
|
|
70
77
|
return response.data;
|
|
71
78
|
}
|
|
72
79
|
}
|
package/dist/camera_gateway.js
CHANGED
|
@@ -32,9 +32,16 @@ class CameraGateway extends Object {
|
|
|
32
32
|
const response = await axios.get(`/api/v1/weather?code=${id}`);
|
|
33
33
|
return response.data;
|
|
34
34
|
}
|
|
35
|
-
async control(data, action, start
|
|
35
|
+
async control(data, action, start, stop) {
|
|
36
36
|
var axios = await this.context.ready;
|
|
37
|
-
|
|
37
|
+
var url = `/api/v1/camera/${data.id}/control/${action}`;
|
|
38
|
+
if (start) {
|
|
39
|
+
url += `?start=${start}`;
|
|
40
|
+
}
|
|
41
|
+
else if (stop) {
|
|
42
|
+
url += `?stop=${stop}`;
|
|
43
|
+
}
|
|
44
|
+
const response = await axios.get(url);
|
|
38
45
|
return response.data;
|
|
39
46
|
}
|
|
40
47
|
}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -85,6 +85,7 @@ baseURL: "/"
|
|
|
85
85
|
| cpzxrobot().device.v2.list | 删除设备(仅限v2设备) |
|
|
86
86
|
| cpzxrobot().device.v2.delete | 删除设备(仅限v2设备) |
|
|
87
87
|
| cpzxrobot().camera.xxx | 获得摄像头的相关信息 |
|
|
88
|
+
| cpzxrobot().camera.control | 控制摄像头,例如:左移,右移,上移,下移等,如果传输start为true,则开始控制,如果传输stop为true,则停止控制,如果都没传输,则执行3秒后自动停止,传输start为true时,前端必须在需要停止时自行发送stop为true的消息 |
|
|
88
89
|
| cpzxrobot().factory.entry| 获得工厂的可显示动态信息 |
|
|
89
90
|
| cpzxrobot().transport.fodder.getDeviceByFodderld | 获得料单对应的设备 |
|
|
90
91
|
| cpzxrobot().pigfarm.heatlamp.xxx | 操作保温灯 |
|