From 37c09bd288a03bae2d093a7c90aaa8f7df15b019 Mon Sep 17 00:00:00 2001 From: David Zingg Date: Mon, 25 Nov 2019 19:50:26 +0100 Subject: [PATCH] #9 Relais ausschalten wenn Octoprint heruntergefahren wird #7 Relais einschalten wenn Octoprint gestartet wurde MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Logging schreibfehler Url Fix für Powercycle --- octoprint_mystromswitch/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/octoprint_mystromswitch/__init__.py b/octoprint_mystromswitch/__init__.py index a18fed7..c7e2062 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://{}/relay'.format(self.ip), json={'mode': value, 'time': time}, timeout=1) + 'http://{}/timer'.format(self.ip), data={'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: @@ -148,7 +148,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin, self._logger.info("Turn on Relais off Shutdown") self._setRelaisState(False) else: - self._logger.info("Turn on Relais off Shutdown Delayed") + self._logger.info("Turn off Relais on Shutdown Delayed") self._powerCycleRelais(False, self.powerOffDelay) def on_settings_migrate(self, target, current):