@cpzxrobot/sdk 1.0.20 → 1.0.22
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/device_filter.ts +8 -2
- package/dist/device_filter.js +7 -2
- package/dist/pigfarm_gateway.js +1 -1
- package/package.json +1 -1
- package/pigfarm_gateway.ts +1 -1
- package/readme.md +2 -2
package/device_filter.ts
CHANGED
|
@@ -98,6 +98,12 @@ export abstract class DeviceFilter<T extends { id: number }> {
|
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
//获取设备数据,和getData相同作用,为统一接口进行了重命名
|
|
102
|
+
get data() {
|
|
103
|
+
return this.getData;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
//deprecated,请使用data进行调用
|
|
101
107
|
getData(
|
|
102
108
|
id: number,
|
|
103
109
|
args: DataQueryArgs = {
|
|
@@ -106,10 +112,10 @@ export abstract class DeviceFilter<T extends { id: number }> {
|
|
|
106
112
|
type: "diffPerDay", // diffPerDay, sumPerDay, latest
|
|
107
113
|
}
|
|
108
114
|
) {
|
|
109
|
-
if (args.stop
|
|
115
|
+
if (!args.stop) {
|
|
110
116
|
args.stop = this.formateDateToYYYYMMDD(new Date());
|
|
111
117
|
}
|
|
112
|
-
if (args.start
|
|
118
|
+
if (!args.start) {
|
|
113
119
|
const sevenDaysAgo = new Date();
|
|
114
120
|
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
|
|
115
121
|
args.start = this.formateDateToYYYYMMDD(sevenDaysAgo);
|
package/dist/device_filter.js
CHANGED
|
@@ -81,15 +81,20 @@ class DeviceFilter {
|
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
+
//获取设备数据,和getData相同作用,为统一接口进行了重命名
|
|
85
|
+
get data() {
|
|
86
|
+
return this.getData;
|
|
87
|
+
}
|
|
88
|
+
//deprecated,请使用data进行调用
|
|
84
89
|
getData(id, args = {
|
|
85
90
|
start: "",
|
|
86
91
|
stop: "",
|
|
87
92
|
type: "diffPerDay", // diffPerDay, sumPerDay, latest
|
|
88
93
|
}) {
|
|
89
|
-
if (args.stop
|
|
94
|
+
if (!args.stop) {
|
|
90
95
|
args.stop = this.formateDateToYYYYMMDD(new Date());
|
|
91
96
|
}
|
|
92
|
-
if (args.start
|
|
97
|
+
if (!args.start) {
|
|
93
98
|
const sevenDaysAgo = new Date();
|
|
94
99
|
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
|
|
95
100
|
args.start = this.formateDateToYYYYMMDD(sevenDaysAgo);
|
package/dist/pigfarm_gateway.js
CHANGED
package/package.json
CHANGED
package/pigfarm_gateway.ts
CHANGED
package/readme.md
CHANGED
|
@@ -74,8 +74,8 @@ baseURL: "/"
|
|
|
74
74
|
| 调用入口 | 功能说明 |
|
|
75
75
|
| ----------------------- | -------------------- |
|
|
76
76
|
| cpzxrobot().factory.xxx | 获得工厂的相关信息 |
|
|
77
|
-
| cpzxrobot().device.list |
|
|
78
|
-
| cpzxrobot().device.data |
|
|
77
|
+
| cpzxrobot().device.list | 获得常见设备的列表(当没有特殊类型需求时调用),列表接口提供data参数,可以同步获得多个设备的数据,尽量使用该接口获得设备数据 |
|
|
78
|
+
| cpzxrobot().device.data | 获得设备的数据,该接口用于获取单个设备的详细数据 |
|
|
79
79
|
| cpzxrobot().device.feedTower.list | 获得料塔设备的列表 |
|
|
80
80
|
| cpzxrobot().device.xxx | 获得设备的相关信息 |
|
|
81
81
|
| cpzxrobot().camera.xxx | 获得摄像头的相关信息 |
|