From ec43f5e9b6884a8f4b6ddf294abc07ea1c1a1a33 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Tue, 21 Dec 2021 20:18:54 -0500 Subject: [PATCH] octoprint_compat: make UFP uploads optional Signed-off-by: Eric Callahan --- moonraker/components/octoprint_compat.py | 30 ++++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/moonraker/components/octoprint_compat.py b/moonraker/components/octoprint_compat.py index 642c192..ceae561 100644 --- a/moonraker/components/octoprint_compat.py +++ b/moonraker/components/octoprint_compat.py @@ -41,6 +41,7 @@ class OctoprintCompat: self.server = config.get_server() self.software_version = self.server.get_app_args().get( 'software_version') + self.enable_ufp: bool = config.getboolean('enable_ufp', True) # Local variables self.klippy_apis: APIComp = self.server.lookup_component('klippy_apis') @@ -219,19 +220,8 @@ class OctoprintCompat: Hardcode capabilities to be basically there and use default fluid/mainsail webcam path. """ - return { - 'plugins': { - 'UltimakerFormatPackage': { - 'align_inline_thumbnail': False, - 'inline_thumbnail': False, - 'inline_thumbnail_align_value': 'left', - 'inline_thumbnail_scale_value': '50', - 'installed': True, - 'installed_version': '0.2.2', - 'scale_inline_thumbnail': False, - 'state_panel_thumbnail': True, - }, - }, + settings = { + 'plugins': {}, 'feature': { 'sdSupport': False, 'temperatureGraph': False @@ -246,6 +236,20 @@ class OctoprintCompat: 'webcamEnabled': True, }, } + if self.enable_ufp: + settings['plugins'] = { + 'UltimakerFormatPackage': { + 'align_inline_thumbnail': False, + 'inline_thumbnail': False, + 'inline_thumbnail_align_value': 'left', + 'inline_thumbnail_scale_value': '50', + 'installed': True, + 'installed_version': '0.2.2', + 'scale_inline_thumbnail': False, + 'state_panel_thumbnail': True, + }, + } + return settings async def _get_job(self, web_request: WebRequest