diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 38a8b3e..bfca224 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,7 @@
-
+
@@ -49,13 +49,6 @@
1574193087583
-
- 1574873809876
-
-
-
- 1574873809876
-
1574874286229
@@ -392,7 +385,14 @@
1593630096392
-
+
+ 1593630227011
+
+
+
+ 1593630227011
+
+
diff --git a/octoprint_mystromswitch/__init__.py b/octoprint_mystromswitch/__init__.py
index 656dcc9..62843a0 100644
--- a/octoprint_mystromswitch/__init__.py
+++ b/octoprint_mystromswitch/__init__.py
@@ -19,6 +19,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
def __init__(self):
self.ip = None
+ self.token = ""
self.intervall = 1
self.onOffButtonEnabled = False
self.powerOnOnStart = False
@@ -50,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)
@@ -345,13 +349,16 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
self.lastShutdown = False
self.lastPowerOff = False
self.rememberShutdown = False
+ if current <= 5:
+ self.token = ""
def get_settings_version(self):
- return 5
+ return 6
def get_settings_defaults(self):
return dict(
ip=None,
+ token="",
intervall=1,
onOffButtonEnabled=False,
powerOnOnStart=False,
@@ -367,7 +374,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
def get_settings_restricted_paths(self):
return dict(admin=[
- ['ip']
+ ['ip', 'token']
])
def on_settings_save(self, data):
diff --git a/octoprint_mystromswitch/templates/mystromswitch_settings.jinja2 b/octoprint_mystromswitch/templates/mystromswitch_settings.jinja2
index f78142f..7abca9a 100644
--- a/octoprint_mystromswitch/templates/mystromswitch_settings.jinja2
+++ b/octoprint_mystromswitch/templates/mystromswitch_settings.jinja2
@@ -7,6 +7,13 @@
+
+
+
+
+
+
+