1 """The lg_soundbar component."""
5 from homeassistant
import config_entries, core
9 from .config_flow
import test_connect
10 from .const
import DOMAIN
12 _LOGGER = logging.getLogger(__name__)
14 PLATFORMS = [Platform.MEDIA_PLAYER]
20 """Set up platform from a ConfigEntry."""
21 hass.data.setdefault(DOMAIN, {})
24 await hass.async_add_executor_job(
25 test_connect, entry.data[CONF_HOST], entry.data[CONF_PORT]
27 except ConnectionError
as err:
28 raise ConfigEntryNotReady
from err
30 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
37 """Unload a config entry."""
38 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_unload_entry(core.HomeAssistant hass, config_entries.ConfigEntry entry)
bool async_setup_entry(core.HomeAssistant hass, config_entries.ConfigEntry entry)