#NEWLINE# def _update_lights( self , lightshow_step = 0 ) : #NEWLINE# #INDENT# self . _stop_current_lights ( ) #NEWLINE# if ( not self . player ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if self . debug : #NEWLINE# #INDENT# self . log . debug ( "Updating lights 1: Profile: %s, lightshow_step: %s, Enabled: %s, Config setting for 'lights_when_disabled': %s" , self . active_settings [ 'profile' ] , lightshow_step , state_settings . active_settings [ 'enable' ] , self . active_settings [ 'settings' ] [ 'lights_when_disabled' ] ) #NEWLINE# #UNINDENT# if ( ( not self . active_settings [ 'enable' ] ) and ( not self . active_settings [ 'settings' ] [ 'lights_when_disabled' ] ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# state_settings = self . active_settings [ 'settings' ] [ 'states' ] [ self . player [ self . active_settings [ 'settings' ] [ 'player_variable' ] ] ] #NEWLINE# if self . debug : #NEWLINE# #INDENT# self . log . debug ( "Updating lights 2: Profile: '%s', State: %s, State settings: %s, Lights: %s, LEDs: %s, Priority: %s" , self . active_settings [ 'profile' ] , self . enable_table [ self . active_mode ] [ 'current_state_name' ] , state_settings , self . config [ 'light' ] , self . config [ 'led' ] , self . active_settings [ 'priority' ] ) #NEWLINE# #UNINDENT# if ( state_settings [ 'light_script' ] and ( self . config [ 'light' ] or self . config [ 'led' ] ) ) : #NEWLINE# #INDENT# self . running_light_show = self . machine . light_controller . run_registered_script ( script_name = state_settings [ 'light_script' ] , lights = [ x . name for x in self . config [ 'light' ] ] , leds = [ x . name for x in self . config [ 'led' ] ] , start_location = lightshow_step , priority = self . active_settings [ 'priority' ] , ** state_settings ) #NEWLINE# #UNINDENT# if self . debug : #NEWLINE# #INDENT# self . log . debug ( 'New running light show: %s' , self . running_light_show )