<s> """<STR_LIT>""" <EOL> from mpf . system . device import Device <EOL> from mpf . system . timing import Timing <EOL> class Switch ( Device ) : <EOL> """<STR_LIT>""" <EOL> config_section = '<STR_LIT>' <EOL> collection = '<STR_LIT>' <EOL> class_label = '<STR_LIT>' <EOL> def __init__ ( self , machine , name , config , collection = None , validate = True ) : <EOL> config [ '<STR_LIT>' ] = str ( config [ '<STR_LIT>' ] ) . upper ( ) <EOL> super ( Switch , self ) . __init__ ( machine , name , config , collection , <EOL> platform_section = '<STR_LIT>' , <EOL> validate = validate ) <EOL> self . machine = machine <EOL> self . name = name <EOL> self . deactivation_events = set ( ) <EOL> self . activation_events = set ( ) <EOL> self . state = <NUM_LIT:0> <EOL> """<STR_LIT>""" <EOL> self . hw_state = <NUM_LIT:0> <EOL> """<STR_LIT>""" <EOL> self . invert = <NUM_LIT:0> <EOL> self . recycle_ticks = <NUM_LIT:0> <EOL> self . recycle_clear_tick = <NUM_LIT:0> <EOL> self . recycle_jitter_count = <NUM_LIT:0> <EOL> if self . config [ '<STR_LIT:type>' ] . upper ( ) == '<STR_LIT>' : <EOL> self . invert = <NUM_LIT:1> <EOL> self . recycle_ticks = self . config [ '<STR_LIT>' ] <EOL> self . last_changed = None <EOL> self . hw_timestamp = None <EOL> self . log . debug ( "<STR_LIT>" , name , self . config ) <EOL> self . hw_switch , self . number = ( <EOL> self . platform . configure_switch ( self . config ) ) </s>
