From d6a3e011a50daa35db507e2be80866745b0ee2a8 Mon Sep 17 00:00:00 2001 From: michag86 <6691165+michag86@users.noreply.github.com> Date: Tue, 24 Nov 2020 22:24:36 +0100 Subject: [PATCH 1/3] Add gotify.json to __init__.py Add gotify.json to __init__.py --- octoprint_webhooks/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/octoprint_webhooks/__init__.py b/octoprint_webhooks/__init__.py index 32790f1..b142d9b 100644 --- a/octoprint_webhooks/__init__.py +++ b/octoprint_webhooks/__init__.py @@ -224,7 +224,8 @@ def get_assets(self): css=["css/webhooks.css"], js=["js/webhooks.js"], json=["templates/simple.json", "templates/fulldata.json", "templates/snapshot.json", - "templates/oauth.json", "templates/dotnotation.json", "templates/slack.json", "templates/plivo.json"] + "templates/oauth.json", "templates/dotnotation.json", "templates/slack.json", + "templates/plivo.json", "templates/gotify.json"] ) def register_custom_events(self, *args, **kwargs): From 4fb60cb16de4c5f3f702cfa07b4d336c0b5b4f9f Mon Sep 17 00:00:00 2001 From: michag86 <6691165+michag86@users.noreply.github.com> Date: Tue, 24 Nov 2020 22:26:05 +0100 Subject: [PATCH 2/3] Add gotify.json to webhooks.js Add gotify.json to webhooks.js --- octoprint_webhooks/static/js/webhooks.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/octoprint_webhooks/static/js/webhooks.js b/octoprint_webhooks/static/js/webhooks.js index 5ce005a..cb16dfe 100644 --- a/octoprint_webhooks/static/js/webhooks.js +++ b/octoprint_webhooks/static/js/webhooks.js @@ -31,7 +31,8 @@ $(function() { self.selectHook(0) //Get the list of available templates. let templates = ["simple.json", "fulldata.json", "snapshot.json", - "oauth.json", "dotnotation.json", "slack.json", "plivo.json"] + "oauth.json", "dotnotation.json", "slack.json", "plivo.json", + "gotify.json"] let callbacksLeft = templates.length; for (let i = 0; i < templates.length; i = i + 1) { let templateFile = "plugin/webhooks/static/templates/" + templates[i] From aa97eeda3280b3be3fa7ba2aa21c4d01e940d193 Mon Sep 17 00:00:00 2001 From: michag86 <6691165+michag86@users.noreply.github.com> Date: Tue, 24 Nov 2020 22:35:46 +0100 Subject: [PATCH 3/3] Create gotify.json --- octoprint_webhooks/static/templates/gotify.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 octoprint_webhooks/static/templates/gotify.json diff --git a/octoprint_webhooks/static/templates/gotify.json b/octoprint_webhooks/static/templates/gotify.json new file mode 100644 index 0000000..5858cb4 --- /dev/null +++ b/octoprint_webhooks/static/templates/gotify.json @@ -0,0 +1,17 @@ +{ + "content_type": "JSON", + "data": "{\n \"title\":\"@topic\",\n \"priority\": 5,\n \"message\":\"@message\"\n}", + "eventErrorMessage": "There was an error.", + "eventPrintDoneMessage": "Your print is done.", + "eventPrintFailedMessage": "Something went wrong and your print has failed.", + "eventPrintPausedMessage": "Your print has paused. You might need to change the filament color.", + "eventPrintProgressMessage": "Your print is @percentCompleteMilestone % complete.", + "eventPrintStartedMessage": "Your print has started", + "eventUserActionNeededMessage": "User action needed. You might need to change the filament color.", + "event_print_progress_interval": "50", + "headers": "{\n \"Content-Type\": \"application/json\",\n \"X-Gotify-Key\": \"@apiSecret\"\n}", + "http_method": "POST", + "oauth": false, + "_name": "Gotify Message", + "_description": "This template will send a message to your Gotify Server. As URL enter the API Endpoint for message creation (Note: your URL should look something like https://your.gotify.server.com/message). Inside Gotify, you need to create a new application in the apps section. Copy the app token and paste it here in the field API SECRET in the Webhook Parameters section. The priority can be changed in the field DATA in the Advanced section. Now, you should be able to test out your integration and see a message appear in your gotify account." +}