#NEWLINE# def setup_platform( hass , config , add_devices_callback , discovery_info = None ) : #NEWLINE# #INDENT# 'Find and return switches controlled by shell commands.' #NEWLINE# switches = config . get ( 'switches' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# devices = [ ] #NEWLINE# for ( dev_name , properties ) in switches . items ( ) : #NEWLINE# #INDENT# devices . append ( CommandSwitch ( hass , properties . get ( 'name' , dev_name ) , properties . get ( 'oncmd' , 'true' ) , properties . get ( 'offcmd' , 'true' ) , properties . get ( 'statecmd' , False ) , properties . get ( CONF_VALUE_TEMPLATE , False ) ) ) #NEWLINE# #UNINDENT# add_devices_callback ( devices )