#21 Add PowerOFF when print is finished
This commit is contained in:
@ -276,10 +276,10 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
||||
def on_event(self, event, payload):
|
||||
|
||||
if event == Events.CLIENT_OPENED:
|
||||
self._plugin_manager.send_plugin_message(self._identifier,
|
||||
dict(automaticShutdownEnabled=self.shutdownAfterPrintFinished))
|
||||
self._plugin_manager.send_plugin_message(self._identifier,
|
||||
dict(automaticPowerOffEnabled=self.powerOffAfterPrintFinished))
|
||||
#self._plugin_manager.send_plugin_message(self._identifier,
|
||||
# dict(automaticShutdownEnabled=self.shutdownAfterPrintFinished))
|
||||
#self._plugin_manager.send_plugin_message(self._identifier,
|
||||
# dict(automaticPowerOffEnabled=self.powerOffAfterPrintFinished))
|
||||
return
|
||||
|
||||
if not self.shutdownAfterPrintFinished and not self.powerOffAfterPrintFinished:
|
||||
|
@ -3,12 +3,12 @@
|
||||
<label class="control-label" id="mystromswitchEnergyValue">Energy 0.0Wh</label>
|
||||
<button class="btn btn-primary" data-bind="click: onToggleRelayEvent, visible : onOffButtonEnabled">{{ _('Toggle Relais') }}</button>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="enable: loginState.isUser(), change: automaticShutdownEnabled, visible :showShutdownOctopiOption"/>
|
||||
<input type="checkbox" data-bind="enable: loginState.isUser(), change: automaticShutdownEnabled, visible :showShutdownOctopiOption">
|
||||
{{ _('Shutdown Octoprint after print finishes') }}
|
||||
</label>
|
||||
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="enable: loginState.isUser(), change: automaticPowerOffEnabled, visible: showPowerOffPrintFinishOption"/>
|
||||
<input type="checkbox" data-bind="enable: loginState.isUser(), change: automaticPowerOffEnabled, visible: showPowerOffPrintFinishOption">
|
||||
{{ _('Power Off Relais after print finishes') }}
|
||||
</label>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user