@cpzxrobot/sdk 1.0.65 → 1.0.66
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 +19 -4
- package/package.json +1 -1
package/camera_gateway.ts
CHANGED
|
@@ -27,8 +27,8 @@ export class CameraGateway extends Object {
|
|
|
27
27
|
factory_id?: number;
|
|
28
28
|
unit_id?: number;
|
|
29
29
|
};
|
|
30
|
-
}else{
|
|
31
|
-
params = {unit_id:data.id}
|
|
30
|
+
} else {
|
|
31
|
+
params = { unit_id: data.id };
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const response = await axios.post("/api/v1/camera/search", params);
|
|
@@ -48,9 +48,24 @@ export class CameraGateway extends Object {
|
|
|
48
48
|
return response.data;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
async control(
|
|
51
|
+
async control(
|
|
52
|
+
data: Camera,
|
|
53
|
+
action:
|
|
54
|
+
| "left"
|
|
55
|
+
| "left_up"
|
|
56
|
+
| "left_down"
|
|
57
|
+
| "right"
|
|
58
|
+
| "right_up"
|
|
59
|
+
| "right_down"
|
|
60
|
+
| "up"
|
|
61
|
+
| "down"
|
|
62
|
+
| "zoom_in"
|
|
63
|
+
| "zoom_out"
|
|
64
|
+
): Promise<any> {
|
|
52
65
|
var axios = await this.context.ready;
|
|
53
|
-
const response = await axios.get(
|
|
66
|
+
const response = await axios.get(
|
|
67
|
+
`/api/v1/camera/${data.id}/control/${action}`
|
|
68
|
+
);
|
|
54
69
|
return response.data;
|
|
55
70
|
}
|
|
56
71
|
}
|