From a610833bd767f512717a7b6ad84a8d859a19ce4a Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Sun, 21 Apr 2024 19:30:52 +0100 Subject: [PATCH] ha: add lib.sendValue() --- apps/ha/ha.lib.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/ha/ha.lib.js b/apps/ha/ha.lib.js index 9aa13303d..9b16a25cc 100644 --- a/apps/ha/ha.lib.js +++ b/apps/ha/ha.lib.js @@ -78,3 +78,13 @@ exports.sendTrigger = function(triggerName){ } } } + +exports.sendValue = function(trigger, value){ + Bluetooth.println( + JSON.stringify({ + t: "intent", + action: "com.espruino.gadgetbridge.banglejs.HA", + extra: { trigger, value }, + }) + ); +};