#21 Add PowerOFF when print is finished
This commit is contained in:
parent
c9608fa24f
commit
f30e769f6a
@ -48,13 +48,6 @@
|
|||||||
<option name="presentableId" value="Default" />
|
<option name="presentableId" value="Default" />
|
||||||
<updated>1574193087583</updated>
|
<updated>1574193087583</updated>
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00042" summary="#9 Relais ausschalten wenn Octoprint heruntergefahren wird #7 Relais einschalten wenn Octoprint gestartet wurde Api call fix">
|
|
||||||
<created>1574708245896</created>
|
|
||||||
<option name="number" value="00042" />
|
|
||||||
<option name="presentableId" value="LOCAL-00042" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1574708245896</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00043" summary="#9 Relais ausschalten wenn Octoprint heruntergefahren wird #7 Relais einschalten wenn Octoprint gestartet wurde Api call fix">
|
<task id="LOCAL-00043" summary="#9 Relais ausschalten wenn Octoprint heruntergefahren wird #7 Relais einschalten wenn Octoprint gestartet wurde Api call fix">
|
||||||
<created>1574708497039</created>
|
<created>1574708497039</created>
|
||||||
<option name="number" value="00043" />
|
<option name="number" value="00043" />
|
||||||
@ -391,7 +384,14 @@
|
|||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1593628617461</updated>
|
<updated>1593628617461</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="91" />
|
<task id="LOCAL-00091" summary="#21 Add PowerOFF when print is finished">
|
||||||
|
<created>1593629014910</created>
|
||||||
|
<option name="number" value="00091" />
|
||||||
|
<option name="presentableId" value="LOCAL-00091" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1593629014910</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="92" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="UnknownFeatures">
|
<component name="UnknownFeatures">
|
||||||
|
@ -193,8 +193,6 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
|||||||
data["automaticShutdownEnabled"] = self.shutdownAfterPrintFinished
|
data["automaticShutdownEnabled"] = self.shutdownAfterPrintFinished
|
||||||
data["automaticPowerOffEnabled"] = self.powerOffAfterPrintFinished
|
data["automaticPowerOffEnabled"] = self.powerOffAfterPrintFinished
|
||||||
self._plugin_manager.send_plugin_message(self._identifier, data)
|
self._plugin_manager.send_plugin_message(self._identifier, data)
|
||||||
self._logger.info("automaticShutdownEnabled: %s" % self.shutdownAfterPrintFinished)
|
|
||||||
self._logger.info("automaticPowerOffEnabled: %s" % self.powerOffAfterPrintFinished)
|
|
||||||
return
|
return
|
||||||
except (requests.exceptions.ConnectionError, ValueError) as e:
|
except (requests.exceptions.ConnectionError, ValueError) as e:
|
||||||
self._logger.exception(e)
|
self._logger.exception(e)
|
||||||
@ -282,24 +280,28 @@ 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._logger.info("lastShutdown: %s" % self.lastShutdown)
|
||||||
elif command == "disableShutdownAfterFinish":
|
elif command == "disableShutdownAfterFinish":
|
||||||
self._logger.info("disableShutdownAfterFinish")
|
self._logger.info("disableShutdownAfterFinish")
|
||||||
self.shutdownAfterPrintFinished = False
|
self.shutdownAfterPrintFinished = False
|
||||||
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._logger.info("lastShutdown: %s" % self.lastShutdown)
|
||||||
elif command == "enablePowerOffAfterFinish":
|
elif command == "enablePowerOffAfterFinish":
|
||||||
self._logger.info("enablePowerOffAfterFinish")
|
self._logger.info("enablePowerOffAfterFinish")
|
||||||
self.powerOffAfterPrintFinished = True
|
self.powerOffAfterPrintFinished = True
|
||||||
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._logger.info("lastPowerOff: %s" % self.lastPowerOff)
|
||||||
elif command == "disablePowerOffAfterFinish":
|
elif command == "disablePowerOffAfterFinish":
|
||||||
self._logger.info("disablePowerOffAfterFinish")
|
self._logger.info("disablePowerOffAfterFinish")
|
||||||
self.powerOffAfterPrintFinished = False
|
self.powerOffAfterPrintFinished = False
|
||||||
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._logger.info("lastPowerOff: %s" % self.lastPowerOff)
|
||||||
|
|
||||||
def get_api_commands(self):
|
def get_api_commands(self):
|
||||||
return dict(
|
return dict(
|
||||||
|
Loading…
Reference in New Issue
Block a user