Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
67934f7cb5 | |||
9afe94169d | |||
96fdafb2dc | |||
c5d8bbd863 | |||
96c2e954fa | |||
107a7ba9de | |||
809369f783 | |||
66889083fd | |||
ba797fe1cc |
79
.idea/workspace.xml
generated
79
.idea/workspace.xml
generated
@ -2,7 +2,8 @@
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="7e2e0eec-b22e-4d48-8f24-196d1ed9b51a" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/setup.py" beforeDir="false" afterPath="$PROJECT_DIR$/setup.py" afterDir="false" />
|
||||
<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" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
@ -47,41 +48,6 @@
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1574193087583</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00053" summary="#17 Logging zur Fehleranalyse eingebaut">
|
||||
<created>1578938604039</created>
|
||||
<option name="number" value="00053" />
|
||||
<option name="presentableId" value="LOCAL-00053" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1578938604039</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00054" summary="#17 Logging zur Fehleranalyse eingebaut">
|
||||
<created>1578939868815</created>
|
||||
<option name="number" value="00054" />
|
||||
<option name="presentableId" value="LOCAL-00054" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1578939868816</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00055" summary="#17 Logging zur Fehleranalyse eingebaut">
|
||||
<created>1578940345174</created>
|
||||
<option name="number" value="00055" />
|
||||
<option name="presentableId" value="LOCAL-00055" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1578940345174</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00056" summary="#17 Logging zur Fehleranalyse eingebaut">
|
||||
<created>1578941071143</created>
|
||||
<option name="number" value="00056" />
|
||||
<option name="presentableId" value="LOCAL-00056" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1578941071143</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00057" summary="#17 Logging zur Fehleranalyse eingebaut">
|
||||
<created>1579188503178</created>
|
||||
<option name="number" value="00057" />
|
||||
<option name="presentableId" value="LOCAL-00057" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1579188503178</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00058" summary="#17 Logging zur Fehleranalyse eingebaut">
|
||||
<created>1579190155814</created>
|
||||
<option name="number" value="00058" />
|
||||
@ -390,7 +356,42 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593631764282</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="102" />
|
||||
<task id="LOCAL-00102" summary="#24 API Token Support">
|
||||
<created>1593632006106</created>
|
||||
<option name="number" value="00102" />
|
||||
<option name="presentableId" value="LOCAL-00102" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593632006106</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00103" summary="#25 Python 3 Compatibility">
|
||||
<created>1593633576198</created>
|
||||
<option name="number" value="00103" />
|
||||
<option name="presentableId" value="LOCAL-00103" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593633576198</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00104" summary="#25 Python 3 Compatibility">
|
||||
<created>1593633696895</created>
|
||||
<option name="number" value="00104" />
|
||||
<option name="presentableId" value="LOCAL-00104" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593633696895</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00105" summary="#25 Python 3 Compatibility">
|
||||
<created>1595688504296</created>
|
||||
<option name="number" value="00105" />
|
||||
<option name="presentableId" value="LOCAL-00105" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1595688504296</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00106" summary="#25 Python 3 Compatibility">
|
||||
<created>1595688536404</created>
|
||||
<option name="number" value="00106" />
|
||||
<option name="presentableId" value="LOCAL-00106" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1595688536404</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="107" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="UnknownFeatures">
|
||||
@ -420,7 +421,6 @@
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="#5 Rest Api integration - Nullpointer fix" />
|
||||
<MESSAGE value="#6 UI Updates senden und anzeigen - unnötigen Code entfernen, erster Versuch" />
|
||||
<MESSAGE value="Revert "#6 UI Updates senden und anzeigen" This reverts commit f83d4259" />
|
||||
<MESSAGE value="#6 UI Updates senden und anzeigen" />
|
||||
@ -445,6 +445,7 @@
|
||||
<MESSAGE value="#22 Button taucht nicht auf Fehler anzeigen wenn Verbindung zu switch nicht klappt" />
|
||||
<MESSAGE value="#21 Add PowerOFF when print is finished" />
|
||||
<MESSAGE value="#24 API Token Support" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="#24 API Token Support" />
|
||||
<MESSAGE value="#25 Python 3 Compatibility" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="#25 Python 3 Compatibility" />
|
||||
</component>
|
||||
</project>
|
@ -162,13 +162,17 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
||||
self._status_timer.start()
|
||||
|
||||
def _shutdown_system(self):
|
||||
if not self._settings.global_get(["server", "commands", "systemShutdownCommand"]):
|
||||
self._logger.warning("systemShutdownCommand is not defined. Aborting shutdown...")
|
||||
return
|
||||
|
||||
self._logger.info("Shutdown Relais and System")
|
||||
self._powerCycleRelais(False, self.powerOffDelay)
|
||||
shutdown_command = self._settings.global_get(["server", "commands", "systemShutdownCommand"])
|
||||
self._logger.info("Shutting down system with command: {command}".format(command=shutdown_command))
|
||||
try:
|
||||
import sarge
|
||||
p = sarge.run(shutdown_command, async=True)
|
||||
p = sarge.run(shutdown_command, async_=True)
|
||||
except Exception as e:
|
||||
self._logger.exception("Error when shutting down: {error}".format(error=e))
|
||||
return
|
||||
@ -390,10 +394,6 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
||||
if not self.shutdownAfterPrintFinished and not self.powerOffAfterPrintFinished:
|
||||
return
|
||||
|
||||
if not self._settings.global_get(["server", "commands", "systemShutdownCommand"]):
|
||||
self._logger.warning("systemShutdownCommand is not defined. Aborting shutdown...")
|
||||
return
|
||||
|
||||
if event not in [Events.PRINT_DONE, Events.PRINT_FAILED]:
|
||||
return
|
||||
|
||||
@ -429,6 +429,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
||||
|
||||
|
||||
__plugin_name__ = "MyStrom Switch"
|
||||
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||
|
||||
|
||||
def __plugin_load__():
|
||||
|
@ -4,11 +4,11 @@
|
||||
<button class="btn btn-primary" data-bind="click: onToggleRelayEvent, visible : onOffButtonEnabled">{{ _('Toggle Relais') }}</button>
|
||||
<label class="checkbox" data-bind="visible :showShutdownOctopiOption">
|
||||
<input type="checkbox" data-bind="enable: loginState.isUser(), checked: automaticShutdownEnabled, visible :showShutdownOctopiOption">
|
||||
{{ _('Shutdown Octoprint after print finishes') }}
|
||||
{{ _('Shutdown Octoprint after print finished') }}
|
||||
</label>
|
||||
|
||||
<label class="checkbox" data-bind="visible: showPowerOffPrintFinishOption">
|
||||
<input type="checkbox" data-bind="enable: loginState.isUser(), checked: automaticPowerOffEnabled, visible: showPowerOffPrintFinishOption">
|
||||
{{ _('Power Off Relais after print finishes') }}
|
||||
{{ _('Power Off Relais after print finished') }}
|
||||
</label>
|
||||
</div>
|
||||
|
6
setup.py
6
setup.py
@ -14,7 +14,7 @@ plugin_package = "octoprint_mystromswitch"
|
||||
plugin_name = "OctoPrint-MyStromSwitch"
|
||||
|
||||
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
|
||||
plugin_version = "1.1.0"
|
||||
plugin_version = "1.2.1"
|
||||
|
||||
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
|
||||
# module
|
||||
@ -57,7 +57,9 @@ plugin_ignored_packages = []
|
||||
# Example:
|
||||
# plugin_requires = ["someDependency==dev"]
|
||||
# additional_setup_parameters = {"dependency_links": ["https://github.com/someUser/someRepo/archive/master.zip#egg=someDependency-dev"]}
|
||||
additional_setup_parameters = {}
|
||||
additional_setup_parameters = {
|
||||
"use_2to3": True,
|
||||
}
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
|
Reference in New Issue
Block a user