#!/usr/bin/python3
#
 
import time
from AKBL.Bindings import Bindings
 
AKBLConnection=Bindings()
 
lights_test=True
profiles_test=True
colors_test=True
speed_test=True
colors_multiple_test=True
 
 
if not AKBLConnection.ping():
	print("The connection with the daemon is off")
	
else:
  
 """
     Each command is called as:
     
         print( <command_name>, <command> )
         
     To check if the commands succeed. You don't 
     really need to do this in your code!
 """
 
 if lights_test:
     print('lights off', AKBLConnection.set_lights(False))
     time.sleep(2)
     print('lights on', AKBLConnection.set_lights(True))
     time.sleep(2)
     print('switch lights', AKBLConnection.switch_lights())
 
 
 if profiles_test:
     for profile_name in AKBLConnection.get_profile_names():
         print('set profile:', profile_name, AKBLConnection.set_profile(profile_name))
         time.sleep(5)
 
 
 color1='#F7F200'
 color2='#0018FF'
 
 if colors_test:
     print('set_colors blink', AKBLConnection.set_colors('blink', 100, color2))
     time.sleep(5)
     print('set_colors fixed', AKBLConnection.set_colors('fixed', 100, color1))
     time.sleep(5)
     print('set_colors morph', AKBLConnection.set_colors('morph', 100, color1, color2))
 
      
 if speed_test:
     print('set_colors blink', AKBLConnection.set_colors('blink', 1, color2))
     time.sleep(5)
     print('set_colors blink', AKBLConnection.set_colors('blink', 100, color2))
     time.sleep(5)
     print('set_colors blink', AKBLConnection.set_colors('blink', 256, color2))
     time.sleep(5)
 
  
 if colors_multiple_test:
     colors1='#0600FF' 
     colors2='#FF00E5'
      
     print('set_colors multiple blink', AKBLConnection.set_colors('blink', 100, colors2))
     time.sleep(5)
     print('set_colors multiple morph', AKBLConnection.set_colors('morph', 100, colors1, colors2))
     time.sleep(5)
     print('set_colors mutlple fixed', AKBLConnection.set_colors('fixed', 100, colors1))
     
		 
