def setup_light(device_id, name, insteonhub, hass, add_devices_callback):
 if (device_id in _CONFIGURING):
  request_id = _CONFIGURING.pop(device_id)
  configurator = get_component('configurator')
  configurator.request_done(request_id)
  _LOGGER.info('Device configuration done!')
 conf_lights = config_from_file(hass.config.path(INSTEON_LOCAL_LIGHTS_CONF))
 if (device_id not in conf_lights):
  conf_lights[device_id] = name
 if (not config_from_file(hass.config.path(INSTEON_LOCAL_LIGHTS_CONF), conf_lights)):
  _LOGGER.error('Failed to save configuration file')
 device = insteonhub.dimmer(device_id)
 add_devices_callback([InsteonLocalDimmerDevice(device, name)])

def setup_light ( device_id , name , insteonhub , hass , add_devices_callback ) : if ( device_id in _CONFIGURING ) : request_id = _CONFIGURING . pop ( device_id ) configurator = get_component ( 'configurator' ) configurator . request_done ( request_id ) _LOGGER . info ( 'Device configuration done!' ) conf_lights = config_from_file ( hass . config . path ( INSTEON_LOCAL_LIGHTS_CONF ) ) if ( device_id not in conf_lights ) : conf_lights [ device_id ] = name if ( not config_from_file ( hass . config . path ( INSTEON_LOCAL_LIGHTS_CONF ) , conf_lights ) ) : _LOGGER . error ( 'Failed to save configuration file' ) device = insteonhub . dimmer ( device_id ) add_devices_callback ( [ InsteonLocalDimmerDevice ( device , name ) ] )
set up the light .