Compare commits
73 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
e7bf0762d3 | ||
|
96fdafb2dc | ||
|
c5d8bbd863 | ||
|
dda93e73d3 | ||
|
96c2e954fa | ||
|
107a7ba9de | ||
|
809369f783 | ||
|
617f21a66e | ||
|
66889083fd | ||
|
1f5efa9c2a | ||
|
284d54ffa0 | ||
|
542a633559 | ||
|
6c208ce10b | ||
|
7d80c84393 | ||
|
b3e53821bb | ||
|
be81f64ec1 | ||
|
ca61b89b3f | ||
|
330577cc6e | ||
|
5fe040d455 | ||
|
5298d96d26 | ||
|
778821e5e5 | ||
|
72de3c4db6 | ||
|
f30e769f6a | ||
|
c9608fa24f | ||
|
af7a581620 | ||
|
cba3367d2b | ||
|
0816056ded | ||
|
92fd2846ac | ||
|
85e18076a0 | ||
|
d92daf48f4 | ||
|
4e8620c8ab | ||
|
6f96140e10 | ||
|
39ff47e829 | ||
|
ebb6391bda | ||
|
8ea9f65048 | ||
|
a3e770158c | ||
|
df2ee686ec | ||
|
cc1254f7f9 | ||
|
96280e4a4b | ||
|
01a63ab835 | ||
|
0d295dcbb6 | ||
|
5516428f9d | ||
|
c624769e9d | ||
|
42f80d831c | ||
|
041fe67773 | ||
|
78df6af17c | ||
|
2148d75b29 | ||
|
055e8c4e25 | ||
|
8b963a5cbb | ||
|
b5d23ef46f | ||
|
531d795615 | ||
|
1c3c49bab9 | ||
|
419bac3137 | ||
|
83608fa807 | ||
|
cc106e258c | ||
|
3d7cb06446 | ||
|
ba797fe1cc | ||
|
f9a9067bd5 | ||
|
c31d7b7bca | ||
|
48c283703d | ||
|
9015fd16de | ||
|
f8fa67a43d | ||
|
4a0136317b | ||
|
ad66d2df68 | ||
|
c1cdbeebad | ||
|
500ed07d79 | ||
|
a0a7b51a66 | ||
|
ccc58f9301 | ||
|
c56b076620 | ||
|
78f39e82f3 | ||
|
10702134ee | ||
|
3e74b23dbc | ||
|
ebc98694d1 |
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7 (venv)" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Uninitialized environment" project-jdk-type="Python SDK" />
|
||||
<component name="PyCharmProfessionalAdvertiser">
|
||||
<option name="shown" value="true" />
|
||||
</component>
|
||||
|
401
.idea/workspace.xml
generated
401
.idea/workspace.xml
generated
@ -2,11 +2,7 @@
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="7e2e0eec-b22e-4d48-8f24-196d1ed9b51a" name="Default Changelist" comment="">
|
||||
<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/static/css/shutdownprinter.css" beforeDir="false" afterPath="$PROJECT_DIR$/octoprint_mystromswitch/static/css/mystromswitch.css" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/octoprint_mystromswitch/static/js/shutdownprinter.js" beforeDir="false" afterPath="$PROJECT_DIR$/octoprint_mystromswitch/static/js/mystromswitch.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/octoprint_mystromswitch/templates/shutdownprinter_settings.jinja2" beforeDir="false" afterPath="$PROJECT_DIR$/octoprint_mystromswitch/templates/mystromswitch_settings.jinja2" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/octoprint_mystromswitch/templates/shutdownprinter_sidebar.jinja2" beforeDir="false" afterPath="$PROJECT_DIR$/octoprint_mystromswitch/templates/mystromswitch_sidebar.jinja2" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
</list>
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
@ -16,11 +12,17 @@
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||
<map>
|
||||
<entry key="$PROJECT_DIR$" value="master" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectId" id="1TqgYXT1S9U5eM0eUvs1YarA1ll" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
||||
<component name="PropertiesComponent">
|
||||
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/../LEDStrip/RaspberryPi/Python" />
|
||||
</component>
|
||||
<component name="RunDashboard">
|
||||
<option name="ruleStates">
|
||||
@ -45,17 +47,404 @@
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1574193087583</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" />
|
||||
<option name="presentableId" value="LOCAL-00058" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1579190155814</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00059" summary="#17 Logs aufgeräumt">
|
||||
<created>1579190259362</created>
|
||||
<option name="number" value="00059" />
|
||||
<option name="presentableId" value="LOCAL-00059" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1579190259362</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00060" summary="#17 Logs aufgeräumt">
|
||||
<created>1579192359403</created>
|
||||
<option name="number" value="00060" />
|
||||
<option name="presentableId" value="LOCAL-00060" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1579192359403</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00061" summary="#21 Add PowerOFF when print is finished neue Einstellmöglichkeiten anzeigen">
|
||||
<created>1582988883875</created>
|
||||
<option name="number" value="00061" />
|
||||
<option name="presentableId" value="LOCAL-00061" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1582988883875</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00062" summary="#22 Button taucht nicht auf Fehler anzeigen wenn Verbindung zu switch nicht klappt">
|
||||
<created>1582990110412</created>
|
||||
<option name="number" value="00062" />
|
||||
<option name="presentableId" value="LOCAL-00062" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1582990110412</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00063" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1582990799626</created>
|
||||
<option name="number" value="00063" />
|
||||
<option name="presentableId" value="LOCAL-00063" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1582990799626</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00064" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1582991033421</created>
|
||||
<option name="number" value="00064" />
|
||||
<option name="presentableId" value="LOCAL-00064" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1582991033421</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00065" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1582991352868</created>
|
||||
<option name="number" value="00065" />
|
||||
<option name="presentableId" value="LOCAL-00065" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1582991352868</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00066" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1582991720560</created>
|
||||
<option name="number" value="00066" />
|
||||
<option name="presentableId" value="LOCAL-00066" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1582991720560</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00067" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1582992279872</created>
|
||||
<option name="number" value="00067" />
|
||||
<option name="presentableId" value="LOCAL-00067" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1582992279872</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00068" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1582992989361</created>
|
||||
<option name="number" value="00068" />
|
||||
<option name="presentableId" value="LOCAL-00068" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1582992989361</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00069" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1582993317859</created>
|
||||
<option name="number" value="00069" />
|
||||
<option name="presentableId" value="LOCAL-00069" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1582993317859</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00070" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593346830444</created>
|
||||
<option name="number" value="00070" />
|
||||
<option name="presentableId" value="LOCAL-00070" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593346830445</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00071" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593346998123</created>
|
||||
<option name="number" value="00071" />
|
||||
<option name="presentableId" value="LOCAL-00071" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593346998123</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00072" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593347175159</created>
|
||||
<option name="number" value="00072" />
|
||||
<option name="presentableId" value="LOCAL-00072" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593347175159</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00073" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593347774339</created>
|
||||
<option name="number" value="00073" />
|
||||
<option name="presentableId" value="LOCAL-00073" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593347774339</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00074" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593347857755</created>
|
||||
<option name="number" value="00074" />
|
||||
<option name="presentableId" value="LOCAL-00074" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593347857755</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00075" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593347943336</created>
|
||||
<option name="number" value="00075" />
|
||||
<option name="presentableId" value="LOCAL-00075" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593347943336</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00076" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593348030528</created>
|
||||
<option name="number" value="00076" />
|
||||
<option name="presentableId" value="LOCAL-00076" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593348030528</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00077" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593348512259</created>
|
||||
<option name="number" value="00077" />
|
||||
<option name="presentableId" value="LOCAL-00077" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593348512259</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00078" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593348977898</created>
|
||||
<option name="number" value="00078" />
|
||||
<option name="presentableId" value="LOCAL-00078" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593348977898</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00079" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593350619006</created>
|
||||
<option name="number" value="00079" />
|
||||
<option name="presentableId" value="LOCAL-00079" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593350619006</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00080" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593352569980</created>
|
||||
<option name="number" value="00080" />
|
||||
<option name="presentableId" value="LOCAL-00080" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593352569980</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00081" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593352709926</created>
|
||||
<option name="number" value="00081" />
|
||||
<option name="presentableId" value="LOCAL-00081" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593352709926</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00082" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593353565224</created>
|
||||
<option name="number" value="00082" />
|
||||
<option name="presentableId" value="LOCAL-00082" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593353565224</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00083" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593354627917</created>
|
||||
<option name="number" value="00083" />
|
||||
<option name="presentableId" value="LOCAL-00083" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593354627917</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00084" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593354891881</created>
|
||||
<option name="number" value="00084" />
|
||||
<option name="presentableId" value="LOCAL-00084" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593354891881</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00085" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593356663020</created>
|
||||
<option name="number" value="00085" />
|
||||
<option name="presentableId" value="LOCAL-00085" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593356663020</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00086" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593627018087</created>
|
||||
<option name="number" value="00086" />
|
||||
<option name="presentableId" value="LOCAL-00086" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593627018088</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00087" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593627195608</created>
|
||||
<option name="number" value="00087" />
|
||||
<option name="presentableId" value="LOCAL-00087" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593627195608</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00088" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593628251128</created>
|
||||
<option name="number" value="00088" />
|
||||
<option name="presentableId" value="LOCAL-00088" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593628251128</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00089" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593628347105</created>
|
||||
<option name="number" value="00089" />
|
||||
<option name="presentableId" value="LOCAL-00089" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593628347105</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00090" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593628617461</created>
|
||||
<option name="number" value="00090" />
|
||||
<option name="presentableId" value="LOCAL-00090" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593628617461</updated>
|
||||
</task>
|
||||
<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>
|
||||
<task id="LOCAL-00092" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593629188987</created>
|
||||
<option name="number" value="00092" />
|
||||
<option name="presentableId" value="LOCAL-00092" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593629188987</updated>
|
||||
</task>
|
||||
<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>
|
||||
<task id="LOCAL-00094" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593629491361</created>
|
||||
<option name="number" value="00094" />
|
||||
<option name="presentableId" value="LOCAL-00094" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593629491361</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00095" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593629609079</created>
|
||||
<option name="number" value="00095" />
|
||||
<option name="presentableId" value="LOCAL-00095" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593629609079</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00096" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593630096392</created>
|
||||
<option name="number" value="00096" />
|
||||
<option name="presentableId" value="LOCAL-00096" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593630096392</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00097" summary="#21 Add PowerOFF when print is finished">
|
||||
<created>1593630227011</created>
|
||||
<option name="number" value="00097" />
|
||||
<option name="presentableId" value="LOCAL-00097" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593630227011</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00098" summary="#24 API Token Support">
|
||||
<created>1593630650365</created>
|
||||
<option name="number" value="00098" />
|
||||
<option name="presentableId" value="LOCAL-00098" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593630650365</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00099" summary="#24 API Token Support">
|
||||
<created>1593631193159</created>
|
||||
<option name="number" value="00099" />
|
||||
<option name="presentableId" value="LOCAL-00099" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593631193159</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00100" summary="#24 API Token Support">
|
||||
<created>1593631506549</created>
|
||||
<option name="number" value="00100" />
|
||||
<option name="presentableId" value="LOCAL-00100" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593631506549</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00101" summary="#24 API Token Support">
|
||||
<created>1593631764282</created>
|
||||
<option name="number" value="00101" />
|
||||
<option name="presentableId" value="LOCAL-00101" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1593631764282</updated>
|
||||
</task>
|
||||
<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>
|
||||
<option name="localTasksCounter" value="105" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="UnknownFeatures">
|
||||
<option featureType="com.intellij.fileTypeFactory" implementationName="*.js" />
|
||||
</component>
|
||||
<component name="Vcs.Log.History.Properties">
|
||||
<option name="COLUMN_ORDER">
|
||||
<list>
|
||||
<option value="0" />
|
||||
<option value="2" />
|
||||
<option value="3" />
|
||||
<option value="1" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
<State>
|
||||
<option name="COLUMN_ORDER" />
|
||||
</State>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<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" />
|
||||
<MESSAGE value="#6 UI Updates senden und anzeigen logs entfernt" />
|
||||
<MESSAGE value="#8 Relais ein / ausschalten von Ocotprint aus - Toggle Button anzeigen und Events eingebaut - Api funktionen für Relais ein / aus und toggle implementiert" />
|
||||
<MESSAGE value="#8 Relais ein / ausschalten von Ocotprint aus - Button Style auf default geändert - get_api_commands implementiert" />
|
||||
<MESSAGE value="#8 Relais ein / ausschalten von Ocotprint aus - url korrigiert" />
|
||||
<MESSAGE value="#8 Relais ein / ausschalten von Ocotprint aus - Toggle Button enable / disable in Einstellunge - Databinding von Button" />
|
||||
<MESSAGE value="#8 Relais ein / ausschalten von Ocotprint aus" />
|
||||
<MESSAGE value="#9 Relais ausschalten wenn Octoprint heruntergefahren wird #7 Relais einschalten wenn Octoprint gestartet wurde Logging schreibfehler Url Fix für Powercycle" />
|
||||
<MESSAGE value="#9 Relais ausschalten wenn Octoprint heruntergefahren wird #7 Relais einschalten wenn Octoprint gestartet wurde" />
|
||||
<MESSAGE value="#9 Relais ausschalten wenn Octoprint heruntergefahren wird #7 Relais einschalten wenn Octoprint gestartet wurde Api call fix" />
|
||||
<MESSAGE value="#13 Wenn Request fehlschägt max. 3x versuchen" />
|
||||
<MESSAGE value="#11 Energieverbrauch näherungsweise berechnen" />
|
||||
<MESSAGE value="#14 Einstellungen reorganisieren" />
|
||||
<MESSAGE value="#14 Einstellungen reorganisieren - Beschreibungen angepasst" />
|
||||
<MESSAGE value="#15 Beschreibung erstellen" />
|
||||
<MESSAGE value="#16 Codereview Octoprint Plugin Repo" />
|
||||
<MESSAGE value="#17 Logging zur Fehleranalyse eingebaut" />
|
||||
<MESSAGE value="#17 Logs aufgeräumt" />
|
||||
<MESSAGE value="#21 Add PowerOFF when print is finished neue Einstellmöglichkeiten anzeigen" />
|
||||
<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" />
|
||||
<MESSAGE value="#25 Python 3 Compatibility" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="#25 Python 3 Compatibility" />
|
||||
</component>
|
||||
</project>
|
27
README.md
27
README.md
@ -2,4 +2,31 @@
|
||||
|
||||
This OctoPrint plugin enables the system to control the myStrom switch and read the current Powerconsumption of your system
|
||||
|
||||
Settings Tab
|
||||
|
||||

|
||||
|
||||
Mainscreen
|
||||
You can see the Plugin on the bottom right
|
||||
|
||||

|
||||
|
||||
Switch is off
|
||||
|
||||

|
||||
|
||||
Switch is on
|
||||
|
||||

|
||||
|
||||
With toggle Button enabled
|
||||
|
||||

|
||||

|
||||
|
||||
## Setup
|
||||
|
||||
Install via the bundled [Plugin Manager](https://github.com/foosel/OctoPrint/wiki/Plugin:-Plugin-Manager)
|
||||
or manually using this URL:
|
||||
|
||||
https://github.com/da4id/OctoPrint-MyStromSwitch/archive/master.zip
|
BIN
fullscreen.png
Normal file
BIN
fullscreen.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 167 KiB |
@ -1,11 +1,11 @@
|
||||
# coding=utf-8
|
||||
from __future__ import absolute_import
|
||||
|
||||
import ssl
|
||||
import time
|
||||
|
||||
import octoprint.plugin
|
||||
import requests
|
||||
import ssl
|
||||
import time
|
||||
from octoprint.events import eventManager, Events
|
||||
from octoprint.util import RepeatedTimer
|
||||
|
||||
|
||||
@ -13,18 +13,32 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
||||
octoprint.plugin.AssetPlugin,
|
||||
octoprint.plugin.TemplatePlugin,
|
||||
octoprint.plugin.StartupPlugin,
|
||||
octoprint.plugin.EventHandlerPlugin,
|
||||
octoprint.plugin.SimpleApiPlugin,
|
||||
octoprint.plugin.ShutdownPlugin):
|
||||
|
||||
def __init__(self):
|
||||
self.ip = None
|
||||
self.token = ""
|
||||
self.intervall = 1
|
||||
self.onOffButtonEnabled = False
|
||||
self.powerOnOnStart = False
|
||||
self.powerOffOnShutdown = False
|
||||
self.powerOffDelay = 0
|
||||
self.showShutdownOctopiOption = False
|
||||
self.showPowerOffPrintFinishOption = False
|
||||
self.shutdownDelay = 60
|
||||
|
||||
self._timer = None
|
||||
self.rememberShutdown = False
|
||||
self.lastPowerOff = False
|
||||
self.lastShutdown = False
|
||||
|
||||
self.shutdownAfterPrintFinished = self.lastShutdown if self.rememberShutdown else False
|
||||
self.powerOffAfterPrintFinished = self.lastPowerOff if self.rememberShutdown else False
|
||||
|
||||
self._status_timer = None
|
||||
self._abort_timer = None
|
||||
self._wait_for_timelapse_timer = None
|
||||
|
||||
self.energy = 0
|
||||
self.lastTimeStamp = 0
|
||||
@ -37,6 +51,9 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
||||
self.ip = self._settings.get(["ip"])
|
||||
self._logger.debug("ip: %s" % self.ip)
|
||||
|
||||
self.token = self._settings.get(["token"])
|
||||
self._logger.debug("token: %s" % self.token)
|
||||
|
||||
self.intervall = self._settings.get_int(["intervall"])
|
||||
self._logger.debug("intervall: %s" % self.intervall)
|
||||
|
||||
@ -52,7 +69,29 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
||||
self.powerOffDelay = self._settings.get_int(["powerOffDelay"])
|
||||
self._logger.debug("powerOffDelay: %s" % self.powerOffDelay)
|
||||
|
||||
self._timer_start()
|
||||
self.showShutdownOctopiOption = self._settings.get_boolean(["showShutdownOctopiOption"])
|
||||
self._logger.debug("showShutdownOctopiOption: %s" % self.showShutdownOctopiOption)
|
||||
|
||||
self.showPowerOffPrintFinishOption = self._settings.get_boolean(["showPowerOffPrintFinishOption"])
|
||||
self._logger.debug("showPowerOffPrintFinishOption: %s" % self.showPowerOffPrintFinishOption)
|
||||
|
||||
self.shutdownDelay = self._settings.get_int(["shutdownDelay"])
|
||||
self._logger.debug("shutdownDelay: %s" % self.shutdownDelay)
|
||||
|
||||
self.rememberShutdown = self._settings.get_boolean(["rememberShutdown"])
|
||||
self._logger.info("rememberShutdown: %s" % self.rememberShutdown)
|
||||
|
||||
self.lastPowerOff = self._settings.get_boolean(["lastPowerOff"])
|
||||
self._logger.info("lastPowerOff: %s" % self.lastPowerOff)
|
||||
|
||||
self.lastShutdown = self._settings.get_boolean(["lastShutdown"])
|
||||
self._logger.info("lastShutdown: %s" % self.lastShutdown)
|
||||
|
||||
if self.rememberShutdown:
|
||||
self.powerOffAfterPrintFinished = self.lastPowerOff
|
||||
self.shutdownAfterPrintFinished = self.lastShutdown
|
||||
|
||||
self._status_timer_start()
|
||||
|
||||
def get_assets(self):
|
||||
return dict(js=["js/mystromswitch.js"], css=["css/mystromswitch.css"])
|
||||
@ -64,21 +103,82 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
||||
icon="power-off"),
|
||||
dict(type="settings", custom_bindings=False)]
|
||||
|
||||
def _timer_start(self):
|
||||
if self._timer is not None:
|
||||
self._timer.cancel()
|
||||
def _shutdown_timer_start(self):
|
||||
if self._abort_timer is not None:
|
||||
return
|
||||
self._logger.info("_shutdown_timer_start")
|
||||
|
||||
if self._wait_for_timelapse_timer is not None:
|
||||
self._wait_for_timelapse_timer.cancel()
|
||||
|
||||
self._logger.info("Starting abort shutdown timer.")
|
||||
|
||||
self._timeout_value = self.shutdownDelay
|
||||
self._abort_timer = RepeatedTimer(1, self._shutdown_timer_task)
|
||||
self._abort_timer.start()
|
||||
|
||||
def _wait_for_timelapse_start(self):
|
||||
if self._wait_for_timelapse_timer is not None:
|
||||
return
|
||||
self._logger.info("_wait_for_timelapse_start()")
|
||||
|
||||
self._wait_for_timelapse_timer = RepeatedTimer(5, self._wait_for_timelapse)
|
||||
self._wait_for_timelapse_timer.start()
|
||||
|
||||
def _wait_for_timelapse(self):
|
||||
c = len(octoprint.timelapse.get_unrendered_timelapses())
|
||||
|
||||
if c > 0:
|
||||
self._logger.info("Waiting for %s timelapse(s) to finish rendering before starting shutdown timer..." % c)
|
||||
else:
|
||||
self._shutdown_timer_start()
|
||||
|
||||
def _shutdown_timer_task(self):
|
||||
if self._timeout_value is None:
|
||||
return
|
||||
|
||||
self._timeout_value -= 1
|
||||
if self._timeout_value <= 0:
|
||||
if self._wait_for_timelapse_timer is not None:
|
||||
self._wait_for_timelapse_timer.cancel()
|
||||
self._wait_for_timelapse_timer = None
|
||||
if self._abort_timer is not None:
|
||||
self._abort_timer.cancel()
|
||||
self._abort_timer = None
|
||||
if self.shutdownAfterPrintFinished and self.showShutdownOctopiOption:
|
||||
self._shutdown_system()
|
||||
elif self.powerOffAfterPrintFinished and self.showPowerOffPrintFinishOption:
|
||||
self._logger.info("only Shutdown Relais")
|
||||
self._setRelaisState(False)
|
||||
|
||||
def _status_timer_start(self):
|
||||
if self._status_timer is not None:
|
||||
self._status_timer.cancel()
|
||||
self._logger.info("Canceling Timer")
|
||||
|
||||
if self.intervall >= 1 and self.ip is not None:
|
||||
self._logger.info("Starting timer")
|
||||
self._timer = RepeatedTimer(self.intervall, self._timer_task)
|
||||
self._timer.start()
|
||||
self._status_timer = RepeatedTimer(self.intervall, self._status_timer_task)
|
||||
self._status_timer.start()
|
||||
|
||||
def _timer_task(self):
|
||||
def _shutdown_system(self):
|
||||
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)
|
||||
except Exception as e:
|
||||
self._logger.exception("Error when shutting down: {error}".format(error=e))
|
||||
return
|
||||
|
||||
def _status_timer_task(self):
|
||||
if self.ip is not None:
|
||||
try:
|
||||
try:
|
||||
request = requests.get(
|
||||
'http://{}/report'.format(self.ip), timeout=1)
|
||||
'http://{}/report'.format(self.ip), headers={"Token": self.token}, timeout=1)
|
||||
if request.status_code == 200:
|
||||
timestamp = time.time()
|
||||
data = request.json()
|
||||
@ -86,24 +186,41 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
||||
intervall = timestamp - self.lastTimeStamp
|
||||
# Energy in Wh
|
||||
self.energy = self.energy + (intervall * data["power"] / 3600)
|
||||
self._logger.debug(
|
||||
"Energy: " + str(self.energy) + " interval: " + str(intervall) + " power: " + str(
|
||||
data["power"]))
|
||||
self.lastTimeStamp = timestamp
|
||||
data["energy"] = self.energy
|
||||
data["onOffButtonEnabled"] = self.onOffButtonEnabled
|
||||
data["showShutdownOctopiOption"] = self.showShutdownOctopiOption
|
||||
data["showPowerOffPrintFinishOption"] = self.showPowerOffPrintFinishOption
|
||||
data["automaticShutdownEnabled"] = self.shutdownAfterPrintFinished
|
||||
data["automaticPowerOffEnabled"] = self.powerOffAfterPrintFinished
|
||||
self._plugin_manager.send_plugin_message(self._identifier, data)
|
||||
except (requests.exceptions.ConnectionError, ValueError):
|
||||
self._logger.info('Connection Error Host: {}'.format(self.ip))
|
||||
return
|
||||
except (requests.exceptions.ConnectionError, ValueError) as e:
|
||||
self._logger.exception(e)
|
||||
except Exception as exp:
|
||||
self._logger.exception(exp)
|
||||
else:
|
||||
self._logger.info("Ip is None")
|
||||
data = {"relay": True, "energy": 0, "onOffButtonEnabled": False, "showShutdownOctopiOption": False,
|
||||
"showPowerOffPrintFinishOption": False, "automaticShutdownEnabled": self.shutdownAfterPrintFinished,
|
||||
"automaticPowerOffEnabled": self.powerOffAfterPrintFinished}
|
||||
self._plugin_manager.send_plugin_message(self._identifier, data)
|
||||
|
||||
def _setRelaisState(self, newState):
|
||||
nbRetry = 0
|
||||
value = '0'
|
||||
if (newState == True):
|
||||
if newState:
|
||||
value = '1'
|
||||
while nbRetry < 3:
|
||||
try:
|
||||
headers = {}
|
||||
if self.token is not None and self.token != "":
|
||||
headers = {"Token": self.token}
|
||||
request = requests.get(
|
||||
'http://{}/relay'.format(self.ip), params={'state': value}, timeout=1)
|
||||
'http://{}/relay'.format(self.ip), params={'state': value}, headers=headers, timeout=1)
|
||||
if request.status_code == 200:
|
||||
return
|
||||
else:
|
||||
@ -123,14 +240,22 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
||||
value = 'off'
|
||||
while nbRetry < 3:
|
||||
try:
|
||||
try:
|
||||
self._logger.info("try to send Powercycle Request")
|
||||
self._logger.info('http://{}/timer'.format(self.ip))
|
||||
request = requests.post(
|
||||
'http://{}/timer'.format(self.ip), params={'mode': value, 'time': time}, timeout=1)
|
||||
'http://{}/timer'.format(self.ip), params={'mode': value, 'time': time}, headers={"Token": self.token},
|
||||
timeout=1)
|
||||
if request.status_code == 200:
|
||||
return
|
||||
else:
|
||||
self._logger.info("Could not powerCycle Relais, Http Status Code: {}".format(request.status_code))
|
||||
except requests.exceptions.ConnectionError:
|
||||
self._logger.info("Error during powerCycle Relais")
|
||||
self._logger.info(
|
||||
"Could not powerCycle Relais, Http Status Code: {}".format(request.status_code))
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
self._logger.exception(e)
|
||||
self._logger.info("Error during powerCycle Relais: " + str(e.message))
|
||||
except Exception as exp:
|
||||
self._logger.exception(exp)
|
||||
nbRetry = nbRetry + 1
|
||||
|
||||
def _toggleRelay(self):
|
||||
@ -138,7 +263,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
||||
while nbRetry < 3:
|
||||
try:
|
||||
request = requests.get(
|
||||
'http://{}/toggle'.format(self.ip), timeout=1)
|
||||
'http://{}/toggle'.format(self.ip), headers={"Token": self.token}, timeout=1)
|
||||
if request.status_code == 200:
|
||||
return
|
||||
else:
|
||||
@ -157,12 +282,44 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
||||
elif command == "toggleRelais":
|
||||
self._logger.info("toggleRelais")
|
||||
self._toggleRelay()
|
||||
elif command == "enableShutdownAfterFinish":
|
||||
self._logger.info("enableShutdownAfterFinish")
|
||||
self.shutdownAfterPrintFinished = True
|
||||
if self.rememberShutdown:
|
||||
self.lastShutdown = self.shutdownAfterPrintFinished
|
||||
self._settings.set_boolean(["lastShutdown"], self.lastShutdown)
|
||||
self._settings.save()
|
||||
elif command == "disableShutdownAfterFinish":
|
||||
self._logger.info("disableShutdownAfterFinish")
|
||||
self.shutdownAfterPrintFinished = False
|
||||
if self.rememberShutdown:
|
||||
self.lastShutdown = self.shutdownAfterPrintFinished
|
||||
self._settings.set_boolean(["lastShutdown"], self.lastShutdown)
|
||||
self._settings.save()
|
||||
elif command == "enablePowerOffAfterFinish":
|
||||
self._logger.info("enablePowerOffAfterFinish")
|
||||
self.powerOffAfterPrintFinished = True
|
||||
if self.rememberShutdown:
|
||||
self.lastPowerOff = self.powerOffAfterPrintFinished
|
||||
self._settings.set_boolean(["lastPowerOff"], self.lastPowerOff)
|
||||
self._settings.save()
|
||||
elif command == "disablePowerOffAfterFinish":
|
||||
self._logger.info("disablePowerOffAfterFinish")
|
||||
self.powerOffAfterPrintFinished = False
|
||||
if self.rememberShutdown:
|
||||
self.lastPowerOff = self.powerOffAfterPrintFinished
|
||||
self._settings.set_boolean(["lastPowerOff"], self.lastPowerOff)
|
||||
self._settings.save()
|
||||
|
||||
def get_api_commands(self):
|
||||
return dict(
|
||||
enableRelais=[],
|
||||
disableRelais=[],
|
||||
toggleRelais=[]
|
||||
toggleRelais=[],
|
||||
disableShutdownAfterFinish=[],
|
||||
enableShutdownAfterFinish=[],
|
||||
disablePowerOffAfterFinish=[],
|
||||
enablePowerOffAfterFinish=[]
|
||||
)
|
||||
|
||||
def on_after_startup(self):
|
||||
@ -171,9 +328,10 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
||||
self._setRelaisState(True)
|
||||
|
||||
def on_shutdown(self):
|
||||
self._logger.info("on_shutdown_event")
|
||||
if self.powerOffOnShutdown:
|
||||
if self.powerOffDelay <= 0:
|
||||
self._logger.info("Turn on Relais off Shutdown")
|
||||
self._logger.info("Turn off Relais on Shutdown")
|
||||
self._setRelaisState(False)
|
||||
else:
|
||||
self._logger.info("Turn off Relais on Shutdown Delayed")
|
||||
@ -183,30 +341,75 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
||||
if target > current:
|
||||
if current <= 1:
|
||||
self.onOffButtonEnabled = False
|
||||
pass
|
||||
if current <= 2:
|
||||
self.powerOnOnStart = False,
|
||||
self.powerOffOnShutdown = False,
|
||||
self.powerOffDelay = 0
|
||||
if current <= 3:
|
||||
self.showShutdownOctopiOption = False
|
||||
self.showPowerOffPrintFinishOption = False
|
||||
self.shutdownDelay = 60
|
||||
if current <= 4:
|
||||
self.lastShutdown = False
|
||||
self.lastPowerOff = False
|
||||
self.rememberShutdown = False
|
||||
if current <= 5:
|
||||
self.token = ""
|
||||
|
||||
def get_settings_version(self):
|
||||
return 3
|
||||
return 6
|
||||
|
||||
def get_settings_defaults(self):
|
||||
return dict(
|
||||
ip=None,
|
||||
token="",
|
||||
intervall=1,
|
||||
onOffButtonEnabled=False,
|
||||
owerOnOnStart=False,
|
||||
powerOnOnStart=False,
|
||||
powerOffOnShutdown=False,
|
||||
powerOffDelay=0
|
||||
powerOffDelay=0,
|
||||
showShutdownOctopiOption=False,
|
||||
showPowerOffPrintFinishOption=False,
|
||||
shutdownDelay=60,
|
||||
lastShutdown=False,
|
||||
lastPowerOff=False,
|
||||
rememberShutdown=False
|
||||
)
|
||||
|
||||
def get_settings_restricted_paths(self):
|
||||
return dict(admin=[
|
||||
['ip', 'token']
|
||||
])
|
||||
|
||||
def on_settings_save(self, data):
|
||||
self._logger.info("on_settings_save")
|
||||
octoprint.plugin.SettingsPlugin.on_settings_save(self, data)
|
||||
self.initialize()
|
||||
|
||||
def on_event(self, event, payload):
|
||||
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
|
||||
|
||||
if event == Events.PRINT_FAILED and not self._printer.is_closed_or_error():
|
||||
# Cancelled job
|
||||
return
|
||||
|
||||
if event in [Events.PRINT_DONE, Events.PRINT_FAILED]:
|
||||
webcam_config = self._settings.global_get(["webcam", "timelapse"], merged=True)
|
||||
timelapse_type = webcam_config["type"]
|
||||
if (timelapse_type is not None and timelapse_type != "off"):
|
||||
self._wait_for_timelapse_start()
|
||||
else:
|
||||
self._shutdown_timer_start()
|
||||
return
|
||||
|
||||
def get_update_information(self):
|
||||
return dict(
|
||||
mystromswitch=dict(
|
||||
@ -226,6 +429,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
|
||||
|
||||
|
||||
__plugin_name__ = "MyStrom Switch"
|
||||
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||
|
||||
|
||||
def __plugin_load__():
|
||||
|
@ -7,6 +7,10 @@ $(function() {
|
||||
self.printer = parameters[2];
|
||||
|
||||
self.onOffButtonEnabled = ko.observable();
|
||||
self.showShutdownOctopiOption = ko.observable();
|
||||
self.showPowerOffPrintFinishOption = ko.observable();
|
||||
self.automaticPowerOffEnabled = ko.observable();
|
||||
self.automaticShutdownEnabled = ko.observable();
|
||||
self.mystromswitchPowerValue = document.getElementById("mystromswitchPowerValue")
|
||||
self.mystromswitchEnergyValue = document.getElementById("mystromswitchEnergyValue")
|
||||
|
||||
@ -22,23 +26,65 @@ $(function() {
|
||||
})
|
||||
}
|
||||
|
||||
self.onmystromswitchEvent = function() {
|
||||
//self.onmystromswitchEvent = function() {
|
||||
|
||||
//}
|
||||
|
||||
//self.onOffButtonEnabled.subscribe(self.onmystromswitchEvent, self);
|
||||
|
||||
self.onAutomaticShutdownEnabledChanged = function(){
|
||||
var cmd = "disableShutdownAfterFinish";
|
||||
if (self.automaticShutdownEnabled()) {
|
||||
var cmd = "enableShutdownAfterFinish";
|
||||
}
|
||||
$.ajax({
|
||||
url: API_BASEURL + "plugin/mystromswitch",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: JSON.stringify({
|
||||
command: cmd
|
||||
}),
|
||||
contentType: "application/json; charset=UTF-8"
|
||||
})
|
||||
}
|
||||
|
||||
self.onOffButtonEnabled.subscribe(self.onmystromswitchEvent, self);
|
||||
self.onAutomaticPowerOffEnabledChanged = function(){
|
||||
var cmd = "disablePowerOffAfterFinish";
|
||||
if (self.automaticPowerOffEnabled()) {
|
||||
var cmd = "enablePowerOffAfterFinish";
|
||||
}
|
||||
$.ajax({
|
||||
url: API_BASEURL + "plugin/mystromswitch",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: JSON.stringify({
|
||||
command: cmd
|
||||
}),
|
||||
contentType: "application/json; charset=UTF-8"
|
||||
})
|
||||
}
|
||||
|
||||
self.automaticShutdownEnabled.subscribe(self.onAutomaticShutdownEnabledChanged, self);
|
||||
self.automaticPowerOffEnabled.subscribe(self.onAutomaticPowerOffEnabledChanged, self);
|
||||
|
||||
self.onDataUpdaterPluginMessage = function(plugin, data) {
|
||||
if (plugin != "mystromswitch" && plugin != "octoprint_mystromswitch") {
|
||||
return;
|
||||
}
|
||||
self.onOffButtonEnabled(data.onOffButtonEnabled);
|
||||
self.showShutdownOctopiOption(data.showShutdownOctopiOption);
|
||||
self.showPowerOffPrintFinishOption(data.showPowerOffPrintFinishOption);
|
||||
self.mystromswitchEnergyValue.innerHTML = "Energy: "+data.energy.toFixed(1)+"Wh"
|
||||
if(data.relay == false){
|
||||
self.mystromswitchPowerValue.innerHTML = "Relay is off";
|
||||
} else if (data.power != null) {
|
||||
self.mystromswitchPowerValue.innerHTML = "Power Consumption "+data.power.toFixed(1)+"W";
|
||||
}else{
|
||||
self.mystromswitchPowerValue.innerHTML = "myStrom switch not reachable"
|
||||
self.mystromswitchEnergyValue.innerHTML = "Check url in Plugin Settings"
|
||||
}
|
||||
self.automaticShutdownEnabled(data.automaticShutdownEnabled);
|
||||
self.automaticPowerOffEnabled(data.automaticPowerOffEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,28 +1,39 @@
|
||||
<form class="form-horizontal">
|
||||
<h4>General</h4>
|
||||
<hr>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('IP-Address') }}</label>
|
||||
<label class="control-label">{{ _('URL or IP-Address of your switch (without http)') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: settings.plugins.mystromswitch.ip">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('API Token') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: settings.plugins.mystromswitch.token">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Refresh Intervall</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
<input type="number" class="input-mini text-right" data-bind="value: settings.plugins.mystromswitch.intervall">
|
||||
<span class="add-on">sec</span>
|
||||
</div>
|
||||
<span class="add-on">seconds</span>
|
||||
</div>
|
||||
<span class="help-block"><small>{{ _('Intervall in seconds where relays state, power and energy consumption are refreshed') }}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<h4>Octoprint Hardware (Raspberry Pi) is not switched on/off by the relais</h4>
|
||||
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: settings.plugins.mystromswitch.onOffButtonEnabled">Toggle Button Enabled
|
||||
</label>
|
||||
<span class="help-block"><small>{{ _('Shows an on/off Button on the left side to switch the relays on or off. This setting is only recommended if only your printer is switched on/off') }}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -31,21 +42,70 @@
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: settings.plugins.mystromswitch.powerOnOnStart">Turn relais ON on Octoprint start
|
||||
</label>
|
||||
<span class="help-block"><small>{{ _('This setting switches your mySwitch on if Octoprint is starting up. Turn relays OFF on Octoprint shutdown could also be interesting for you') }}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<h4>Octoprint Hardware (Raspberry Pi) is switched on/off by the relais</h4>
|
||||
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: settings.plugins.mystromswitch.powerOffOnShutdown">Turn relais OFF on Octoprint shutdown
|
||||
</label>
|
||||
<span class="help-block"><small>{{ _('This setting switches your mySwitch off if Octoprint is shutting down. If your Raspberry Pi is also switched by the relays its recommended to use an turn relay off delay of 60 seconds or more. Keep in mind this switches also off if you restart Octoprint service!') }}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Turn Relais Off Delay') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
<input type="number" class="input-block-level" data-bind="value: settings.plugins.mystromswitch.powerOffDelay">
|
||||
<span class="add-on">seconds</span>
|
||||
</div>
|
||||
<span class="help-block"><small>{{ _('Delay in seconds after octoprint is shutted down to switch off relays. This settings is recommended to make sure that Raspberry Pi is completely shutted down when you switch power off. Switching off when your Raspberry Pi is running could lead to unrepairable damage to your SD Card!') }}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4>Automatic Power Off Features</h4>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: settings.plugins.mystromswitch.rememberShutdown">remember Shutdown
|
||||
</label>
|
||||
<span class="help-block"><small>{{ _('Remember state of the checkboxes after reboot') }}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: settings.plugins.mystromswitch.showShutdownOctopiOption">Show option to automatic shutdown Octoprint after Print is finished
|
||||
</label>
|
||||
<span class="help-block"><small>{{ _('This setting shows the option to shut Octoprint down and switch your mySwitch off after your Print is finished. Use the "Delay after print is finished" option to determine after how many seconds Octoprint will be shutted down. After this use "Turn Relais Off Delay" to determine after how many seconds the Relas will be switched off') }}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: settings.plugins.mystromswitch.showPowerOffPrintFinishOption">Show option to turn off Relais after Print is finished
|
||||
</label>
|
||||
<span class="help-block"><small>{{ _('This setting shows the option to only switch your mySwitch off after your Print is finished. Use the "Delay after print is finished" Option to determine after how many seconds the Relais will switch off') }}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Delay after print is finished') }}</label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
<input type="number" class="input-block-level" data-bind="value: settings.plugins.mystromswitch.shutdownDelay">
|
||||
<span class="add-on">seconds</span>
|
||||
</div>
|
||||
<span class="help-block"><small>{{ _('Delay in seconds after after print is finished') }}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
@ -2,4 +2,13 @@
|
||||
<label class="control-label" id="mystromswitchPowerValue">Powerconsumption 0.0W</label>
|
||||
<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" data-bind="visible :showShutdownOctopiOption">
|
||||
<input type="checkbox" data-bind="enable: loginState.isUser(), checked: automaticShutdownEnabled, visible :showShutdownOctopiOption">
|
||||
{{ _('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 finished') }}
|
||||
</label>
|
||||
</div>
|
||||
|
BIN
settings_page.png
Normal file
BIN
settings_page.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 159 KiB |
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 = "0.4.0"
|
||||
plugin_version = "1.2.0"
|
||||
|
||||
# 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,
|
||||
}
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
|
BIN
sidebar_off.png
Normal file
BIN
sidebar_off.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
BIN
sidebar_off_button.png
Normal file
BIN
sidebar_off_button.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
sidebar_on.png
Normal file
BIN
sidebar_on.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
BIN
sidebar_on_button.png
Normal file
BIN
sidebar_on_button.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
Loading…
x
Reference in New Issue
Block a user