From 6d2d9baf35b1772409162e86f6d4b7f9374edb2e Mon Sep 17 00:00:00 2001 From: Zach Russell Date: Tue, 2 May 2023 01:27:27 -0600 Subject: [PATCH] =?utf8?q?Fixed=20OctoPrint=20=E2=80=98text=E2=80=99=20dis?= =?utf8?q?play=20when=20idle.=20(#607)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * Added moonraker support and temperature when idle * removed config change * Delete package-lock.json --- docs/customservices.md | 12 +++++++----- dummy-data/octoprint/api/printer | 27 +++++++++++++++++++++++++++ src/components/services/OctoPrint.vue | 20 +++++++++++++++++++- 3 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 dummy-data/octoprint/api/printer diff --git a/docs/customservices.md b/docs/customservices.md index 31d302b..665c6f5 100644 --- a/docs/customservices.md +++ b/docs/customservices.md @@ -31,7 +31,7 @@ within Homer: - [Speedtest Tracker](#SpeedtestTracker) - [What's Up Docker](#whats-up-docker) - [SABnzbd](#sabnzbd) - - [OctoPrint](#sabnzbd) + - [OctoPrint](#octoprint) - [Tdarr](#tdarr) If you experiencing any issue, please have a look to the [troubleshooting](troubleshooting.md) page. @@ -384,15 +384,17 @@ the "Config" > "General" section of the SABnzbd config in the SABnzbd web UI. downloadInterval: 5000 # (Optional) Interval (in ms) for updating the download count ``` -## OctoPrint +## OctoPrint/Moonraker -The OctoPrint service only needs an `apikey` & `url` and optionally a `display` option. +The OctoPrint/Moonraker service only needs an `apikey` & `endpoint` and optionally a `display` or `url` option. `url` can be used when you click on the service it will launch the `url` + +Moonraker's API mimmicks a few of OctoPrint's endpoints which makes these services compatible. See https://moonraker.readthedocs.io/en/latest/web_api/#octoprint-api-emulation for details. ```yaml - name: "Octoprint" logo: "https://cdn-icons-png.flaticon.com/512/3112/3112529.png" - apikey: "xxxxxxxxxxxx" # insert your own API key here. Request one from https://openweathermap.org/api. - url: "http://192.168.0.151:8080" + apikey: "xxxxxxxxxxxx" # insert your own API key here. + endpoint: "http://192.168.0.151:8080" display: "text" # 'text' or 'bar'. Default to `text`. type: "OctoPrint" ``` diff --git a/dummy-data/octoprint/api/printer b/dummy-data/octoprint/api/printer new file mode 100644 index 0000000..b8bbe98 --- /dev/null +++ b/dummy-data/octoprint/api/printer @@ -0,0 +1,27 @@ +{ + "temperature": { + "bed": { + "actual": 20.52, + "offset": 0, + "target": 0.0 + }, + "tool0": { + "actual": 20.44, + "offset": 0, + "target": 0.0 + } + }, + "state": { + "text": "Operational", + "flags": { + "operational": true, + "paused": false, + "printing": false, + "cancelling": false, + "pausing": false, + "error": false, + "ready": true, + "closedOrError": false + } + } +} \ No newline at end of file diff --git a/src/components/services/OctoPrint.vue b/src/components/services/OctoPrint.vue index c5da8d9..1428d9a 100644 --- a/src/components/services/OctoPrint.vue +++ b/src/components/services/OctoPrint.vue @@ -6,7 +6,7 @@ -