async def async_setup_entry(self, config_entry):
    'Set up the platform from a config entry.'
    self.config_entry = config_entry
    platform = self.platform

    @callback
    def async_create_setup_task():
        'Get task to set up platform.'
        return platform.async_setup_entry(self.hass, config_entry, self._async_schedule_add_entities)
    return (await self._async_setup_platform(async_create_setup_task))
Set up the platform from a config entry.
async def async_setup_entry(self, config_entry):
    
    self.config_entry = config_entry
    platform = self.platform

    @callback
    def async_create_setup_task():
        'Get task to set up platform.'
        return platform.async_setup_entry(self.hass, config_entry, self._async_schedule_add_entities)
    return (await self._async_setup_platform(async_create_setup_task))