@callback
def async_create_setup_task():
    'Get task to set up platform.'
    if getattr(platform, 'async_setup_platform', None):
        return platform.async_setup_platform(hass, platform_config, self._async_schedule_add_entities, discovery_info)
    return hass.loop.run_in_executor(None, platform.setup_platform, hass, platform_config, self._schedule_add_entities, discovery_info)
Get task to set up platform.
@callback
def async_create_setup_task():
    
    if getattr(platform, 'async_setup_platform', None):
        return platform.async_setup_platform(hass, platform_config, self._async_schedule_add_entities, discovery_info)
    return hass.loop.run_in_executor(None, platform.setup_platform, hass, platform_config, self._schedule_add_entities, discovery_info)