#21 Add PowerOFF when print is finished

This commit is contained in:
David Zingg 2020-07-01 21:01:36 +02:00
parent 5298d96d26
commit 5fe040d455
2 changed files with 13 additions and 8 deletions

17
.idea/workspace.xml generated
View File

@ -2,6 +2,7 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="7e2e0eec-b22e-4d48-8f24-196d1ed9b51a" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/octoprint_mystromswitch/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/octoprint_mystromswitch/__init__.py" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@ -47,13 +48,6 @@
<option name="presentableId" value="Default" />
<updated>1574193087583</updated>
</task>
<task id="LOCAL-00046" summary="#11 Energieverbrauch näherungsweise berechnen">
<created>1574712205852</created>
<option name="number" value="00046" />
<option name="presentableId" value="LOCAL-00046" />
<option name="project" value="LOCAL" />
<updated>1574712205852</updated>
</task>
<task id="LOCAL-00047" summary="#14 Einstellungen reorganisieren">
<created>1574873790898</created>
<option name="number" value="00047" />
@ -390,7 +384,14 @@
<option name="project" value="LOCAL" />
<updated>1593629491361</updated>
</task>
<option name="localTasksCounter" value="95" />
<task id="LOCAL-00095" summary="#21 Add PowerOFF when print is finished">
<created>1593629609079</created>
<option name="number" value="00095" />
<option name="presentableId" value="LOCAL-00095" />
<option name="project" value="LOCAL" />
<updated>1593629609079</updated>
</task>
<option name="localTasksCounter" value="96" />
<servers />
</component>
<component name="UnknownFeatures">

View File

@ -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(