@cpzxrobot/sdk 1.0.61 → 1.0.63
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_types/feedtower.ts +14 -6
- package/dist/device_types/feedtower.js +4 -0
- package/package.json +1 -1
- package/readme.md +2 -0
- package/types.d.ts +1 -0
- package/unit_gateway.ts +2 -2
|
@@ -117,14 +117,22 @@ export class FeedTowerGateway extends DeviceFilter<FeedTower> {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
//设置报警参数
|
|
120
|
-
async setAlarmParam(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
async setAlarmParam(
|
|
121
|
+
deviceId: number,
|
|
122
|
+
param: {
|
|
123
|
+
zeroPeriod: number;
|
|
124
|
+
zeroValue: number;
|
|
125
|
+
alertDays: number[];
|
|
126
|
+
}
|
|
127
|
+
) {
|
|
125
128
|
return this.context.axios.post(`/api/v2/device/config/feedTowerAlert/add`, {
|
|
126
129
|
deviceId,
|
|
127
|
-
config:param,
|
|
130
|
+
config: param,
|
|
128
131
|
});
|
|
129
132
|
}
|
|
133
|
+
|
|
134
|
+
//获取报警参数
|
|
135
|
+
async getAlarmParam(deviceId: number) {
|
|
136
|
+
return this.context.axios.get(`/api/v2/device/config/feedTowerAlert/${deviceId}`);
|
|
137
|
+
}
|
|
130
138
|
}
|
|
@@ -106,5 +106,9 @@ class FeedTowerGateway extends device_filter_1.DeviceFilter {
|
|
|
106
106
|
config: param,
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
+
//获取报警参数
|
|
110
|
+
async getAlarmParam(deviceId) {
|
|
111
|
+
return this.context.axios.get(`/api/v2/device/config/feedTowerAlert/${deviceId}`);
|
|
112
|
+
}
|
|
109
113
|
}
|
|
110
114
|
exports.FeedTowerGateway = FeedTowerGateway;
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -87,6 +87,8 @@ baseURL: "/"
|
|
|
87
87
|
| cpzxrobot().transport.fodder.getDeviceByFodderld | 获得料单对应的设备 |
|
|
88
88
|
| cpzxrobot().pigfarm.heatlamp.xxx | 操作保温灯 |
|
|
89
89
|
| cpzxrobot().device.feedTower.stat | 获得料塔设备的料耗,饲料重量 |
|
|
90
|
+
| cpzxrobot().device.feedTower.setAlarmParam | 设置料塔设备的报警参数 |
|
|
91
|
+
| cpzxrobot().device.feedTower.getAlarmParam | 获得料塔设备的报警参数 |
|
|
90
92
|
| cpzxrobot().pigfarm.unitStat | 获得单元的统计信息,包括每日料耗,饲料消耗,日龄,存栏量等 |
|
|
91
93
|
| cpzxrobot().pigfarm.heatlamp.set | 设置保温灯的当前工作日龄,调用时,action传"dayage",argc传天数 |
|
|
92
94
|
| cpzxrobot().pigfarm.heatlamp.switch | 设置保温灯的当前工作日龄,调用时,action"on"或"off" |
|
package/types.d.ts
CHANGED
package/unit_gateway.ts
CHANGED
|
@@ -10,7 +10,7 @@ export class UnitGateway extends Object {
|
|
|
10
10
|
return {
|
|
11
11
|
add: (
|
|
12
12
|
unit: Unit,
|
|
13
|
-
type: "
|
|
13
|
+
type: "HeatLamp",
|
|
14
14
|
config: {
|
|
15
15
|
[key: string]: any;
|
|
16
16
|
}
|
|
@@ -25,7 +25,7 @@ export class UnitGateway extends Object {
|
|
|
25
25
|
},
|
|
26
26
|
update: (
|
|
27
27
|
unit: Unit,
|
|
28
|
-
type: "
|
|
28
|
+
type: "HeatLamp",
|
|
29
29
|
config: {
|
|
30
30
|
[key: string]: any;
|
|
31
31
|
}
|