Skip to content

Instantly share code, notes, and snippets.

@Jan200101
Created July 20, 2017 22:47
Show Gist options
  • Save Jan200101/ebcc0bbca4e502d0563f793b280b326f to your computer and use it in GitHub Desktop.
Save Jan200101/ebcc0bbca4e502d0563f793b280b326f to your computer and use it in GitHub Desktop.
import toaster
import os
import time
try:
toaster.init()
except:
print('No Toaster was found')
exit()
if len(toast.devices) > 1:
print('More then one toaster is connected.\nDisconnected one Toaster and restart this script')
exit()
if not toast.devices[0].working:
if os.name == 'nt':
os.system('cls')
else:
os.system('clear')
print('Put your toast in.\nDisplaying a message once its one!')
while not toast.devices[0].working:
time.sleep(0.9)
while toast.devices[0].working:
time.sleep(0.9)
if not toast.devices[0].working:
if os.name == 'nt':
os.system('cls')
else:
os.system('clear')
print('TOAST IS READY')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment