From 24c7010a9e296056971129e7fe8916a024bc4351 Mon Sep 17 00:00:00 2001 From: David Zingg Date: Wed, 20 Nov 2019 21:20:55 +0100 Subject: [PATCH] #6 UI Updates senden und anzeigen --- octoprint_mystromswitch/__init__.py | 3 +++ octoprint_mystromswitch/static/js/mystromswitch.js | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/octoprint_mystromswitch/__init__.py b/octoprint_mystromswitch/__init__.py index cb2e5ed..145949d 100644 --- a/octoprint_mystromswitch/__init__.py +++ b/octoprint_mystromswitch/__init__.py @@ -79,6 +79,9 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin, self._logger.info("on_settings_load") self.initialize() + def on_settings_migrate(self, target, current): + pass + def get_settings_version(self): return 1 diff --git a/octoprint_mystromswitch/static/js/mystromswitch.js b/octoprint_mystromswitch/static/js/mystromswitch.js index a65c015..8cb931f 100644 --- a/octoprint_mystromswitch/static/js/mystromswitch.js +++ b/octoprint_mystromswitch/static/js/mystromswitch.js @@ -217,7 +217,6 @@ $(function() { } } - self.onmystromswitchEvent = function() { if (self.mystromswitchEnabled()) { $.ajax({ @@ -255,14 +254,11 @@ $(function() { if (data.type == "timeout") { if ((data.timeout_value != null) && (data.timeout_value > 0)) { self.timeoutPopupOptions.text = self.timeoutPopupText + data.timeout_value; - if (data.power != null) { - self.timeoutPopupOptions.text = self.timeoutPopupText + data.power; if (typeof self.timeoutPopup != "undefined") { self.timeoutPopup.update(self.timeoutPopupOptions); } else { self.timeoutPopup = new PNotify(self.timeoutPopupOptions); self.timeoutPopup.get().on('pnotify.cancel', function() {self.abortShutdown(true);}); - self.timeoutPopup.get().on('pnotify.cancel', function() {}); } } else { if (typeof self.timeoutPopup != "undefined") {