From 5fe040d45547dc38814f97e558ce4f800b161d85 Mon Sep 17 00:00:00 2001 From: David Zingg Date: Wed, 1 Jul 2020 21:01:36 +0200 Subject: [PATCH] #21 Add PowerOFF when print is finished --- .idea/workspace.xml | 17 +++++++++-------- octoprint_mystromswitch/__init__.py | 4 ++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4d4c83c..be7cd54 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,6 +2,7 @@ + diff --git a/octoprint_mystromswitch/__init__.py b/octoprint_mystromswitch/__init__.py index 656dcc9..36e3650 100644 --- a/octoprint_mystromswitch/__init__.py +++ b/octoprint_mystromswitch/__init__.py @@ -281,6 +281,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin, self.lastShutdown = self.shutdownAfterPrintFinished self._settings.set_boolean(["lastShutdown"], self.lastShutdown) self._settings.save() + self._logger.info("lastShutdown2: %s" % self.lastShutdown) elif command == "disableShutdownAfterFinish": self._logger.info("disableShutdownAfterFinish") self.shutdownAfterPrintFinished = False @@ -288,6 +289,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin, self.lastShutdown = self.shutdownAfterPrintFinished self._settings.set_boolean(["lastShutdown"], self.lastShutdown) self._settings.save() + self._logger.info("lastShutdown2: %s" % self.lastShutdown) elif command == "enablePowerOffAfterFinish": self._logger.info("enablePowerOffAfterFinish") self.powerOffAfterPrintFinished = True @@ -295,6 +297,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin, self.lastPowerOff = self.powerOffAfterPrintFinished self._settings.set_boolean(["lastPowerOff"], self.lastPowerOff) self._settings.save() + self._logger.info("lastPowerOff2: %s" % self.lastPowerOff) elif command == "disablePowerOffAfterFinish": self._logger.info("disablePowerOffAfterFinish") self.powerOffAfterPrintFinished = False @@ -302,6 +305,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin, self.lastPowerOff = self.powerOffAfterPrintFinished self._settings.set_boolean(["lastPowerOff"], self.lastPowerOff) self._settings.save() + self._logger.info("lastPowerOff2: %s" % self.lastPowerOff) def get_api_commands(self): return dict(