Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
selfisch committed Nov 9, 2017
1 parent 1186898 commit 894382b
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,23 @@
from func_mopidy import mopidy
from func_mousebtn import mouse

# lade die Class mopidy in die Variable mopidy
#mopidy = mopidy()

def PowerBTN():
oldButtonState1 = True

while True:
#grab the current button state
buttonState1 = GPIO.input(5)

# check to see if button has been pushed
if buttonState1 != oldButtonState1 and buttonState1 == False:
subprocess.call("shutdown -h now", shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
oldButtonState1 = buttonState1

time.sleep(.1)


# lade die Class usbbtn in die Variable usbbtn
usbbtn = usbbtn()
check_usbbtn = usbbtn.check_usbbtn()
Expand All @@ -50,23 +65,6 @@

path = os.path.dirname(os.path.realpath(__file__))


def PowerBTN():
oldButtonState1 = True

while True:
#grab the current button state
buttonState1 = GPIO.input(5)

# check to see if button has been pushed
if buttonState1 != oldButtonState1 and buttonState1 == False:
subprocess.call("shutdown -h now", shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
oldButtonState1 = buttonState1

time.sleep(.1)


try:
logger.info('Starte die Anwendung')

Expand Down

0 comments on commit 894382b

Please sign in to comment.