@7365admin1/core 3.133.0 → 3.133.1

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/dist/index.mjs CHANGED
@@ -64487,7 +64487,12 @@ function ounitechTaskRecord(t, maps = [], tz = 480) {
64487
64487
  };
64488
64488
  }
64489
64489
  var ALERT_WORDS = {
64490
+ "205": "Side brush driver offline",
64491
+ "206": "Button panel offline",
64490
64492
  "540": "Floor check: cliff sensor switched on",
64493
+ "588": "Switched off with the power button",
64494
+ "589": "Switched off by the timed power schedule",
64495
+ "593": "Still finding its position - try again shortly",
64491
64496
  "601": "Left wheel driver reset",
64492
64497
  "620": "Right wheel driver offline",
64493
64498
  "621": "Right wheel driver reset",
@@ -64508,7 +64513,8 @@ function ounitechAlertRecord(a, tz = 480) {
64508
64513
  return {
64509
64514
  code,
64510
64515
  level: lv ? ALERT_LEVEL_WORDS[lv[1].trim()] ?? lv[1].trim() : null,
64511
- message: ALERT_WORDS[code] ?? (rest || raw),
64516
+ // An untranslated Chinese text keeps its code up front, so the row is never only Chinese.
64517
+ message: ALERT_WORDS[code] ?? (/[㐀-鿿]/.test(rest || raw) && code ? `Robot alert ${code}: ${rest || raw}` : rest || raw),
64512
64518
  vendorText: rest || raw,
64513
64519
  resolved,
64514
64520
  at: ounitechTime(a.createTime, tz)
@@ -64618,11 +64624,12 @@ var PART_WORDS = {
64618
64624
  floor_brush_double_roller_structure: "Floor brush rollers",
64619
64625
  floor_mop_double_roller_structure: "Mop rollers"
64620
64626
  };
64627
+ var upFirst = (t) => t.charAt(0).toUpperCase() + t.slice(1);
64621
64628
  function ounitechConsumable(u) {
64622
64629
  const code = String(u.unitcode ?? "").trim();
64623
64630
  const minutes = num(u.workminutes);
64624
64631
  return {
64625
- part: PART_WORDS[code] ?? (code.replace(/_/g, " ") || String(u.unitname ?? "").trim() || "Part"),
64632
+ part: PART_WORDS[code] ?? upFirst(code.replace(/_/g, " ") || String(u.unitname ?? "").trim() || "Part"),
64626
64633
  hours: minutes !== void 0 ? Math.round(minutes / 6) / 10 : null,
64627
64634
  days: num(u.workdays) ?? null
64628
64635
  };
@@ -64806,7 +64813,11 @@ function createOunitechAdapter(credentials, options) {
64806
64813
  ) : { items: [] };
64807
64814
  const readings = await part(async () => ounitechReadings((await cloud.getRobotState(robotId)).properties));
64808
64815
  const station = await part(async () => {
64809
- const st = await cloud.getStationState(robotId);
64816
+ const st = await cloud.getStationState(robotId).catch((e) => {
64817
+ if (/no station bound|e=59/i.test(String(e?.message ?? "")))
64818
+ return null;
64819
+ throw e;
64820
+ });
64810
64821
  return st ? [{ status: String(st.statusName ?? "").trim() || null, readings: ounitechReadings(st.properties, true) }] : [];
64811
64822
  });
64812
64823
  return { supported: true, readAt: now.toISOString(), tasks, alerts, consumables, power, lifts, readings, station };