Skip to content

Commit

Permalink
add consultas js
Browse files Browse the repository at this point in the history
  • Loading branch information
lmtreser committed Oct 4, 2024
1 parent 8482711 commit ee79e76
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions server/sqlite/db_ejemplo/query_node_red.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
let payload;

let insert = "INSERT INTO eventos (ev_tipo_evento, ev_am_id, ev_di_id, ev_valor, ev_descripcion) ";

let values = "VALUES ('Cambio de temperatura', 2, 1, 23.0, 'La temperatura subió a 23.0°C')";

if (msg.topic == "luces") {
msg.payload = insert + values;
}
else if (msg.topic == "temperatura") {
msg.payload = insert + values;
}

return msg;

0 comments on commit ee79e76

Please sign in to comment.