@7365admin1/core 3.129.3-staging.435 → 3.129.3-staging.436

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.
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@7365admin1/core": patch
3
+ ---
4
+
5
+ Ounitech records: English words for the alerts robot 424 sends (205, 206, 588, 589, 593), an untranslated alert keeps its code in front, part names start with a capital, and "no station bound" reads as no base station instead of an error.
package/dist/index.js CHANGED
@@ -67094,7 +67094,12 @@ function ounitechTaskRecord(t, maps = [], tz = 480) {
67094
67094
  };
67095
67095
  }
67096
67096
  var ALERT_WORDS = {
67097
+ "205": "Side brush driver offline",
67098
+ "206": "Button panel offline",
67097
67099
  "540": "Floor check: cliff sensor switched on",
67100
+ "588": "Switched off with the power button",
67101
+ "589": "Switched off by the timed power schedule",
67102
+ "593": "Still finding its position - try again shortly",
67098
67103
  "601": "Left wheel driver reset",
67099
67104
  "620": "Right wheel driver offline",
67100
67105
  "621": "Right wheel driver reset",
@@ -67115,7 +67120,8 @@ function ounitechAlertRecord(a, tz = 480) {
67115
67120
  return {
67116
67121
  code,
67117
67122
  level: lv ? ALERT_LEVEL_WORDS[lv[1].trim()] ?? lv[1].trim() : null,
67118
- message: ALERT_WORDS[code] ?? (rest || raw),
67123
+ // An untranslated Chinese text keeps its code up front, so the row is never only Chinese.
67124
+ message: ALERT_WORDS[code] ?? (/[㐀-鿿]/.test(rest || raw) && code ? `Robot alert ${code}: ${rest || raw}` : rest || raw),
67119
67125
  vendorText: rest || raw,
67120
67126
  resolved,
67121
67127
  at: ounitechTime(a.createTime, tz)
@@ -67225,11 +67231,12 @@ var PART_WORDS = {
67225
67231
  floor_brush_double_roller_structure: "Floor brush rollers",
67226
67232
  floor_mop_double_roller_structure: "Mop rollers"
67227
67233
  };
67234
+ var upFirst = (t) => t.charAt(0).toUpperCase() + t.slice(1);
67228
67235
  function ounitechConsumable(u) {
67229
67236
  const code = String(u.unitcode ?? "").trim();
67230
67237
  const minutes = num(u.workminutes);
67231
67238
  return {
67232
- part: PART_WORDS[code] ?? (code.replace(/_/g, " ") || String(u.unitname ?? "").trim() || "Part"),
67239
+ part: PART_WORDS[code] ?? upFirst(code.replace(/_/g, " ") || String(u.unitname ?? "").trim() || "Part"),
67233
67240
  hours: minutes !== void 0 ? Math.round(minutes / 6) / 10 : null,
67234
67241
  days: num(u.workdays) ?? null
67235
67242
  };
@@ -67413,7 +67420,11 @@ function createOunitechAdapter(credentials, options) {
67413
67420
  ) : { items: [] };
67414
67421
  const readings = await part(async () => ounitechReadings((await cloud.getRobotState(robotId)).properties));
67415
67422
  const station = await part(async () => {
67416
- const st = await cloud.getStationState(robotId);
67423
+ const st = await cloud.getStationState(robotId).catch((e) => {
67424
+ if (/no station bound|e=59/i.test(String(e?.message ?? "")))
67425
+ return null;
67426
+ throw e;
67427
+ });
67417
67428
  return st ? [{ status: String(st.statusName ?? "").trim() || null, readings: ounitechReadings(st.properties, true) }] : [];
67418
67429
  });
67419
67430
  return { supported: true, readAt: now.toISOString(), tasks, alerts, consumables, power, lifts, readings, station };