#6 UI Updates senden und anzeigen

This commit is contained in:
David Zingg 2019-11-20 21:20:55 +01:00
parent 799c6b5406
commit 24c7010a9e
2 changed files with 3 additions and 4 deletions

View File

@ -79,6 +79,9 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
self._logger.info("on_settings_load") self._logger.info("on_settings_load")
self.initialize() self.initialize()
def on_settings_migrate(self, target, current):
pass
def get_settings_version(self): def get_settings_version(self):
return 1 return 1

View File

@ -217,7 +217,6 @@ $(function() {
} }
} }
self.onmystromswitchEvent = function() { self.onmystromswitchEvent = function() {
if (self.mystromswitchEnabled()) { if (self.mystromswitchEnabled()) {
$.ajax({ $.ajax({
@ -255,14 +254,11 @@ $(function() {
if (data.type == "timeout") { if (data.type == "timeout") {
if ((data.timeout_value != null) && (data.timeout_value > 0)) { if ((data.timeout_value != null) && (data.timeout_value > 0)) {
self.timeoutPopupOptions.text = self.timeoutPopupText + data.timeout_value; self.timeoutPopupOptions.text = self.timeoutPopupText + data.timeout_value;
if (data.power != null) {
self.timeoutPopupOptions.text = self.timeoutPopupText + data.power;
if (typeof self.timeoutPopup != "undefined") { if (typeof self.timeoutPopup != "undefined") {
self.timeoutPopup.update(self.timeoutPopupOptions); self.timeoutPopup.update(self.timeoutPopupOptions);
} else { } else {
self.timeoutPopup = new PNotify(self.timeoutPopupOptions); self.timeoutPopup = new PNotify(self.timeoutPopupOptions);
self.timeoutPopup.get().on('pnotify.cancel', function() {self.abortShutdown(true);}); self.timeoutPopup.get().on('pnotify.cancel', function() {self.abortShutdown(true);});
self.timeoutPopup.get().on('pnotify.cancel', function() {});
} }
} else { } else {
if (typeof self.timeoutPopup != "undefined") { if (typeof self.timeoutPopup != "undefined") {