From 8cc9e2074104a9a575fdb6ce665c53ba0b7eb4ea Mon Sep 17 00:00:00 2001 From: David Zingg Date: Wed, 20 Nov 2019 21:54:23 +0100 Subject: [PATCH] #6 UI Updates senden und anzeigen --- octoprint_mystromswitch/static/js/mystromswitch.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/octoprint_mystromswitch/static/js/mystromswitch.js b/octoprint_mystromswitch/static/js/mystromswitch.js index 4f3e8b6..3bc9946 100644 --- a/octoprint_mystromswitch/static/js/mystromswitch.js +++ b/octoprint_mystromswitch/static/js/mystromswitch.js @@ -142,9 +142,8 @@ $(function() { } self.mystromswitchEnabled(data.mystromswitchEnabled); - 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 { @@ -157,7 +156,6 @@ $(function() { self.timeoutPopup = undefined; } } - } } self.abortShutdown = function(abortShutdownValue) {