#21 Add PowerOFF when print is finished

This commit is contained in:
David Zingg 2020-07-01 20:51:31 +02:00
parent 72de3c4db6
commit 778821e5e5
2 changed files with 12 additions and 9 deletions

17
.idea/workspace.xml generated
View File

@ -2,7 +2,6 @@
<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" />
@ -48,13 +47,6 @@
<option name="presentableId" value="Default" />
<updated>1574193087583</updated>
</task>
<task id="LOCAL-00044" summary="#13 Wenn Request fehlschägt max. 3x versuchen">
<created>1574710870028</created>
<option name="number" value="00044" />
<option name="presentableId" value="LOCAL-00044" />
<option name="project" value="LOCAL" />
<updated>1574710870028</updated>
</task>
<task id="LOCAL-00045" summary="#11 Energieverbrauch näherungsweise berechnen">
<created>1574712024409</created>
<option name="number" value="00045" />
@ -391,7 +383,14 @@
<option name="project" value="LOCAL" />
<updated>1593629188987</updated>
</task>
<option name="localTasksCounter" value="93" />
<task id="LOCAL-00093" summary="#21 Add PowerOFF when print is finished">
<created>1593629352018</created>
<option name="number" value="00093" />
<option name="presentableId" value="LOCAL-00093" />
<option name="project" value="LOCAL" />
<updated>1593629352018</updated>
</task>
<option name="localTasksCounter" value="94" />
<servers />
</component>
<component name="UnknownFeatures">

View File

@ -280,6 +280,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
if self.rememberShutdown:
self.lastShutdown = self.shutdownAfterPrintFinished
self._settings.set_boolean(["lastShutdown"], self.lastShutdown)
self._settings.save()
self._logger.info("lastShutdown: %s" % self.lastShutdown)
elif command == "disableShutdownAfterFinish":
self._logger.info("disableShutdownAfterFinish")
@ -287,6 +288,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
if self.rememberShutdown:
self.lastShutdown = self.shutdownAfterPrintFinished
self._settings.set_boolean(["lastShutdown"], self.lastShutdown)
self._settings.save()
self._logger.info("lastShutdown: %s" % self.lastShutdown)
elif command == "enablePowerOffAfterFinish":
self._logger.info("enablePowerOffAfterFinish")
@ -294,6 +296,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
if self.rememberShutdown:
self.lastPowerOff = self.powerOffAfterPrintFinished
self._settings.set_boolean(["lastPowerOff"], self.lastPowerOff)
self._settings.save()
self._logger.info("lastPowerOff: %s" % self.lastPowerOff)
elif command == "disablePowerOffAfterFinish":
self._logger.info("disablePowerOffAfterFinish")
@ -301,6 +304,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
if self.rememberShutdown:
self.lastPowerOff = self.powerOffAfterPrintFinished
self._settings.set_boolean(["lastPowerOff"], self.lastPowerOff)
self._settings.save()
self._logger.info("lastPowerOff: %s" % self.lastPowerOff)
def get_api_commands(self):