hass-core/homeassistant/components/plugwise/__init__.py
Tom db60a71603
Change Plugwise integration to plugwise module (#43036)
* Switch to plugwise module and forthcoming changes

* Adjusted according to review

* Fix leaving out domain for tests

* Add tests for exceptions

* Add more tests for exceptions

* Version bump

* Wording on test

* Catch-up with dev
2020-11-20 20:43:20 -06:00

28 lines
906 B
Python

"""Plugwise platform for Home Assistant Core."""
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST
from homeassistant.core import HomeAssistant
from .gateway import async_setup_entry_gw, async_unload_entry_gw
async def async_setup(hass: HomeAssistant, config: dict):
"""Set up the Plugwise platform."""
return True
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Plugwise components from a config entry."""
if entry.data.get(CONF_HOST):
return await async_setup_entry_gw(hass, entry)
# PLACEHOLDER USB entry setup
return False
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry):
"""Unload the Plugwise components."""
if entry.data.get(CONF_HOST):
return await async_unload_entry_gw(hass, entry)
# PLACEHOLDER USB entry setup
return False