Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
elif command.isdigit():
coz.play_anim(name=default_anims_for_keys[int(command)]).wait_for_completed()
#things to say with TTS disabled
elif command == 'sayhi':
tts.say( "hi! I'm cozmo!" )
elif command == 'saywatch':
tts.say( "watch this" )
elif command == 'saylove':
tts.say( "i love you" )
elif command == 'saybye':
tts.say( "bye" )
elif command == 'sayhappy':
tts.say( "I'm happy" )
elif command == 'saysad':
tts.say( "I'm sad" )
elif command == 'sayhowru':
tts.say( "how are you?" )
#cube controls
elif command == "lightcubes":
print( "lighting cubes" )
light_cubes( coz )
elif command == "dimcubes":
print( "dimming cubes" )
dim_cubes( coz )
#sing song example
elif command == "singsong":
print( "singing song" )
sing_song( coz )
print( "cozmo light was ", is_headlight_on )
is_headlight_on = not is_headlight_on
coz.set_head_light(enable=is_headlight_on)
time.sleep(0.35)
#animations from example
elif command.isdigit():
coz.play_anim(name=default_anims_for_keys[int(command)]).wait_for_completed()
#things to say with TTS disabled
elif command == 'sayhi':
tts.say( "hi! I'm cozmo!" )
elif command == 'saywatch':
tts.say( "watch this" )
elif command == 'saylove':
tts.say( "i love you" )
elif command == 'saybye':
tts.say( "bye" )
elif command == 'sayhappy':
tts.say( "I'm happy" )
elif command == 'saysad':
tts.say( "I'm sad" )
elif command == 'sayhowru':
tts.say( "how are you?" )
#cube controls
elif command == "lightcubes":
print( "lighting cubes" )
light_cubes( coz )
elif command == "dimcubes":
print( "dimming cubes" )
dim_cubes( coz )
#animations from example
elif command.isdigit():
coz.play_anim(name=default_anims_for_keys[int(command)]).wait_for_completed()
#things to say with TTS disabled
elif command == 'sayhi':
tts.say( "hi! I'm cozmo!" )
elif command == 'saywatch':
tts.say( "watch this" )
elif command == 'saylove':
tts.say( "i love you" )
elif command == 'saybye':
tts.say( "bye" )
elif command == 'sayhappy':
tts.say( "I'm happy" )
elif command == 'saysad':
tts.say( "I'm sad" )
elif command == 'sayhowru':
tts.say( "how are you?" )
#cube controls
elif command == "lightcubes":
print( "lighting cubes" )
light_cubes( coz )
elif command == "dimcubes":
print( "dimming cubes" )
dim_cubes( coz )
#sing song example
elif command == "singsong":
print( "singing song" )
def reportBatteryStatus_task():
if chargeValue < 30:
tts.say("battery low, %d percent" % int(chargeValue))
def internetStatus_task():
global bootMessage
global lastInternetStatus
internetStatus = isInternetConnected()
if internetStatus != lastInternetStatus:
if internetStatus:
tts.say(bootMessage)
log.info("internet connected")
else:
log.info("missing internet connection")
tts.say("missing internet connection")
lastInternetStatus = internetStatus