Navigation Menu

Skip to content

Commit

Permalink
fix restart without GPIO module
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamish Moffatt committed Dec 4, 2018
1 parent 9115342 commit 618cb3b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions helpers.py
Expand Up @@ -93,7 +93,10 @@ def reboot(wait=1, block=False):
if gv.use_pigpio:
pass
else:
GPIO.cleanup()
try:
GPIO.cleanup()
except NameError:
pass
time.sleep(wait)
try:
print _('Rebooting...')
Expand Down Expand Up @@ -122,7 +125,10 @@ def poweroff(wait=1, block=False):
if gv.use_pigpio:
pass
else:
GPIO.cleanup()
try:
GPIO.cleanup()
except NameError:
pass
time.sleep(wait)
try:
print _('Powering off...')
Expand Down Expand Up @@ -152,7 +158,10 @@ def restart(wait=1, block=False):
if gv.use_pigpio:
pass
else:
GPIO.cleanup()
try:
GPIO.cleanup()
except NameError:
pass
time.sleep(wait)
try:
print _('Restarting...')
Expand Down

0 comments on commit 618cb3b

Please sign in to comment.