mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Clean up superfluous integration setup - part 1 (#48476)
This commit is contained in:
parent
a851bff95a
commit
8393a215e9
@ -11,11 +11,6 @@ CONF_HUBS = "hubs"
|
||||
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
|
||||
):
|
||||
|
@ -16,11 +16,6 @@ DEFAULT_BRAND = "Agent DVR by ispyconnect.com"
|
||||
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, {})
|
||||
|
@ -10,7 +10,6 @@ from airly.exceptions import AirlyError
|
||||
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
|
||||
|
||||
@ -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]
|
||||
|
@ -39,11 +39,6 @@ _LOGGER = logging.getLogger(__name__)
|
||||
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)
|
||||
|
@ -42,11 +42,6 @@ SIGNAL_DISCONNECTED = "apple_tv_disconnected"
|
||||
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)
|
||||
|
@ -23,11 +23,6 @@ DOMAIN = "atag"
|
||||
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."""
|
||||
|
||||
|
@ -9,7 +9,6 @@ from python_awair import Awair
|
||||
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
|
||||
|
||||
@ -18,11 +17,6 @@ from .const import API_TIMEOUT, DOMAIN, LOGGER, UPDATE_INTERVAL, AwairResult
|
||||
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)
|
||||
|
@ -13,11 +13,6 @@ from .device import AxisNetworkDevice
|
||||
_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, {})
|
||||
|
@ -22,11 +22,6 @@ from homeassistant.helpers.typing import ConfigType, HomeAssistantType
|
||||
_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()
|
||||
|
@ -22,11 +22,6 @@ PLATFORMS = ["cover", "sensor", "switch", "air_quality", "light", "climate"]
|
||||
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."""
|
||||
|
||||
|
@ -10,11 +10,6 @@ from .const import BRAVIARC, DOMAIN, UNDO_UPDATE_LISTENER
|
||||
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]
|
||||
|
@ -7,7 +7,7 @@ from brother import Brother, SnmpError, UnsupportedModel
|
||||
|
||||
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
|
||||
@ -20,11 +20,6 @@ SCAN_INTERVAL = timedelta(seconds=30)
|
||||
_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]
|
||||
|
@ -18,11 +18,6 @@ _LOGGER = logging.getLogger(__name__)
|
||||
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]
|
||||
|
@ -15,11 +15,6 @@ from homeassistant.helpers.typing import HomeAssistantType
|
||||
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, {})
|
||||
|
@ -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()
|
||||
|
@ -10,11 +10,6 @@ from .const import DOMAIN
|
||||
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]
|
||||
|
@ -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(
|
||||
|
@ -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:
|
||||
@ -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
|
||||
|
||||
|
||||
|
@ -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(
|
||||
@ -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
|
||||
|
@ -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(
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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(
|
||||
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user