From 5d002ffc88db87553d9dfc59fb6ecbed872d1b37 Mon Sep 17 00:00:00 2001 From: David Zingg Date: Mon, 25 Nov 2019 20:01:37 +0100 Subject: [PATCH] #9 Relais ausschalten wenn Octoprint heruntergefahren wird #7 Relais einschalten wenn Octoprint gestartet wurde Api call fix --- 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 b7f6fcc..8eceb13 100644 --- a/octoprint_mystromswitch/__init__.py +++ b/octoprint_mystromswitch/__init__.py @@ -100,9 +100,9 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin, # then sets the the switch to the newState. def _powerCycleRelais(self, newState, time): try: - value = 'off' + value = 'on' if (newState == True): - value = 'on' + value = 'off' request = requests.post( 'http://{}/timer'.format(self.ip), params={'mode': value, 'time': time}, timeout=1) if not request.status_code == 200: