@asyncio.coroutine
def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
    'Setup the Kodi platform.'
    host = config.get(CONF_HOST)
    port = config.get(CONF_PORT)
    if (host.startswith('http://') or host.startswith('https://')):
        host = host.lstrip('http://').lstrip('https://')
        _LOGGER.warning('Kodi host name should no longer conatin http:// See updated definitions here: https://home-assistant.io/components/media_player.kodi/')
    entity = KodiDevice(hass, name=config.get(CONF_NAME), host=host, port=port, username=config.get(CONF_USERNAME), password=config.get(CONF_PASSWORD), turn_off_action=config.get(CONF_TURN_OFF_ACTION))
    (yield from async_add_entities([entity], update_before_add=True))
Setup the Kodi platform.
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
    
    host = config.get(CONF_HOST)
    port = config.get(CONF_PORT)
    if (host.startswith('http://') or host.startswith('https://')):
        host = host.lstrip('http://').lstrip('https://')
        _LOGGER.warning('Kodi host name should no longer conatin http:// See updated definitions here: https://home-assistant.io/components/media_player.kodi/')
    entity = KodiDevice(hass, name=config.get(CONF_NAME), host=host, port=port, username=config.get(CONF_USERNAME), password=config.get(CONF_PASSWORD), turn_off_action=config.get(CONF_TURN_OFF_ACTION))
    (yield from async_add_entities([entity], update_before_add=True))