#NEWLINE# def setup_platform( hass , config , add_devices , discovery_info = None ) : #NEWLINE# #INDENT# 'Setup the Command Sensor.' #NEWLINE# if ( config . get ( 'command' ) is None ) : #NEWLINE# #INDENT# _LOGGER . error ( 'Missing required variable: "command"' ) #NEWLINE# return False #NEWLINE# #UNINDENT# data = CommandSensorData ( config . get ( 'command' ) ) #NEWLINE# add_devices ( [ CommandBinarySensor ( discovery_info , data , config . get ( 'name' , DEFAULT_NAME ) , config . get ( 'payload_on' , DEFAULT_PAYLOAD_ON ) , config . get ( 'payload_off' , DEFAULT_PAYLOAD_OFF ) , config . get ( CONF_VALUE_TEMPLATE ) ) ] )