#8 Relais ein / ausschalten von Ocotprint aus

This commit is contained in:
David Zingg 2019-11-24 16:44:13 +01:00
parent 81b5f2e5c3
commit bb9795b6df

View File

@ -22,27 +22,7 @@ $(function() {
} }
self.onmystromswitchEvent = 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); self.onOffButtonEnabled.subscribe(self.onmystromswitchEvent, self);