| Looping | ||
Loop through elements in a array
for (let element of msg.payload){
|
Loop through keys in an object
for (let key of Object.keys(msg.payload)){
|
Loop through array
for (let i in msg.payload){
|
Loop through elements of an array |
||
| Mscl | ||
Sort object by key
let sorted = Object.keys(msg.payload).sort().reduce((acc, currValue) => {
acc[currValue] = msg.payload[currValue];
return acc;
}, {});
node.warn(sorted);
|
Recursive Traversal of Object |
|
| Stripe | ||
const stripeF = stripe(global.get('vars.stripe_key'));
stripeF.subscriptions.list(
{
customer: msg.payload,
limit: 100
},
function(err, subscriptions) {
msg.customerdata.subscriptions = subscriptions.data;
node.send(msg);
}
);
|
const stripeF = stripe(msg.query.stripe_key);
var start = async function(customer) {
var params = {
limit : 100
};
paymentIntent = await stripeF.paymentIntents.list(
params
);
node.send(msg);
}
|
|
| ESP Rules | ||
|
on balls do Topic: ESP_Easy/cmd, Payload: event,beep |
Ringtones On armtone do On disarmtone do On nowarmedtone do On intruder do On disarmled do On armled do On intruderled do |
//Microwave Stuff On MW#Presence=1 do TimerSet,1,10 // reset timer On MW#Presence=0 do On MW#MovEnergy>=50 do On Rules#Timer=1 do On Rules#Timer=2 do
/////////////////////////////////
On PIR#State=1 do TimerSet,3,10 // reset timer On Rules#Timer=3 do
|
|
Flash LED on reading RFID On pn532#Tag Do On open do GPIO,13,1 Endon |
export DISPLAY=:0 |
netdom resetpwd /Server:DC3 /UserD:administrator /passwordD:!secretstuff! Test-ComputerSecureChannel -verbose |