Wire up timeline pins
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user