Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if sum(force_color) != 0:
no_rumble_time = time.time() + 5
time.sleep(0.01)
move.set_leds(*force_color)
move.update_leds()
move.set_rumble(0)
no_rumble = time.time() + 0.5
#if we are not dead
elif dead_move.value == 1:
if move.poll():
ax, ay, az = move.get_accelerometer_frame(psmove.Frame_SecondHalf)
total = sum([ax, ay, az])
if move_last_value is not None:
change = abs(move_last_value - total)
if move_opts[Opts.is_commander.value] == Bool.no.value:
warning = FAST_WARNING
threshold = FAST_MAX
else:
#if affected by overdrive, this could make the power better
warning = SLOW_WARNING
threshold = SLOW_MAX
if change > threshold:
if time.time() > no_rumble:
move.set_leds(0,0,0)
move.set_rumble(90)
dead_move.value = 0
time_of_death = time.time()
elif change > warning: