#!/usr/bin/python3

####################################################
# ArtiLED Python Functions Test v1.63 (27-03-2023) #
# Written by: Michel van Osenbruggen               #
# Copyright 2023 ArtiLED B.V. All Rights Reserved  #
####################################################

######################################################################
# This file only shows Examples of all the available commands        #
# See Node Protocol Documentaton for informtation on expected output #
######################################################################

import time
import random
import artiled

#Create Controller Object
name    = 'Development'
node    = '192.168.14.34'
port    = 1080
timeout = 30

development = artiled.Controller(name,node,port,timeout)

#Check Controller Object
#print(development.name)
#print(development.node)
#print(development.port)
#print(development.timeout)

#Default settings
channel = 0
realtime = 1
commit = 1
debug = 0

#success = development.set_debug(debug, realtime)
#success = development.clear()

#################################
# Controller Info Command Tests #
#################################

#Ping
#pong = development.ping()
#print(pong)

#Get Debug -> 0=debug off, 1=Errors, 2=Errors and Commands, 3=Verbose
#debugvalue = development.get_debug()
#print(debugvalue)

#Get Version
#version = development.get_version()
#print(version)

#Get Power
#power = development.get_power()
#print(power)

#Get Leds
#leds = development.get_leds()
#print(leds)

#Get Channels
#channels = development.get_channels()
#print(channels)

#Get Uptime (uptime in seconds)
#uptime = development.get_uptime()
#print(uptime)

#Get Hardware
#hardware = development.get_hardware()
#print(hardware)

#Get Clock
#clock = development.get_clock()
#print(clock)

#Get Voltage
#voltage = development.get_voltage()
#print(voltage)

#Get Profile
#profile = development.get_profile()
#print(profile)

#Get Amperage
#amperage = development.get_amperage()
#print(amperage)

#Get White Model
#white_model = development.get_white_model()
#print(white_model)

#Get Color Correct
#color_correct = development.get_color_correct()
#print(color_correct)

#Get PSU Startup Delay (0-100 * 0.1 seconds)
#psu_startup_delay = development.get_psu_startup_delay()
#print(psu_startup_delay)

#Get PSU Control
#psu_control = development.get_psu_control()
#print(psu_control)

############################
# Controller Command Tests #
############################

#Clear (channel,realtime,commit) channel 1-4 or 0 = all
#success = development.clear(0,realtime,commit)
#print(success)

#Brightness (brightness,channel,realtime,commit): Value (0-255), Always All Channels
#success = development.brightness(255,channel,realtime,commit)
#print(success)

#Saturation (sat,channel,realtime): Value (0-255), Always All Channels
#success = development.saturation(255,channel,realtime)
#print(success)

#Hue (hue,channel,realtime): Value (0-255), Always All Channels
#success = development.hue(255,channel,realtime)
#print(success)

#Value (value,channel,realtime): Value (0-255), Always All Channels
#success = development.value(255,channel,realtime)
#print(success)

#Brighten (brightness_calc,channel,realtime,commit): Value (0-255), Always All Channels
#success = development.brighten(10,channel,realtime,commit)
#print(success)

#Dim (brightness_calc,channel,realtime,commit): Value (0-255), Always All Channels
#success = development.dim(10,channel,realtime,commit)
#print(success)

#Scale (scale_calc,channel,realtime,commit): Value (0-255)
#success = development.scale(50,channel,realtime,commit)
#print(success)

#Calc (calc_option,calc_value,channel,realtime,commit): Option(0=Add, 1=Subtract, 2=Multiply, 3=Divide), Value (0-255)
#success = development.calc(3,2,channel,realtime,commit)
#print(success)

#Save (channel, realtime)
#success = development.save(1, realtime)
#print(success)

#Restore (channel,realtime,commit)
#success = development.restore(1,realtime,commit)
#print(success)

#Default (channel,realtime,commit)
#success = development.default(1,realtime,commit)
#print(success)

#Set Power Save Time (value, realime) 0=off, Value in Hours
#success = development.set_power_save_time(1, realtime)
#print(success)

#Set Debug (value, realime) 0=debug off, 1=Errors, 2=Errors and Commands, 3=Verbose
#success = development.set_debug(debug, realtime)
#print(success)

#Commit (realtime)
#success = development.commit(realtime)
#print(success)

#Set Power (value, realtime)
#success = development.set_power(0, realtime)
#print(success);

##############################
# Channel Info Command Tests #
##############################

#Status 0=Any,1=Number,2=Segments,2=Leds
#status = development.status(0)
#print(status)
#status = development.status(1)
#print(status)
#status = development.status(2)
#print(status)
#status = development.status(3)
#print(status)

#Info 0=Brightness, 1=Saturation, 2=Hue, 3=Value
#brightness = development.info(0)
#print(brightness)
#sat = development.info(1)
#print(sat)
#hue = development.info(2)
#print(hue)
#value = development.info(3)
#print(value)

#Get Brightness
#brightness = development.get_brightness()
#print (brightness)

#Get Saturation
#saturation = development.get_saturation()
#print (saturation)

#Get Hue
#hue = development.get_hue()
#print (hue)

#Get Brightness
#value = development.get_value()
#print (value)

#Info RGBW 0=Strip, 1=Average, 2=Segments, 3=Leds
#status = development.info_rgbw(0)
#print(status)
#status = development.info_rgbw(1)
#print(status)
#status = development.info_rgbw(2)
#print(status)
#status = development.info_rgbw(3)
#print(status)

#Info HSV 0=Strip, 1=Average, 2=Segments, 3=Leds
#status = development.info_hsv(0)
#print(status)
#status = development.info_hsv(1)
#print(status)
#status = development.info_hsv(2)
#print(status)
#status = development.info_hsv(3)
#print(status)

#Info Luma 0=Strip, 1=Average, 2=Segments, 3=Leds
#status = development.info_luma(0)
#print(status)
#status = development.info_luma(1)
#print(status)
#status = development.info_luma(2)
#print(status)
#status = development.info_luma(3)
#print(status)

#Info Light 0=Strip, 1=Average, 2=Segments, 3=Leds
#status = development.info_light(0)
#print(status)
#status = development.info_light(1)
#print(status)
#status = development.info_light(2)
#print(status)
#status = development.info_light(3)
#print(status)

#Colors RGBW 0=ALl, 1=All (only on), 2=Unique, 3=Unique (only on), 4=Amount Unique (only on)
#status = development.colors_rgbw(0)
#print(status)
#status = development.colors_rgbw(1)
#print(status)
#status = development.colors_rgbw(2)
#print(status)
#status = development.colors_rgbw 3)
#print(status)
#status = development.colors_rgbw(4)
#print(status)

#Colors HSV 0=ALl, 1=All (only on), 2=Unique, 3=Unique (only on), 4=Amount Unique (only on)
#status = development.colors_hsv(0)
#print(status)
#status = development.colors_hsv(1)
#print(status)
#status = development.colors_hsv(2)
#print(status)
#status = development.colors_hsv(3)
#print(status)
#status = development.colors_hsv(4)
#print(status)

########################################
# Led Controller Special Command Tests #
########################################

#power_calc_method = development.get_power_calc_method()
#print (power_calc_method)

#dither = development.get_dither()
#print (dither)

#Set Dither
#dither = 1
#success = development.set_dither(dither)
#print(success)

#######################
# Strip Command Tests #
#######################

#Strip RGBW (R,G,B,W,channel,realtime,commit): Value (0-255), Channel 0 or none = all
#success = development.strip_rgbw(255,0,0,0,channel,realtime,commit) #Red
#success = development.strip_rgbw(0,255,0,0,channel,realtime,commit) #Green
#success = development.strip_rgbw(0,0,255,0,channel,realtime,commit) #Blue
#success = development.strip_rgbw(0,0,0,255,channel,realtime,commit) #White
#success = development.strip_rgbw(255,255,255,0,channel,realtime,commit) #RGB
#success = development.strip_rgbw(255,255,255,255,channel,realtime,commit) #RGBW

#Strip RGB (R,G,B,channel,realtime,commit): Value (0-255), Channel 0 or none = all
#success = development.strip_rgb(0,0,255,channel,realtime,commit) #Red
#success = development.strip_rgb(255,0,0,channel,realtime,commit) #Green

#Strip HSV (Hue,Sat,Brightness,channel,realtime,commit): Value (0-255), Channel 0 or none = all
#for x in range (0 ,255):
#  success = development.strip_hsv(x,255,255,channel,realtime,commit)

#Strip HS (Hue,Sat,channel,realtime,commor): Value (0-255), Channel 0 or none = all, Brightness via command
#for x in range (0 ,255):
#  success = development.strip_hs(x,255,channel,realtime,commit)

#Strip H (Hue,channel,realtime,commit): Value (0-255), Channel 0 or none = all, Sat, Brightness via command
#development.brightness(100,channel,realtime,commit)
#development.saturation(128,channel,realtime)
#for x in range (0 ,255):
#  development.strip_h(x,channel,realtime,commit)

#Strip W (temperature,intensity,channel,realtime,commit): Value (0-255), Channel 0 or none = all, 0=Cold, 255=Warm
#success = development.strip_w(0,255,channel,realtime,commit) #Cold White
#success = development.strip_w(127,255,channel,realtime,commit) #Normal White
#success = development.strip_w(255,255,channel,realtime,commit) #Warm White

#for x in range (0 ,255):
#  development.strip_w(255,x,channel,realtime,commit)

##############################
# Strip Modify Command Tests #
##############################

#Strip Scale RGBW (scale_red,scale_green,scale_blue,scale_white,channel,realtime,commit): Value (0-255)
#success = development.scale_strip_rgbw(50,50,100,0,channel,realtime,commit)
#print(success)

#Strip Calc RGBW (calc_option,calc_red,calc_green,calc_blue,calc_white,channel,realtime,commit): Option(0=Add, 1=Subtract, 2=Multiply, 3=Divide)
#success = development.calc_strip_rgbw(3,2,2,2,2,channel,realtime,commit)
#print(success)

#Strip Shift (step,mode,recycle,channel,realtime,commit): Mode(0=Left, 1=Right, 2=Outward, 3=Inward) Recycle(0x00=No Recycle, 0x01=Recycle)
#step=1
#mode=0
#recycle=0
#success = development.strip_shift(step,mode,recycle,channel,realtime,commit)
#print(success)

#Strip Copy (origin,channel,realtime,commit): Copies Strip Origin to Channel (0x00 = All Channels)
#channel=0
#origin=1
#success = development.strip_copy(origin,channel,realtime,commit)
#print(success)

#Strip Swap (origin,channel,realtime,commit): Swap Strip Origin and Channel
#channel=2
#origin=1
#success = development.strip_swap(origin,channel,realtime,commit)
#print(success)

#Strip Rotate (direction,channel,realtime,commit): Rotate Strips in Directions (0x00=Right, 0x01=Left)
#direction=1
#success = development.strip_rotate(direction,channel,realtime,commit)
#print(success)

#Strip Feed RGBW (red,green,blue,white,step,mode,channel,realtime,commit): Mode(0=Left, 1=Right, 2=Outward, 3=Inward)
#step=1
#mode=0
#red=255
#green=0
#blue=0
#white=0
#success = development.strip_feed_rgbw(red,green,blue,white,step,mode,channel,realtime,commit)
#print(success)

#Strip Feed HSV (hue,sat,value,step,mode,channel,realtime,commit): Mode(0=Left, 1=Right, 2=Outward, 3=Inward)
#step=1
#mode=0
#hue = 0
#sat = 255
#value = 100
#success = development.strip_feed_hsv(hue,sat,value,step,mode,channel,realtime,commit)
#print(success)

#Strip Feed Palette (index,step,mode,channel,realtime,commit): Mode(0=Left, 1=Right, 2=Outward, 3=Inward)
#step=1
#mode=0
#index = 5
#success = development.strip_feed_palette(index,step,mode,channel,realtime,commit)
#print(success)

#Strip Blur (count,amount,channel,realtime,commit) -> Count=Number of Blurs (0-255), Blur Amount 0=No Spread, 64=Moderate Spread, 172=Max Smooth, 173…255=Wider Spread -> returns '1' if succesful
#success = development.clear(channel,realtime,commit)
#success = development.segment_rgbw(10,15,255,0,0,0,channel,realtime,commit)
#count = 10
#amount = 255
#time.sleep(2)
#success = development.strip_blur(count, amount, channel, realtime)
#print(success)

#success = development.clear(channel,realtime,commit)
#success = development.segment_rgbw(10,15,255,0,0,0,channel,realtime,commit)
#success = development.segment_rgbw(50,55,0,255,0,0,channel,realtime,commit)
#success = development.segment_rgbw(80,85,0,0,255,0,channel,realtime,commit)
#success = development.segment_rgbw(110,115,0,0,0,255,channel,realtime,commit)
#count = 1
#amount = 255
#for x in range (0,50):
#  success = development.strip_blur(count,amount,channel,realtime,commit)
#  time.sleep(0.01)

#########################
# Segment Command Tests #
#########################

#Segment RGBW Test (start,end,R,G,B,W,channel,realtime,commit): Value 0-255, Channel 0 or none = all
#success = development.segment_rgbw(0,2,255,0,0,0,channel,realtime,commit)
#success = development.segment_rgbw(11,20,0,255,0,0,channel,realtime,commit)
#success = development.segment_rgbw(22,50,0,0,255,0,channel,realtime,commit)
#success = development.segment_rgbw(55,100,255,0,255,0,channel,realtime,commit)
#success = development.segment_rgbw(101,132,0,0,0,255,channel,realtime,commit)

#development.clear(channel,realtime,commit)
#for x in range (0, 134):
#  if (x > 9):
#    development.segment_rgbw(-10 + x, 1 + x, 0, 0, 0, 0, channel,realtime,commit)
#    development.segment_rgbw(0 + x, 9 + x, 255, 0, 0, 0, channel,realtime,commit)
#    development.segment_rgbw(10 + x, 19 + x, 0, 255, 0, 0, channel,realtime,commit)
#    development.segment_rgbw(20 + x, 29 + x, 0, 0, 255, 0, channel,realtime,commit)

#Segment RGB Test (start,end,R,G,B,channel,realtime,commit): Value 0-255, Channel 0 or none = all
#development.clear(channel,realtime,commit)
#development.segment_rgb(0,9,255,0,0,channel,realtime,commit)
#development.segment_rgb(11,20,0,255,0,channel,realtime,commit)
#development.segment_rgb(22,50,0,255,0,channel,realtime,commit)
#development.segment_rgb(55,100,0,0,255,channel,realtime,commit)
#development.segment_rgb(101,132,255,255,255,channel,realtime,commit)

#Segment HSV Test (start,end,H,S,V,channel,realtime,commit): Value 0-255, Channel 0 or none = all
#development.clear(channel,realtime,commit)
#development.segment_hsv(0,9,255,255,255,channel,realtime,commit)
#development.segment_hsv(11,20,0,255,255,channel,realtime,commit)
#development.segment_hsv(22,50,50,255,255,channel,realtime,commit)
#development.segment_hsv(55,100,100,225,255,channel,realtime,commit)
#development.segment_hsv(101,132,200,255,255,channel,realtime,commit)

#Segment HSV Test (start,end,H,S,V,channel,realtime,commit): Value 0-255, Channel 0 or none = all
#development.clear(channel,realtime,commit)
#for x in range (0, 255):
#   development.segment_hsv(0, 49, x, 255, 255, channel,realtime,commit)
#   y = x + 25
#   if y > 255:
#         y = 255
#   development.segment_hsv(50, 89, y, 255, 255, channel,realtime,commit)
#   z = x + 50
#   if z > 255:
#      z = 255
#   development.segment_hsv(80, 133, y, 255, 255, channel,realtime,commit)

#Segment HS Test (start,end,H,S,channel,realtime,commit): Value 0-255, Channel 0 or none = all, Brightness via command
#development.clear(channel,realtime,commit)
#development.brightness(255,channel,realtime,commit)
#development.segment_hs(0,9,255,255,channel,realtime,commit)
#development.segment_hs(11,20,0,255,channel,realtime,commit)
#development.segment_hs(22,50,50,255,channel,realtime,commit)
#development.segment_hs(55,100,100,225,channel,realtime,commit)
#development.segment_hs(101,132,200,255,channel,realtime,commit)

#Segment HS Test (start,end,H,S,channel,realtime,commit): Value 0-255, Channel 0 or none = all, Brightness via command
#development.clear(channel,realtime,commit)
#development.brightness(200,channel,realtime,commit)
#for x in range (0, 255):
#   development.segment_hs(0, 49, x, 255, channel,realtime,commit)
#   y = x + 25
#   if y > 255:
#      y = 255
#   development.segment_hs(50, 89, y, 255, channel,realtime,commit)
#   z = x + 50
#   if z > 255:
#      z = 255
#   development.segment_hs(80, 133, y, 255, channel,realtime,commit)

#Segment H Test (start,end,H, channel,realtime,commit): Value 0-255, Channel 0 or none = all, Sat, Brightness via command
#development.clear(channel,realtime,commit)
#development.brightness(255,channel,realtime,commit)
#development.saturation(127,channel,realtime)
#development.segment_h(0,9,255,channel,realtime,commit)
#development.segment_h(11,20,0,channel,realtime,commit)
#development.segment_h(22,50,50,channel,realtime,commit)
#development.segment_h(55,100,100,channel,realtime,commit)
#development.segment_h(101,132,200,channel,realtime,commit)

#Segment H Test (start,end,H,channel,realtime,commit): Value 0-255, Channel 0 or none = all, Sat, Brightness via command
#development.clear(channel,realtime,commit)
#development.brightness(255,channel,realtime,commit)
#development.saturation(128,channel,realtime)
#for x in range (0, 255):
#   development.segment_h(0, 49, x, channel,realtime,commit)
#   y = x + 25
#   if y > 255:
#      y = 255
#   development.segment_h(50, 89, y, channel,realtime,commit)
#   z = x + 50
#   if z > 255:
#      z = 255
#   development.segment_h(80, 133, y, channel,realtime,commit)

#Segment H Test (start,end,temperature,intensity,channel,realtime,commit): Value 0-255, Channel 0 or none = all
#success = development.clear(channel,realtime,commit);
#success = development.segment_w(10,20,0,255,channel,realtime,commit)
#success = development.segment_w(30,40,128,255,channel,realtime,commit)
#success = development.segment_w(50,60,255,255,channel,realtime,commit)

################################
# Segment Modify Command Tests #
################################

#Segment Blur (start,end,count,amount,channel,realtime,commit) -> Count=Number of Blurs (0-255), Blur Amount 0=No Spread, 64=Moderate Spread, 172=Max Smooth, 173…255=Wider Spread -> returns '1' if succesful
#success = development.clear(channel,realtime,commit)
#success = development.segment_rgbw(10,15,255,0,0,0,channel,realtime,commit)
#start=0
#end=100
#count = 10
#amount = 255
#time.sleep(2)
#success = development.segment_blur(count,amount,channel,realtime,commit)
#print(success)

#success = development.clear(channel,realtime,commit)
#success = development.segment_rgbw(10,15,255,0,0,0,channel,realtime,commit)
#success = development.segment_rgbw(50,55,0,255,0,0,channel,realtime,commit)
#success = development.segment_rgbw(80,85,0,0,255,0,channel,realtime,commit)
#success = development.segment_rgbw(110,115,0,0,0,255,channel,realtime,commit)
#start = 0
#end = 60
#count = 1
#amount = 255
#for x in range (0,200):
#  success = development.segment_blur(start,end,count,amount,channel,realtime,commit)
#  time.sleep(0.01)

###############################
# Multi Segment Command Tests #
###############################

#Multi Segment RGBW Test ([n x [start,end,R,G,B,W] ],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#arr = [[0,30,255,0,0,0],[32,60,0,255,0,0],[62,90,0,0,255,0],[92,133,0,0,0,255]]
#arr = [[32,60,0,255,0,0],[62,90,0,0,255,0],[92,133,0,0,0,255]]
#development.multi_segment_rgbw(arr,channel,realtime,commit)

#Multi Segment RGB Test ([n x [start,end,R,G,B] ],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#arr = [[0,30,255,0,255],[31,60,255,255,0],[61,90,0,255,255],[91,133,255,255,255]]
#development.multi_segment_rgb(arr,channel,realtime,commit)

#Multi Segment HSV Test ([n x [start,end,H,S,V] ],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#arr = [[0,30,0,255,255],[31,60,100,255,255],[61,90,150,255,255],[91,133,200,255,255]]
#development.multi_segment_hsv(arr,channel,realtime,commit)

#Multi Segment HS Test ([n x [start,end,H,S] ],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#arr = [[0,30,125,255],[31,60,150,255],[61,90,18,255],[91,133,208,255]]
#development.multi_segment_hs(arr,channel,realtime,commit)

#Multi Segment H Test ([n x [start,end,H] ],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#development.saturation(128,channel,realtime)
#arr = [[0,30,125],[31,60,200],[61,90,18,255],[91,133,208]]
#development.multi_segment_h(arr,channel,realtime,commit)

#Multi Segment W Test ([n x [start,end,temperature,intensity] ],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#arr = [[0,30,0,255],[32,60,80,255],[62,90,127,255],[92,133,255,255]]
#development.multi_segment_w(arr,channel,realtime,commit)

#######################
# Pixel Command Tests #
#######################

#Pixel RGBW Test (pixel,R,G,B,W,channel,realtime,commit): Value 0-255, Channel 0 or none = all
#development.clear(channel,realtime,commit)
#development.pixel_rgbw(0,255,0,0,0,channel,realtime,commit)
#development.pixel_rgbw(50,255,0,0,0,channel,realtime,commit)
#development.pixel_rgbw(100,255,0,0,0,channel,realtime,commit)

#Pixel RGBW Test (pixel,R,G,B,W,channel,realtime,commit): Value 0-255, Channel 0 or none = all
#development.clear(channel,realtime,commit)
#for x in range (0, 133):
#    development.pixel_rgbw(x, 255-x, 0, 0, x, channel,realtime,commit)

#Pixel RGB Test (pixel,R,G,B,channel,realtime,commit): Value 0-255, Channel 0 or none = all
#development.clear(channel,realtime,commit)
#for x in range (133, 0, -1):
#    development.pixel_rgb(x, 255, x, 0, channel,realtime,commit)

#Pixel HSV Test (pixel,H,S,V,channel,realtime,commit): Value 0-255, Channel 0 or none = all
#development.clear(channel,realtime,commit)
#for x in range (0, 133):
#    development.pixel_hsv(x, x, 255, 255, channel,realtime,commit)

#Pixel HS Test (pixel,H,S,channel,realtime,commit): Value 0-255, Channel 0 or none = all
#development.clear(channel,realtime,commit)
#for x in range (133, 0, -1):
#    y = int(x * 255)
#    y = int(y / 133)
#    development.pixel_hs(x, y, 255, channel,realtime,commit)

#Pixel H Test (pixel,H,channel,realtime,commit): Value 0-255, Channel 0 or none = all
#development.clear(channel,realtime,commit)
#development.brightness(255,channel,realtime,commit)
#development.saturation(127,channel,realtime)
#for x in range (0, 133):
#    y = int(x * 255)
#    y = int(y / 133)
#    development.pixel_h(x, y, channel,realtime,commit)
 
#Pixel W Test (pixel,temperature,intensity,channel,realtime,commit): Value 0-255, Channel 0 or none = all
#development.clear(channel,realtime,commit)
#development.pixel_w(0,0,255,channel,realtime,commit)
#development.pixel_w(50,127,127,channel,realtime,commit)
#development.pixel_w(100,255,255,channel,realtime,commit)

#############################
# Multi Pixel Command Tests #
#############################

#Multi Pixel RGBW Test ([n x [pixel,R,G,B,W] ],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#arr = [[30,255,0,0,0],[60,0,255,0,0],[90,0,0,255,0],[123,0,0,0,255]]
#development.multi_pixel_rgbw(arr,channel,realtime,commit)

#Multi Pixel RGB Test ([n x [pixel,R,G,B] ],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#arr = [[15,255,255,0],[45,0,255,255],[65,255,0,255],[100,255,255,255]]
#development.multi_pixel_rgb(arr,channel,realtime,commit)

#Multi Pixel HSV Test ([n x [pixel,H,S,V] ],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#arr = []
#for x in range (0, 133):
#   arr = arr + [[x,x,255,255]]
#development.multi_pixel_hsv(arr,channel,realtime,commit)

#Multi Pixel HS Test ([n x [pixel,H,S] ],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#development.brightness(255,channel,realtime,commit)
#arr = []
#for x in range (0, 133):
#   y = x * 255
#   y = int(y / 132)
#   arr = arr + [[x,y,255]]
#development.multi_pixel_hs(arr,channel,realtime,commit)

#Multi Pixel H Test ([n x [pixel,H] ],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#development.brightness(255,channel,realtime,commit)
#development.saturation(128,channel,realtime)
#arr = []
#for x in range (0, 133):
#   y = x * 255
#   y = int(y / 132)
#   arr = arr + [[x,y]]
#   development.multi_pixel_h(arr,channel,realtime,commit)

#Multi Pixel W Test ([n x [pixel,temperature,intensity] ],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#arr = [[30,0,255],[60,90,255],[100,127,255],[123,255,255]]
#development.multi_pixel_w(arr,channel,realtime,commit)

##############################
# Pixel String Command Tests #
##############################

#Pixel String RGBW Test (start, [R,G,B,W],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#start = 100
#arr = [[255,0,0,0],[0,255,0,0],[0,0,255,0],[0,0,0,255],[255,255,0,0],[0,255,255,0],[255,255,255,0]]
#development.pixel_string_rgbw(start, arr, channel,realtime,commit)

#Pixel String RGBW Test (start, [R,G,B,W],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#development.brightness(255,channel,realtime,commit)
#arr = []
#start = 0
#for x in range (0, 133):
#   if (x < 33):
#      arr = arr + [[255,0,0,0]]
#   elif (x < 66): 
#      arr = arr + [[0,255,0,0]]
#   elif (x < 99):
#      arr = arr + [[0,0,255,0]]
#   else:
#      arr = arr + [[0,0,0,255]]
#development.pixel_string_rgbw(start, arr, channel,realtime,commit)

#Pixel String RGB Test (start, [R,G,B],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#start = 100
#arr = [[255,0,0],[0,255,0],[0,0,255],[255,255,255],[255,255,0],[255,0,255],[0,255,255]]
#development.pixel_string_rgb(start, arr, channel,realtime,commit)

#Pixel String RGB Test (start, [R,G,B],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#arr = []
#start = 0
#for x in range (0, 133):
#   if (x < 33):
#      arr = arr + [[255,255,0]]
#   elif (x < 66): 
#      arr = arr + [[0,255,255]]
#   elif (x < 99):
#      arr = arr + [[255,0,255]]
#   else:
#      arr = arr + [[255,255,255]]
#development.pixel_string_rgb(start, arr, channel,realtime,commit)

#Pixel String HSV Test (start, [H,S,V],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#development.brightness(255,channel,realtime,commit)
#start = 0
#arr = [[1,255,255],[2,255,255],[3,255,255],[4,255,255],[5,255,255],[6,255,255],[7,255,255],[8,255,255],[9,255,255],[10,255,255],[11,255,255],[12,255,255],[13,255,255],[14,255,255],[15,255,255],[16,255,255],[17,255,255]]
#development.pixel_string_hsv(start, arr, channel,realtime,commit)

#Pixel String HSV Test (start, [H,S,V],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#arr = []
#start = 0
#for x in range (0, 133):
#   arr = arr + [[x,255,255]]
#   development.pixel_string_hsv(start, arr, channel,realtime,commit)

#Pixel String HSV Test (start, [H,S,V],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#arr = []
#start = 0
#for x in range (0, 133):
#   y = x * 255
#   y = int(y / 133)
#   arr = arr + [[y,255,255]]
#   development.pixel_string_hsv(start, arr, channel,realtime,commit)

#Pixel String HS Test (start, [H,S],channel,realtime,commmit)
#development.clear(channel,realtime,commit)
#development.brightness(255,channel,realtime,commit)
#start = 10
#arr = [[0,255],[10,255],[20,255],[30,255],[40,255],[50,255],[60,255],[0,255],[10,255],[20,255],[30,255],[40,255],[50,255],[60,255]]
#development.pixel_string_hs(start, arr, channel,realtime,commit)

#Pixel String HS Test (start, [H,S],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#development.brightness(255,channel,realtime,commit)
#arr = []
#start = 0
#for x in range (133, 0, -1):
#   y = x * 255
#   y = int(y / 133)
#   arr = arr + [[y,255]]
#   development.pixel_string_hs(start, arr, channel,realtime,commit)

#Pixel String H Test (start, [H],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#development.saturation(128,channel,realtime)
#development.brightness(255,channel,realtime,commit)
#start = 10
#arr = [[0],[10],[20],[30],[40],[50],[60]]
#development.pixel_string_h(start, arr, channel,realtime,commit)

#Pixel String H Test (start, [H],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#development.brightness(255,channel,realtime,commit)
#development.saturation(128,channel,realtime)
#arr = []
#start = 0
#for x in range (133, 0, -1):
#   y = x * 255
#   y = int(y / 133)
#   arr = arr + [[y]]
#development.pixel_string_h(start, arr, channel,realtime,commit)

#Pixel String W Test (start, [temperature,intensity],channel,realtime,commit)
#development.clear(channel,realtime,commit)
#start = 100
#arr = [[0,255],[60,255],[100,255],[128,255],[180,255],[200,255],[255,255]]
#development.pixel_string_w(start, arr, channel,realtime,commit)

###################################
# Strip RGBW Effect Command Tests #
###################################

#Strip Effect RGBW Fill Forward (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
n = 3
start_delay = 0
end_delay = 0
success = development.strip_effect_rgbw(1, 1, n, start_delay, end_delay, 0, 0, 0, 255, channel, realtime)
print(success)

#Strip Effect RGBW Fill Reverse (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 2, n, start_delay, end_delay, 0, 255, 0, 0, channel, realtime)
#print(success)
 
#Strip Effect RGBW Clear Forward (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 1
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 3, n, start_delay, end_delay, 255, 0, 0, 0, channel, realtime)
#print(success)

#Strip Effect RGBW Clear Reverse (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 4, n, start_delay, end_delay, 255, 0, 0, 0, channel, realtime)
#print(success)

#Strip Effect RGBW Fill Outward (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 5, n, start_delay, end_delay, 255, 0, 0, 0, channel, realtime)
#print(success)

#Strip Effect RGBW Fill Center (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 6, n, start_delay, end_delay, 255, 0, 0, 0, channel, realtime)
#print(success)

#Strip Effect RGBW Clear Outward (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 7, n, start_delay, end_delay, 255, 0, 0, 0, channel, realtime)
#print(success)

#Strip Effect RGBW Clear Center (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 8, n, start_delay, end_delay, 255, 0, 0, 0, channel, realtime)
#print(success)

#Strip Strobe Even RGBW effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 20
#start_delay = 20
#end_delay = 20
#success = development.strip_effect_rgbw(1, 9, n, start_delay, end_delay, 255, 0, 0, 0, channel, realtime)
#print(success)

#Strip Strobe Vari RGBW effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 50
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 10, n, start_delay, end_delay, 255, 0, 0, 0, channel, realtime)
#print(success)

#Strip Random Fill RGBW (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 11, n, start_delay, end_delay, 255, 0, 0, 0, channel, realtime)
#print(success)

#Strip Fill Fade In RGBW (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 10
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 12, n, start_delay, end_delay, 128, 0, 128, 0, channel, realtime)
#print(success)

#Strip Fill Fade Out RGBW (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 10
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 13, n, start_delay, end_delay, 128, 0, 128, 0, channel, realtime)
#print(success)

#Strip Fill Forward Gradient In RGBW (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 1
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 14, n, start_delay, end_delay, 128, 0, 128, 0, channel, realtime)
#print(success)

#Strip Fill Reverse Gradient In RGBW (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 1
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 15, n, start_delay, end_delay, 128, 0, 128, 0, channel ,realtime)
#print(success)

#Strip Fill Forward Gradient Out RGBW (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 1
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 16, n, start_delay, end_delay, 128, 0, 128, 0, channel, realtime)
#print(success)

#Strip Fill Reverse Gradient Out RGBW (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 17, n, start_delay, end_delay, 128, 0, 128, 0, channel, realtime)
#print(success)

#Strip Fill Outward Gradient In RGBW (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 18, n, start_delay, end_delay, 128, 0, 128, 0, channel, realtime)
#print(success)

#Strip Fill Outward Gradient Out RGBW (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 19, n, start_delay, end_delay, 128, 0, 128, 0, channel, realtime)
#print(success)

#Strip Fill Center Gradient In RGBW (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 20, n, start_delay, end_delay, 128, 0, 128, 0, channel, realtime)
#print(success)

#Strip Fill Center Gradient Out RGBW (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 21, n, start_delay, end_delay, 128, 0, 128, 0, channel, realtime)
#print(success)

#Strip Forward Pixel Run RGBW (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 4
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 22, n, start_delay, end_delay, 255, 0, 0, 0, channel, realtime)
#print(success)

#Strip Reversed Pixel Run RGBW (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 1
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgbw(1, 23, n, start_delay, end_delay, 255, 0, 0, 0, channel, realtime)
#print(success)

#Strip Outward Pixel Run RGBW (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 1
#start_delay = 100
#end_delay = 100
#success = development.strip_effect_rgbw(1, 24, n, start_delay, end_delay, 255, 0, 0, 0, channel, realtime)
#print(success)

#Strip Center Pixel Run RGBW (clear, effect, n, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 1
#start_delay = 100
#end_delay = 100
#success = development.strip_effect_rgbw(1, 25, n, start_delay, end_delay, 0, 0, 0, 255, channel, realtime)
#print(success)

##################################
# Strip RGB Effect Command Tests #
##################################

#Strip Effect RGB Fill Forward (clear, effect, n, start_delay, end_delay, R,G,B, channel, realtime)
#n = 0
#start_delay = 10
#end_delay = 20
#success = development.strip_effect_rgb(1, 1, n, start_delay, end_delay, 255, 0, 0, channel, realtime)
#print(success)

##################################
# Strip HSV Effect Command Tests #
##################################

# Not Done yet!!!!! Coming soon

#####################################
# Segment RGBW Effect Command Tests #
#####################################

#Segment Effect RGBW Fill Forward (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 10
#end = 30
#start_delay = 10
#end_delay = 20
#success = development.segment_effect_rgbw(0, 1, n, start, end, start_delay, end_delay, 0, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Fill Reverse (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 40
#end = 60
#start_delay = 10
#end_delay = 20
#success = development.segment_effect_rgbw(1, 2, n, start, end, start_delay, end_delay, 0, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Clear Forward (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 60
#end = 70
#start_delay = 10
#end_delay = 20
#success = development.segment_effect_rgbw(0, 3, n, start, end, start_delay, end_delay, 255, 0, 0, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Clear Reverse (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 80
#end = 90
#start_delay = 10
#end_delay = 20
#success = development.segment_effect_rgbw(0, 4, n, start, end, start_delay, end_delay, 255, 0, 0, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Fill Outward (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 20
#end = 110
#start_delay = 5
#end_delay = 25
#success = development.segment_effect_rgbw(0, 5, n, start, end, start_delay, end_delay, 0, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Fill Center (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 40
#end = 90
#start_delay = 5
#end_delay = 25
#success = development.segment_effect_rgbw(0, 6, n, start, end, start_delay, end_delay, 255, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Clear Outward (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 40
#end = 90
#start_delay = 5
#end_delay = 25
#success = development.segment_effect_rgbw(0, 7, n, start, end, start_delay, end_delay, 255, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Clear Center (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 40
#end = 90
#start_delay = 5
#end_delay = 25
#success = development.segment_effect_rgbw(0, 8, n, start, end, start_delay, end_delay, 255, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Strobe Even (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 20
#start = 40
#end = 90
#start_delay = 20
#end_delay = 20
#success = development.segment_effect_rgbw(0, 9, n, start, end, start_delay, end_delay, 255, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Strobe Vari (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 40
#start = 40
#end = 90
#start_delay = 50
#end_delay = 5
#success = development.segment_effect_rgbw(0, 10, n, start, end, start_delay, end_delay, 255, 0, 255, 0, realtime)
#print(success)

#Segment Effect RGBW Fill Random (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 40
#end = 90
#start_delay = 10
#end_delay = 50
#success = development.segment_effect_rgbw(0, 11, n, start, end, start_delay, end_delay, 255, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Fill Fade In (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 50
#start = 40
#end = 90
#start_delay = 10
#end_delay = 20
#success = development.segment_effect_rgbw(0, 12, n, start, end, start_delay, end_delay, 255, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Fill Fade Out (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 50
#start = 40
#end = 90
#start_delay = 10
#end_delay = 20
#success = development.segment_effect_rgbw(0, 13, n, start, end, start_delay, end_delay, 255, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Fill Forward Gradient In (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 20
#end = 40
#start_delay = 10
#end_delay = 20
#success = development.segment_effect_rgbw(0, 14, n, start, end, start_delay, end_delay, 255, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Fill Reverse Gradient In (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 50
#end = 60
#start_delay = 10
#end_delay = 20
#success = development.segment_effect_rgbw(0, 15, n, start, end, start_delay, end_delay, 0, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Fill Forward Gradient Out (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 10
#end = 30
#start_delay = 10
#end_delay = 20
#success = development.segment_effect_rgbw(0, 16, n, start, end, start_delay, end_delay, 0, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Fill Reverse Gradient Out (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 100
#end = 130
#start_delay = 10
#end_delay = 20
#success = development.segment_effect_rgbw(0, 17, n, start, end, start_delay, end_delay, 255, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Fill Outward Gradient In (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 50
#end = 70
#start_delay = 10
#end_delay = 20
#success = development.segment_effect_rgbw(0, 18, n, start, end, start_delay, end_delay, 255, 0, 255, 0, channel, realtime
#print(success)

#Segment Effect RGBW Fill Outward Gradient Out (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 10
#end = 120
#start_delay = 10
#end_delay = 20
#success = development.segment_effect_rgbw(0, 19, n, start, end, start_delay, end_delay, 255, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Fill Center Gradient In (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 10
#end = 120
#start_delay = 10
#end_delay = 20
#success = development.segment_effect_rgbw(1, 20, n, start, end, start_delay, end_delay, 255, 0, 255, 0, channel, realtime)
#print(success)

#Segment Effect RGBW Fill Center Gradient Out (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 0
#start = 10
#end = 120
#start_delay = 10
#end_delay = 20
#success = development.segment_effect_rgbw(1, 21, n, start, end, start_delay, end_delay, 255, 0, 255, 0, channel, realtime)
#print(success)

#Segment Forward Pixel Run RGBW (clear, effect, n, start, end, start_delay, end_delay, R,G,B,W, channel, realtime)
#n = 10
#start = 0
#end = 300
#start_delay = 1
#end_delay = 1
#success = development.segment_effect_rgbw(2, 22, n, start, end, start_delay, end_delay, 255, 0, 255, 0, channel, realtime)
#print(success)

####################################
# Segment RGB Effect Command Tests #
####################################

#Segment Effect RGB Fill Forward (clear, effect, n, start, end, start_delay, end_delay, R,G,B, channel, realtime)
#n = 0
#start = 10
#end = 30
#start_delay = 10
#end_delay = 20
#success = development.segment_effect_rgb(0, 1, n, start, end, start_delay, end_delay, 0, 0, 255, channel, realtime)
#print(success)

####################################
# Segment HSV Effect Command Tests #
####################################

# Not Done yet!!!!! Coming soon

########################
# Loop Effect Commands #
########################

#Start Loop Effect
#clear = 1
#success = development.start_loop_effect(clear)
#print(success)

#Stop Loop Effect
#clear = 1
#success = development.stop_loop_effect(clear)
#print(success)

###############
# Transitions #
###############

#success = development.brightness(0)
#success = development.strip_rgbw(0,0,0,255)
#print("fade")
#time.sleep(1)

#Brightness Fade: Mode, Curve, Start, End, Time (in ms), Step (0xa5) -> (Mode 0x00=Current Brightness, 0x01=Start), (Cuve 0x00=Lin,0x01=Exp,0x02=Log)
#start_time = time.time()
#realtime = 0
#mode = 1
#curve = 0
#time_ms = 1000
#start = 0
#end = 100
#step = 1
#success = development.brightness_fade(mode, curve, start, end, time_ms, step, channel, realtime)
#print (success)
#print("--- %s seconds ---" % (time.time() - start_time))

#########################
# Palette Command Tests #
#########################

#Get Palette: Returns Global Palette
#palette = development.get_palette()
#print(palette)

#Set Palette(palette,channel,realtime): Set global Palette
#palette = 7
#success = development.set_palette(palette,channel,realtime)
#print(success)

#Set Simple Custom Palette (R,G,B,R,G,B,channel,realtime): Set global Palette from 2 colors 2 x (R,G,B)-> returns '1' if succesful
#success = development.set_simple_custom_palette(255, 0, 0, 0, 255, 0, channel, realtime)
#print(success)

#Set Advanced Global Palette: (Position, Red, Green, Blue (2-16 x (Postion,R,G,B), channel, realtime)
#arr=[[0,255,0,0],[127,0,255,0],[255,255,0,255]]
#success = development.set_advanced_custom_palette(arr,channel,realtime)
#print(success)

#Set Target Palette (palette,channel,realtime): Set Global Target Palette for Blending
#palette = 40
#success = development.set_target_palette(palette,channel,realtime)
#print(success)

#Set Simple Target Palette for Blending (R,G,B,R,G,B,channel,realtim): Set global Palette from 2 colors 2 x (R,G,B)-> returns '1' if succesful
#success = development.set_simple_target_palette(0, 255, 0, 255, 0, 0, channel, realtime)
#print(success)

#Set Advanced Target Palette for Blending: (Position, Red, Green, Blue (2-16 x (Postion,R,G,B), channel, realtime)
#arr=[[0,0,255,0],[100,0,0,255],[255,255,0,0]]
#success = development.set_advanced_target_palette(arr,channel,realtime)
#print(success)

#Strip Palette (blend,scale,start_index end_index,channel,realtime,commit) -> 0=No Blend 1=Linear Blend, 0=No Scale or (1-255), 0=No Alternate 1=Alternate
#channel = 0
#blend = 1
#scale = 1
#alternate = 0
#start_index = 0
#end_index = 255
#success = development.strip_palette(blend,scale,alternate,start_index,end_index,channel,realtime,commit)
#print(success)

#Strip Part Palette (start,end,blend,scale,start_index,end_index,channel,realtime,commit) -> 0=No Blend 1=Linear Blend, 0=No Scale or (1-255), 0=No Alternate 1=Alternate
#start = 1
#end = 2
#clear = 1
#channel = 0
#blend = 1
#scale = 1
#alternate = 0
#start_index = 0
#end_index = 255
#success = development.strip_part_palette(start,end,clear,blend,scale,alternate,start_index,end_index,channel,realtime,commit)
#print(success)

#Segment Palette (start,end,blend,scale,start_index,end_index,channel,realtime,commit) -> 0=No Blend 1=Linear Blend, 0=No Scale or (1-255), 0=No Alternate 1=Alternate
#start = 100
#end = 200
#clear = 1
#channel = 2
#blend = 1
#scale = 3
#alternate = 0
#start_index = 0
#end_index = 255
#success = development.segment_palette(start,end,clear,blend,scale,alternate,start_index,end_index,channel,realtime,commit)
#print(success)

#Blend Palette (speed,steps,delay,channel,realtime) : Blends Current Palette to Target Pallette with Step -> 0=No Blend, 1=Very Slow, 50=Fast (Call Blend 100 times)
#speed = 50
#steps = 1
#delay = 0
#for x in range(150):
#  print (x)
#  time.sleep(0.01)
#  success = development.blend_palette(speed,steps,delay,channel,realtime)
#  success = development.strip_palette(blend,scale,alternate,start_index,end_index,channel,realtime,commit)

##################################
# Controller Additional Commands #
##################################

#On: Turns PSU On and all channels On depending on Startup Mode it will go to Default or Saved State
#success = development.on()
#print(success)

#Off: Turn Leds Off and PSU Off
#success = development.off()
#print(success)

#Sleep: Put Led Controller Asleep. Turn Power Save On. 
#success = development.sleep()
#print(success)

#Awake: Awaken Led Controller or Keep Awake. Turn Power Save Off. (After Power Save Leds will remain off. Use 'On' or 'Restore' to turn leds on).
#success = development.awake()

#print(success)

#Set Temp Overload: Set Controller in Temperature Overload Mode. (After this Controller will return errors until reset).
#success = development.set_temp_overload()
#print(success)

#Get Temp Overload: Get Controller Temperature Overload Mode. (0=No Temp Overload, 1=Temp Overload).
#temp_overload = development.get_temp_overload()
#print(temp_overload)

#Reset Temp Overload: Reset Controller Temperature Overload Mode. (After this Controller will resume operation)
#success = development.reset_temp_overload()
#print(success)

#Set Power Overload: Set Controller in Power Overload Mode. (After this Controller will return errors until reset).
#success = development.set_power_overload()
#print(success)

#Get Power Overload: Get Controller Power Overload Mode. (0=No Power Overload, 1=Power Overload).
#power_overload = development.get_power_overload()
#print(power_overload)

#Reset Power Overload: Reset Controller Power Overload Mode. (After this Controller will resume operation)
#success = development.reset_power_overload()
#print(success)

#Reset Controller (realtime)
#success = development.reset(realtime)
#print(success)

#Get State: Get Led State 0=Leds Off, 1=Leds On
#state = development.get_state()
#print(state)

#Set Color Correct Values: Scales Color Values (R,G,B) (0-100%) from normal color values
#red = 100
#green = 100
#blue = 100
#succes = development.set_color_correct_values(red, green, blue)
#print(succes)

#Get Color Correct Values (R,G,B) (0-100%)
#color_correct_values = development.get_color_correct_values()
#print(color_correct_values)

##################################################
# Controller Power Management Info Command Tests #
##################################################

#Get Power Save State
#power_save_state = development.get_power_save_state()
#print(power_save_state)

#Get Power Save Time
#power_save_time = development.get_power_save_time()
#print(power_save_time)

#Get Power Save Mode
#power_save_mode = development.get_power_save_mode()
#print(power_save_mode)

#Get Power Auto Mode
#power_auto_mode = development.get_power_auto_mode()
#print(power_auto_mode)

#Get Start Mode
#start_mode = development.get_start_mode()
#print(start_mode)

#Get Max Brightness
#max_brightness = development.get_max_brightness()
#print(max_brightness)

#Get Max Brightness Mode
#max_brightness_mode = development.get_max_brightness_mode()
#print(max_brightness_mode)

#Get Max Brightness Mode
#max_brightness_mode = development.get_max_brightness_mode()
#print(max_brightness_mode)

#Get Default Brightness
#default_brightness = development.get_default_brightness()
#print(default_brightness)

#Get Default Color
#default_color = development.get_default_color()
#print(default_color)

#Get Regulation Mode -> Returns Power Regulation Mode (0=Off, 1=Total, 2=Channel 3=Total Max, 4=Channel Max, 5=Overload, 6=Shutdown) No Auto Power On!!
#regulation = development.get_regulation_mode()
#print(regulation)

#Get Power Calc Values (option, channel): Option (0=Off, 1=Red, 2=Green, 3=Blue, 4=White)
#power_calc_value = development.get_power_calc_values(1)
#print(power_calc_value)

#Get Calculated Power (option, channel): Option (0=Actual, 1=Last, 2=Max, 3=Worst, 4=Available, 5=Off)
#amperage=float(calculated_power[1:-1]) / 5
#print("5.0 V")
#print(str(round(amperage,1)) + 'A')
#actual_power = development.get_calculated_power(0, 0)
#print("Actual Power: " + str(round(float(actual_power[1:-1]),1)) + 'W')
#amperage=float(actual_power[1:-1]) / 5
#print("5.0 V")
#print(str(round(amperage,1)) + 'A')

#print("")

#last_power = development.get_calculated_power(1, 0)
#print("Last Power: " + str(round(float(last_power[1:-1]),1)) + 'W')
#max_power = development.get_calculated_power(2, 0)
#print("Max Power: " + str(round(float(max_power[1:-1]),1)) + 'W')
#worst_power = development.get_calculated_power(3, 0)
#print("Worst Power: " + str(round(float(worst_power[1:-1]),1)) + 'W')
#available_power = development.get_calculated_power(4, 0)
#print("Available Power: " + str(round(float(available_power[1:-1]),1)) + 'W')

#print("")

#Get Calculated Brightness (option, channel): Option (0=Actual, 1=Last, 2=Max, 3=Worst)
#advised_brightness = development.get_calculated_brightness(0, 0)
#print("Actual Advised Brightness: " + advised_brightness[1:-1])
#last_brightness = development.get_calculated_brightness(1, 0)
#print("Last Advised Brightness: " + last_brightness[1:-1])
#max_brightness = development.get_calculated_brightness(2, 0)
#print("Max Advised Brightness: " + max_brightness[1:-1])
#worst_brightness = development.get_calculated_brightness(3, 0)
#print("Worst Advised Brightness: " + worst_brightness[1:-1])

######################################
# Controller Data Info Command Tests #
######################################

#Get Error Last
#error = development.get_error()
#print(error)

#Reset Error
#success = development.reset_error()
#print(success)

#Get Error Rate previous Minute
#error_rate = development.get_error_rate()
#print(error_rate)

#Get Error Count
#error_count = development.get_error_count()
#print(error_count)

#Reset Error Count
#succes = development.reset_error_count()
#print(succes)

#Get Error Time
#error_time = development.get_error_time()
#print(error_time)

#Get Data Count
#data_count = development.get_data_count()
#print(data_count)

#Reset Data Count
#succes = development.reset_data_count()
#print(succes)

#Get Data Rate previous Minute
#data_rate = development.get_data_rate()
#print(data_rate)

#Get Data Last
#data = development.get_data()
#print(data)

#Get Data Time
#data_time = development.get_data_time()
#print(data_time)
