@yoooclaw/phone-notifications 1.10.7 → 1.10.8

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.cjs CHANGED
@@ -5422,7 +5422,7 @@ function readBuildInjectedVersion() {
5422
5422
  if (false) {
5423
5423
  return void 0;
5424
5424
  }
5425
- const version = "1.10.7".trim();
5425
+ const version = "1.10.8".trim();
5426
5426
  return version || void 0;
5427
5427
  }
5428
5428
  function readPluginVersionFromPackageJson() {
@@ -7007,16 +7007,21 @@ var MODE_TO_INDEX = {
7007
7007
  wave_rainbow: 4,
7008
7008
  pixel_frame: 5
7009
7009
  };
7010
- function buildLightEffectApnsBody(segments, repeatInput) {
7010
+ function buildLightEffectApnsBody(segments, repeatInput, visibleTextOverride) {
7011
7011
  assertSegmentCount(segments);
7012
7012
  assertSegmentsValid(segments);
7013
7013
  const repeatTimes = normalizeRepeatTimes(repeatInput);
7014
7014
  assertAncsRepeatTimes(repeatTimes);
7015
- const visibleText = summarizeSegments(segments);
7015
+ const visibleText = resolveVisibleText(visibleTextOverride, segments);
7016
7016
  const separator = repeatTimes === 0 ? LED_SEPARATOR_LOOP : LED_SEPARATOR_ONCE;
7017
7017
  const payload = segments.map((segment) => encodeSegment(segment)).join("");
7018
7018
  return `${visibleText}${separator}${payload}`;
7019
7019
  }
7020
+ function resolveVisibleText(override, segments) {
7021
+ const trimmed = override?.trim();
7022
+ if (trimmed) return trimmed;
7023
+ return summarizeSegments(segments);
7024
+ }
7020
7025
  function assertSegmentCount(segments) {
7021
7026
  if (segments.length < 1 || segments.length > MAX_LIGHT_SEGMENTS) {
7022
7027
  throw new Error(`light_control supports 1-${MAX_LIGHT_SEGMENTS} segments`);
@@ -8532,7 +8537,7 @@ async function sendLightEffect(apiKey, segments, logger, repeatInput, reason) {
8532
8537
  }
8533
8538
  let bizContent;
8534
8539
  try {
8535
- bizContent = buildLightEffectApnsBody(segments, repeatInput);
8540
+ bizContent = buildLightEffectApnsBody(segments, repeatInput, reason);
8536
8541
  } catch (error) {
8537
8542
  return { ok: false, error: error?.message ?? String(error) };
8538
8543
  }