#21 Add PowerOFF when print is finished

This commit is contained in:
David Zingg
2020-06-28 14:26:15 +02:00
parent 041fe67773
commit 42f80d831c
2 changed files with 12 additions and 16 deletions

View File

@ -204,11 +204,9 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
self._logger.info("disablePowerOffAfterFinish")
self.powerOffAfterPrintFinished = False
self._plugin_manager.send_plugin_message(self._identifier,
dict(showShutdownOctopiOption=self.shutdownAfterPrintFinished,
type="timeout", timeout_value=self._timeout_value))
dict(showShutdownOctopiOption=self.shutdownAfterPrintFinished))
self._plugin_manager.send_plugin_message(self._identifier,
dict(showPowerOffPrintFinishOption=self.powerOffAfterPrintFinished,
type="timeout", timeout_value=self._timeout_value))
dict(showPowerOffPrintFinishOption=self.powerOffAfterPrintFinished))
def get_api_commands(self):
return dict(
@ -279,11 +277,9 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
if event == Events.CLIENT_OPENED:
self._plugin_manager.send_plugin_message(self._identifier,
dict(showShutdownOctopiOption=self.shutdownAfterPrintFinished,
type="timeout", timeout_value=self._timeout_value))
dict(showShutdownOctopiOption=self.shutdownAfterPrintFinished))
self._plugin_manager.send_plugin_message(self._identifier,
dict(showPowerOffPrintFinishOption=self.powerOffAfterPrintFinished,
type="timeout", timeout_value=self._timeout_value))
dict(showPowerOffPrintFinishOption=self.powerOffAfterPrintFinished))
return
if not self.shutdownAfterPrintFinished and not self.powerOffAfterPrintFinished: