#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

View File

@ -2,7 +2,6 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="7e2e0eec-b22e-4d48-8f24-196d1ed9b51a" name="Default Changelist" comment=""> <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" /> <change beforePath="$PROJECT_DIR$/octoprint_mystromswitch/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/octoprint_mystromswitch/__init__.py" afterDir="false" />
</list> </list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@ -48,13 +47,6 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1574193087583</updated> <updated>1574193087583</updated>
</task> </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"> <task id="LOCAL-00045" summary="#11 Energieverbrauch näherungsweise berechnen">
<created>1574712024409</created> <created>1574712024409</created>
<option name="number" value="00045" /> <option name="number" value="00045" />
@ -391,7 +383,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1593629188987</updated> <updated>1593629188987</updated>
</task> </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 /> <servers />
</component> </component>
<component name="UnknownFeatures"> <component name="UnknownFeatures">

View File

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