From bb9795b6dfd1c2b363f701fa0115eee006880714 Mon Sep 17 00:00:00 2001 From: David Zingg Date: Sun, 24 Nov 2019 16:44:13 +0100 Subject: [PATCH] #8 Relais ein / ausschalten von Ocotprint aus --- .../static/js/mystromswitch.js | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/octoprint_mystromswitch/static/js/mystromswitch.js b/octoprint_mystromswitch/static/js/mystromswitch.js index 6e40889..e6bbbc3 100644 --- a/octoprint_mystromswitch/static/js/mystromswitch.js +++ b/octoprint_mystromswitch/static/js/mystromswitch.js @@ -22,27 +22,7 @@ $(function() { } self.onmystromswitchEvent = function() { - if (self.onOffButtonEnabled()) { - $.ajax({ - url: API_BASEURL + "plugin/mystromswitch", - type: "POST", - dataType: "json", - data: JSON.stringify({ - command: "enableRelais", - }), - contentType: "application/json; charset=UTF-8" - }) - } else { - $.ajax({ - url: API_BASEURL + "plugin/mystromswitch", - type: "POST", - dataType: "json", - data: JSON.stringify({ - command: "disableRelais", - }), - contentType: "application/json; charset=UTF-8" - }) - } + } self.onOffButtonEnabled.subscribe(self.onmystromswitchEvent, self);