Skip to content

Commit

Permalink
Clean up a couple
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed Mar 26, 2021
1 parent d5418cc commit d4d241a
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 55 deletions.
9 changes: 1 addition & 8 deletions homeassistant/components/accuweather/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from async_timeout import timeout

from homeassistant.const import CONF_API_KEY
from homeassistant.core import Config, HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
Expand All @@ -26,12 +25,6 @@
PLATFORMS = ["sensor", "weather"]


async def async_setup(hass: HomeAssistant, config: Config) -> bool:
"""Set up configured AccuWeather."""
hass.data.setdefault(DOMAIN, {})
return True


async def async_setup_entry(hass, config_entry) -> bool:
"""Set up AccuWeather as config entry."""
api_key = config_entry.data[CONF_API_KEY]
Expand All @@ -52,7 +45,7 @@ async def async_setup_entry(hass, config_entry) -> bool:

undo_listener = config_entry.add_update_listener(update_listener)

hass.data[DOMAIN][config_entry.entry_id] = {
hass.data.setdefault(DOMAIN, {})[config_entry.entry_id] = {
COORDINATOR: coordinator,
UNDO_UPDATE_LISTENER: undo_listener,
}
Expand Down
7 changes: 1 addition & 6 deletions homeassistant/components/adguard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.typing import ConfigType, HomeAssistantType
from homeassistant.helpers.typing import HomeAssistantType

_LOGGER = logging.getLogger(__name__)

Expand All @@ -48,11 +48,6 @@
PLATFORMS = ["sensor", "switch"]


async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool:
"""Set up the AdGuard Home components."""
return True


async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool:
"""Set up AdGuard Home from a config entry."""
session = async_get_clientsession(hass, entry.data[CONF_VERIFY_SSL])
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/airnow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@
PLATFORMS = ["sensor"]


async def async_setup(hass: HomeAssistant, config: dict):
"""Set up the AirNow component."""
return True


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
"""Set up AirNow from a config entry."""
api_key = entry.data[CONF_API_KEY]
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/deconz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
)


async def async_setup(hass, config):
"""Old way of setting up deCONZ integrations."""
return True


async def async_setup_entry(hass, config_entry):
"""Set up a deCONZ bridge for a config entry.
Expand Down
6 changes: 0 additions & 6 deletions homeassistant/components/elgato/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.typing import ConfigType

from .const import DATA_ELGATO_CLIENT, DOMAIN


async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Elgato Key Light components."""
return True


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Elgato Key Light from a config entry."""
session = async_get_clientsession(hass)
Expand Down
7 changes: 1 addition & 6 deletions homeassistant/components/esphome/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from homeassistant.helpers.service import async_set_service_schema
from homeassistant.helpers.storage import Store
from homeassistant.helpers.template import Template
from homeassistant.helpers.typing import ConfigType, HomeAssistantType
from homeassistant.helpers.typing import HomeAssistantType

# Import config flow so that it's added to the registry
from .entry_data import RuntimeEntryData
Expand All @@ -56,11 +56,6 @@
CONFIG_SCHEMA = vol.Schema({}, extra=vol.ALLOW_EXTRA)


async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool:
"""Stub to allow setting up this component."""
return True


async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool:
"""Set up the esphome component."""
hass.data.setdefault(DOMAIN, {})
Expand Down
6 changes: 0 additions & 6 deletions homeassistant/components/tasmota/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
EVENT_DEVICE_REGISTRY_UPDATED,
async_entries_for_config_entry,
)
from homeassistant.helpers.typing import HomeAssistantType

from . import device_automation, discovery
from .const import (
Expand All @@ -38,11 +37,6 @@
_LOGGER = logging.getLogger(__name__)


async def async_setup(hass: HomeAssistantType, config: dict):
"""Set up the Tasmota component."""
return True


async def async_setup_entry(hass, entry):
"""Set up Tasmota from a config entry."""
websocket_api.async_register_command(hass, websocket_remove_device)
Expand Down
6 changes: 0 additions & 6 deletions homeassistant/components/wled/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.typing import ConfigType
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
DataUpdateCoordinator,
Expand All @@ -37,11 +36,6 @@
_LOGGER = logging.getLogger(__name__)


async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the WLED components."""
return True


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up WLED from a config entry."""

Expand Down
5 changes: 1 addition & 4 deletions tests/components/airnow/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ async def test_form(hass):
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["errors"] == {}

with patch("pyairnow.WebServiceAPI._get", return_value=MOCK_RESPONSE,), patch(
"homeassistant.components.airnow.async_setup", return_value=True
) as mock_setup, patch(
with patch("pyairnow.WebServiceAPI._get", return_value=MOCK_RESPONSE), patch(
"homeassistant.components.airnow.async_setup_entry",
return_value=True,
) as mock_setup_entry:
Expand All @@ -90,7 +88,6 @@ async def test_form(hass):

assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
assert result2["data"] == CONFIG
assert len(mock_setup.mock_calls) == 1
assert len(mock_setup_entry.mock_calls) == 1


Expand Down
3 changes: 0 additions & 3 deletions tests/components/deconz/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,6 @@ async def test_flow_hassio_discovery(hass):
assert result["description_placeholders"] == {"addon": "Mock Addon"}

with patch(
"homeassistant.components.deconz.async_setup", return_value=True
) as mock_setup, patch(
"homeassistant.components.deconz.async_setup_entry",
return_value=True,
) as mock_setup_entry:
Expand All @@ -555,7 +553,6 @@ async def test_flow_hassio_discovery(hass):
CONF_PORT: 80,
CONF_API_KEY: API_KEY,
}
assert len(mock_setup.mock_calls) == 1
assert len(mock_setup_entry.mock_calls) == 1


Expand Down

0 comments on commit d4d241a

Please sign in to comment.