Keep GPIO command scopes and cover room text limits and existing UI dispatch

This commit is contained in:
mikecarper committed 2026-09-30 03:54:27 -07:00
1 parent 465425c37a
commit b2bbb92287
8 files changed
+15 -13

No files matched your search

+4 -1
View File
@@ -75,7 +75,10 @@
for (const name of ["vibration", "sound", "led", "screen"]) if (config[name] !== "inherit") parts.push(name + "=" + config[name]);
for (const name of ["repeat", "gap"]) parts.push(name + "=" + config[name]);
const text = "!notify " + parts.join(" ");
if (text.length > 159) throw new Error("Notification text exceeds 159 characters. Shorten the patterns or melody.");
// Room forwarding reserves an author prefix and currently stores 150 text
// characters. Reject before a truncated post could lose a field's value.
const maximum = config.kind === "room" ? 150 : 159;
if (text.length > maximum) throw new Error("Notification text exceeds " + maximum + " characters for " + (config.kind === "room" ? "a room post" : "a DM") + ". Shorten the patterns or melody.");
return text;
}
function level(pattern, elapsed) {
+1 -1
View File
@@ -84,7 +84,7 @@ stop policy. USB testing uses Binary Companion mode at 115200 baud.
<pre><code data-role="dm"></code></pre>
<p>The recipient must first grant your contact or room permission. Send the string
as an ordinary DM or room post; it contains no GPIO action. Long patterns may need
shortening to fit a 159-character message.</p>
shortening to fit 159 characters for a DM, or 150 for a room post.</p>
</section>
<section class="notification-card">
<h2>Try it on your device</h2>