Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up superfluous integration setup - part 1 #48476

Merged
merged 1 commit into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions homeassistant/components/acmeda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
PLATFORMS = ["cover", "sensor"]


async def async_setup(hass: core.HomeAssistant, config: dict):
"""Set up the Rollease Acmeda Automate component."""
return True


async def async_setup_entry(
hass: core.HomeAssistant, config_entry: config_entries.ConfigEntry
):
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/agent_dvr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
FORWARDS = ["alarm_control_panel", "camera"]


async def async_setup(hass, config):
"""Old way to set up integrations."""
return True


async def async_setup_entry(hass, config_entry):
"""Set up the Agent component."""
hass.data.setdefault(AGENT_DOMAIN, {})
Expand Down
6 changes: 0 additions & 6 deletions homeassistant/components/airly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import async_timeout

from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.core import Config, HomeAssistant
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed

Expand Down Expand Up @@ -43,11 +42,6 @@ def set_update_interval(hass, instances):
return interval


async def async_setup(hass: HomeAssistant, config: Config) -> bool:
"""Set up configured Airly."""
return True


async def async_setup_entry(hass, config_entry):
"""Set up Airly as config entry."""
api_key = config_entry.data[CONF_API_KEY]
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/alarmdecoder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@
PLATFORMS = ["alarm_control_panel", "sensor", "binary_sensor"]


async def async_setup(hass, config):
"""Set up for the AlarmDecoder devices."""
return True


async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool:
"""Set up AlarmDecoder config flow."""
undo_listener = entry.add_update_listener(_update_listener)
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/apple_tv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
PLATFORMS = [MP_DOMAIN, REMOTE_DOMAIN]


async def async_setup(hass, config):
"""Set up the Apple TV integration."""
return True


async def async_setup_entry(hass, entry):
"""Set up a config entry for Apple TV."""
manager = AppleTVManager(hass, entry)
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/atag/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
PLATFORMS = [CLIMATE, WATER_HEATER, SENSOR]


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


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
"""Set up Atag integration from a config entry."""

Expand Down
6 changes: 0 additions & 6 deletions homeassistant/components/awair/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from python_awair.exceptions import AuthError

from homeassistant.const import CONF_ACCESS_TOKEN
from homeassistant.core import Config, HomeAssistant
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed

Expand All @@ -18,11 +17,6 @@
PLATFORMS = ["sensor"]


async def async_setup(hass: HomeAssistant, config: Config) -> bool:
"""Set up Awair integration."""
return True


async def async_setup_entry(hass, config_entry) -> bool:
"""Set up Awair integration from a config entry."""
session = async_get_clientsession(hass)
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/axis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
_LOGGER = logging.getLogger(__name__)


async def async_setup(hass, config):
"""Old way to set up Axis devices."""
return True


async def async_setup_entry(hass, config_entry):
"""Set up the Axis component."""
hass.data.setdefault(AXIS_DOMAIN, {})
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/azure_devops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
_LOGGER = logging.getLogger(__name__)


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


async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool:
"""Set up Azure DevOps from a config entry."""
client = DevOpsClient()
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/blebox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
PARALLEL_UPDATES = 0


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


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
"""Set up BleBox devices from a config entry."""

Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/braviatv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
PLATFORMS = ["media_player"]


async def async_setup(hass, config):
"""Set up the Bravia TV component."""
return True


async def async_setup_entry(hass, config_entry):
"""Set up a config entry."""
host = config_entry.data[CONF_HOST]
Expand Down
7 changes: 1 addition & 6 deletions homeassistant/components/brother/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_TYPE
from homeassistant.core import Config, HomeAssistant
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed

from .const import DATA_CONFIG_ENTRY, DOMAIN, SNMP
Expand All @@ -20,11 +20,6 @@
_LOGGER = logging.getLogger(__name__)


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


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
"""Set up Brother from a config entry."""
host = entry.data[CONF_HOST]
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/cert_expiry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
SCAN_INTERVAL = timedelta(hours=12)


async def async_setup(hass, config):
"""Platform setup, do nothing."""
return True


async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
"""Load the saved entities."""
host = entry.data[CONF_HOST]
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/devolo_home_control/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
from .const import CONF_MYDEVOLO, DOMAIN, GATEWAY_SERIAL_PATTERN, PLATFORMS


async def async_setup(hass, config):
"""Get all devices and add them to hass."""
return True


async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool:
"""Set up the devolo account from a config entry."""
hass.data.setdefault(DOMAIN, {})
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/dialogflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ class DialogFlowError(HomeAssistantError):
"""Raised when a DialogFlow error happens."""


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


async def handle_webhook(hass, webhook_id, request):
"""Handle incoming webhook with Dialogflow requests."""
message = await request.json()
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/dunehd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
PLATFORMS = ["media_player"]


async def async_setup(hass, config):
"""Set up the Dune HD component."""
return True


async def async_setup_entry(hass, config_entry):
"""Set up a config entry."""
host = config_entry.data[CONF_HOST]
Expand Down
7 changes: 0 additions & 7 deletions homeassistant/components/ipma/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
"""Component for the Portuguese weather service - IPMA."""
from homeassistant.core import Config, HomeAssistant

from .config_flow import IpmaFlowHandler # noqa: F401
from .const import DOMAIN # noqa: F401

DEFAULT_NAME = "ipma"


async def async_setup(hass: HomeAssistant, config: Config) -> bool:
"""Set up configured IPMA."""
return True


async def async_setup_entry(hass, config_entry):
"""Set up IPMA station as config entry."""
hass.async_create_task(
Expand Down
3 changes: 0 additions & 3 deletions tests/components/alarmdecoder/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ async def test_setups(hass: HomeAssistant, protocol, connection, title):
with patch("homeassistant.components.alarmdecoder.config_flow.AdExt.open"), patch(
"homeassistant.components.alarmdecoder.config_flow.AdExt.close"
), patch(
"homeassistant.components.alarmdecoder.async_setup", return_value=True
) as mock_setup, patch(
"homeassistant.components.alarmdecoder.async_setup_entry",
return_value=True,
) as mock_setup_entry:
Expand All @@ -92,7 +90,6 @@ async def test_setups(hass: HomeAssistant, protocol, connection, title):
}
await hass.async_block_till_done()

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/azure_devops/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ async def test_reauth_flow(hass: HomeAssistant) -> None:
async def test_full_flow_implementation(hass: HomeAssistant) -> None:
"""Test registering an integration and finishing flow works."""
with patch(
"homeassistant.components.azure_devops.async_setup", return_value=True
) as mock_setup, patch(
"homeassistant.components.azure_devops.async_setup_entry",
return_value=True,
) as mock_setup_entry, patch(
Expand All @@ -255,7 +253,6 @@ async def test_full_flow_implementation(hass: HomeAssistant) -> None:
FIXTURE_USER_INPUT,
)
await hass.async_block_till_done()
assert len(mock_setup.mock_calls) == 1
assert len(mock_setup_entry.mock_calls) == 1

assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
Expand Down
8 changes: 0 additions & 8 deletions tests/components/devolo_home_control/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ async def test_form(hass):
assert result["errors"] == {}

with patch(
"homeassistant.components.devolo_home_control.async_setup",
return_value=True,
) as mock_setup, patch(
"homeassistant.components.devolo_home_control.async_setup_entry",
return_value=True,
) as mock_setup_entry, patch(
Expand All @@ -43,7 +40,6 @@ async def test_form(hass):
"mydevolo_url": "https://www.mydevolo.com",
}

assert len(mock_setup.mock_calls) == 1
assert len(mock_setup_entry.mock_calls) == 1


Expand Down Expand Up @@ -90,9 +86,6 @@ async def test_form_advanced_options(hass):
assert result["errors"] == {}

with patch(
"homeassistant.components.devolo_home_control.async_setup",
return_value=True,
) as mock_setup, patch(
"homeassistant.components.devolo_home_control.async_setup_entry",
return_value=True,
) as mock_setup_entry, patch(
Expand All @@ -117,5 +110,4 @@ async def test_form_advanced_options(hass):
"mydevolo_url": "https://test_mydevolo_url.test",
}

assert len(mock_setup.mock_calls) == 1
assert len(mock_setup_entry.mock_calls) == 1