def setup_gpmdp(hass, config, code, add_devices):
 name = config.get(CONF_NAME)
 host = config.get(CONF_HOST)
 port = config.get(CONF_PORT)
 url = 'ws://{}:{}'.format(host, port)
 if (not code):
  request_configuration(hass, config, url, add_devices)
  return
 if ('gpmdp' in _CONFIGURING):
  configurator = get_component('configurator')
  configurator.request_done(_CONFIGURING.pop('gpmdp'))
 add_devices([GPMDP(name, url, code)])

def setup_gpmdp ( hass , config , code , add_devices ) : name = config . get ( CONF_NAME ) host = config . get ( CONF_HOST ) port = config . get ( CONF_PORT ) url = 'ws://{}:{}' . format ( host , port ) if ( not code ) : request_configuration ( hass , config , url , add_devices ) return if ( 'gpmdp' in _CONFIGURING ) : configurator = get_component ( 'configurator' ) configurator . request_done ( _CONFIGURING . pop ( 'gpmdp' ) ) add_devices ( [ GPMDP ( name , url , code ) ] )
setup gpmdp .