From 531d7956158538c399ce85d3cbd3f12d895d5950 Mon Sep 17 00:00:00 2001 From: David Zingg Date: Sat, 29 Feb 2020 16:55:20 +0100 Subject: [PATCH] #21 Add PowerOFF when print is finished --- octoprint_mystromswitch/static/js/mystromswitch.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/octoprint_mystromswitch/static/js/mystromswitch.js b/octoprint_mystromswitch/static/js/mystromswitch.js index 599d6e3..87c6fb3 100644 --- a/octoprint_mystromswitch/static/js/mystromswitch.js +++ b/octoprint_mystromswitch/static/js/mystromswitch.js @@ -7,8 +7,8 @@ $(function() { self.printer = parameters[2]; self.onOffButtonEnabled = ko.observable(); - //self.showShutdownOctopiOption = ko.observable(); - //self.showPowerOffPrintFinishOption = ko.observable(); + self.showShutdownOctopiOption = ko.observable(); + self.showPowerOffPrintFinishOption = ko.observable(); self.mystromswitchPowerValue = document.getElementById("mystromswitchPowerValue") self.mystromswitchEnergyValue = document.getElementById("mystromswitchEnergyValue") @@ -62,8 +62,8 @@ $(function() { }) } - //self.automaticShutdownEnabled.subscribe(self.onAutomaticShutdownEnabledChanged,self); - //self.automaticPowerOffEnabled.subscribe(self.onAutomaticPowerOffEnabledChanged,self); + self.automaticShutdownEnabled.subscribe(self.onAutomaticShutdownEnabledChanged,self); + self.automaticPowerOffEnabled.subscribe(self.onAutomaticPowerOffEnabledChanged,self); self.onDataUpdaterPluginMessage = function(plugin, data) { if (plugin != "mystromswitch" && plugin != "octoprint_mystromswitch") { @@ -79,6 +79,7 @@ $(function() { self.mystromswitchPowerValue.innerHTML = "Power Consumption "+data.power.toFixed(1)+"W"; }else{ self.mystromswitchPowerValue.innerHTML = "myStrom switch not reachable" + self.mystromswitchEnergyValue.innerHTML = "Check url in Plugin Settings" } } }