From 70355683b27d6f65b00eed4b25fa94abec85c6d2 Mon Sep 17 00:00:00 2001 From: David Zingg Date: Mon, 25 Nov 2019 19:53:43 +0100 Subject: [PATCH] #9 Relais ausschalten wenn Octoprint heruntergefahren wird #7 Relais einschalten wenn Octoprint gestartet wurde --- octoprint_mystromswitch/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octoprint_mystromswitch/__init__.py b/octoprint_mystromswitch/__init__.py index c7e2062..d6e15ea 100644 --- a/octoprint_mystromswitch/__init__.py +++ b/octoprint_mystromswitch/__init__.py @@ -104,7 +104,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin, if (newState == True): value = '1' request = requests.post( - 'http://{}/timer'.format(self.ip), data={'mode': value, 'time': time}, timeout=1) + 'http://{}/timer'.format(self.ip), json={'mode': value, 'time': time}, timeout=1) if not request.status_code == 200: self._logger.info("Could not powerCycle Relais, Http Status Code: {}".format(request.status_code)) except requests.exceptions.ConnectionError: