Wire up timeline pins

This commit is contained in:
2026-05-02 19:35:34 -04:00
parent d99c248c49
commit dc1788c9d0
3 changed files with 54 additions and 21 deletions

View File

@@ -27,6 +27,18 @@ Pebble.addEventListener("appmessage", function (dict) {
callAPI(cfg.CLAY_API_HOST + "/api/v2?apikey=" + cfg.CLAY_API_KEY + "&cmd=get_history&length=100", null, false, cfg.CLAY_USER, sleepTimestamp);
}
}
if (dict.payload["PKJS_PIN_TIMESTAMP"] && dict.payload["PKJS_PIN_TITLE"]) {
var pin = {
id: dict.payload["PKJS_PIN_TIMESTAMP"],
time: new Date(dict.payload["PKJS_PIN_TIMESTAMP"] * 1000).toISOString(),
layout: {
type: "genericPin",
title: dict.payload["PKJS_PIN_TITLE"]
}
};
Pebble.insertTimelinePin(JSON.stringify(pin));
}
});
function callAPI(fullURL, apiKey, isJellyfin, trackedUser, sleepTimestamp) {