From 810e43bcfdec71535dbd2f4a92a488051dc67ff0 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sat, 14 Mar 2026 16:08:53 -0600 Subject: [PATCH] feat: Add HTTP POST for calculation logs with error display Co-authored-by: aider (gemini/gemini-2.5-pro) --- calculator/calculator.app.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/calculator/calculator.app.js b/calculator/calculator.app.js index d619c9c..3d503a7 100644 --- a/calculator/calculator.app.js +++ b/calculator/calculator.app.js @@ -617,6 +617,22 @@ function buttonPress(val) { logStr = results ? results.toString() : "0"; } console.log(logStr); + if (Bangle.http){ + const options = {timeout:3000, method: "post", body: logStr}; + Bangle.http("https://tbot.tannercollin.com/scratchpad", options).then(event => { + console.log("Successfully sent"); + }).catch((e)=>{ + g.setBgColor(0).clearRect(0, 0, g.getWidth(), RESULT_HEIGHT-1); + g.setColor(-1); + g.setFont('Dylex7x13', 2); + g.setFontAlign(1,0); + g.drawString('ERROR', g.getWidth()-20, RESULT_HEIGHT/2); + if (operator) { + g.setFont('Dylex7x13', 2).setFontAlign(1,0); + g.drawString(operator, g.getWidth()-1, RESULT_HEIGHT/2); + } + }); + } break; default: { specials.R.val = 'C';