Added print for debug
parent
3eaaae52e6
commit
b6165fadfc
9
main.py
9
main.py
|
@ -66,11 +66,12 @@ def change_idle_mode(channel):
|
||||||
idle_mode += 1
|
idle_mode += 1
|
||||||
if idle_mode == 6:
|
if idle_mode == 6:
|
||||||
idle_mode = 1
|
idle_mode = 1
|
||||||
|
print('Change Idlemode executed')
|
||||||
|
|
||||||
def power_toggle(channel):
|
def power_toggle(channel):
|
||||||
print('button pressed')
|
|
||||||
global power_button_pressed
|
global power_button_pressed
|
||||||
power_button_pressed = 'True'
|
power_button_pressed = 'True'
|
||||||
|
print('Toggle Power executed')
|
||||||
|
|
||||||
#Web API
|
#Web API
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
@ -79,9 +80,11 @@ app = Flask(__name__)
|
||||||
def index():
|
def index():
|
||||||
command = str(request.args.get('command'))
|
command = str(request.args.get('command'))
|
||||||
if command == "switch-ilde-mode":
|
if command == "switch-ilde-mode":
|
||||||
change_idle_mode
|
print('Switched Idlemode via API')
|
||||||
|
change_idle_mode()
|
||||||
elif command == "switch-toggle-on-off":
|
elif command == "switch-toggle-on-off":
|
||||||
power_toggle
|
print('Toggled Power via API')
|
||||||
|
power_toggle()
|
||||||
|
|
||||||
return command
|
return command
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue