infra: register Dual Outlet - Couch, fix Node-RED double-toggle, add meshtastic mqtt
This commit is contained in:
@@ -63,6 +63,10 @@ flows:
|
||||
type: function
|
||||
name: Single click
|
||||
code: |
|
||||
const now = Date.now();
|
||||
const last = context.get('lastTime') || 0;
|
||||
if (now - last < 50) return null;
|
||||
context.set('lastTime', now);
|
||||
try {
|
||||
const p = JSON.parse(msg.payload);
|
||||
if (p.action === 'single') {
|
||||
@@ -76,6 +80,10 @@ flows:
|
||||
type: function
|
||||
name: Hold release
|
||||
code: |
|
||||
const now = Date.now();
|
||||
const last = context.get('lastTime') || 0;
|
||||
if (now - last < 50) return null;
|
||||
context.set('lastTime', now);
|
||||
try {
|
||||
const p = JSON.parse(msg.payload);
|
||||
if (p.action === 'release') {
|
||||
|
||||
Reference in New Issue
Block a user