<s> from Tkinter import * <EOL> from phue import Bridge <EOL> '''<STR_LIT>''' <EOL> b = Bridge ( ) <EOL> root = Tk ( ) <EOL> horizontal_frame = Frame ( root ) <EOL> horizontal_frame . pack ( ) <EOL> lights = b . get_light_objects ( '<STR_LIT:id>' ) <EOL> for light_id in lights : <EOL> channel_frame = Frame ( horizontal_frame ) <EOL> channel_frame . pack ( side = LEFT ) <EOL> scale_command = lambda x , light_id = light_id : b . set_light ( light_id , { '<STR_LIT>' : int ( x ) , '<STR_LIT>' : <NUM_LIT:1> } ) <EOL> scale = Scale ( channel_frame , from_ = <NUM_LIT> , to = <NUM_LIT:0> , command = scale_command , length = <NUM_LIT:200> , showvalue = <NUM_LIT:0> ) <EOL> scale . set ( b . get_light ( light_id , '<STR_LIT>' ) ) <EOL> scale . pack ( ) <EOL> button_var = BooleanVar ( ) <EOL> button_var . set ( b . get_light ( light_id , '<STR_LIT>' ) ) <EOL> button_command = lambda button_var = button_var , light_id = light_id : b . set_light ( light_id , '<STR_LIT>' , button_var . get ( ) ) <EOL> button = Checkbutton ( channel_frame , variable = button_var , command = button_command ) <EOL> button . pack ( ) <EOL> label = Label ( channel_frame ) <EOL> label . config ( text = b . get_light ( light_id , '<STR_LIT:name>' ) ) <EOL> label . pack ( ) <EOL> root . mainloop ( ) </s>
