#9 Relais ausschalten wenn Octoprint heruntergefahren wird
#7 Relais einschalten wenn Octoprint gestartet wurde Api call fix
This commit is contained in:
parent
722c39604e
commit
5d002ffc88
@ -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'
|
||||
if (newState == True):
|
||||
value = 'on'
|
||||
if (newState == True):
|
||||
value = 'off'
|
||||
request = requests.post(
|
||||
'http://{}/timer'.format(self.ip), params={'mode': value, 'time': time}, timeout=1)
|
||||
if not request.status_code == 200:
|
||||
|
Loading…
Reference in New Issue
Block a user