6 Commits
0.4.0 ... 1.0.1

Author SHA1 Message Date
ccc58f9301 Codereview Octoprint Plugin Repo 2019-12-01 10:29:03 +01:00
c56b076620 Beschreibung erstellen 2019-11-27 18:39:09 +01:00
78f39e82f3 Beschreibung erstellen 2019-11-27 18:37:04 +01:00
10702134ee Einstellungen reorganisieren
- Beschreibungen angepasst
2019-11-27 18:04:46 +01:00
3e74b23dbc Einstellungen reorganisieren 2019-11-27 17:56:49 +01:00
ebc98694d1 Einstellungen reorganisieren 2019-11-27 17:56:30 +01:00
10 changed files with 51 additions and 6 deletions

@ -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
![settings](settings_page.png)
Mainscreen
You can see the Plugin on the bottom right
![Mainscreen](fullscreen.png)
Switch is off
![Switch off](sidebar_off.png)
Switch is on
![Switch on](sidebar_on.png)
With toggle Button enabled
![toggle on](sidebar_on_button.png)
![toggle off](sidebar_off_button.png)
## 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

Binary file not shown.

After

(image error) Size: 167 KiB

@ -197,11 +197,16 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
ip=None,
intervall=1,
onOffButtonEnabled=False,
owerOnOnStart=False,
powerOnOnStart=False,
powerOffOnShutdown=False,
powerOffDelay=0
)
def get_settings_restricted_paths(self):
return dict(admin=[
['ip']
])
def on_settings_save(self, data):
self._logger.info("on_settings_save")
octoprint.plugin.SettingsPlugin.on_settings_save(self, data)

@ -1,8 +1,7 @@
<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') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: settings.plugins.mystromswitch.ip">
</div>
@ -13,16 +12,21 @@
<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 +35,30 @@
<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>
</form>

BIN
settings_page.png Normal file

Binary file not shown.

After

(image error) Size: 159 KiB

@ -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.0.1"
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module

BIN
sidebar_off.png Normal file

Binary file not shown.

After

(image error) Size: 8.5 KiB

BIN
sidebar_off_button.png Normal file

Binary file not shown.

After

(image error) Size: 12 KiB

BIN
sidebar_on.png Normal file

Binary file not shown.

After

(image error) Size: 10 KiB

BIN
sidebar_on_button.png Normal file

Binary file not shown.

After

(image error) Size: 14 KiB