diff --git a/.strict-typing b/.strict-typing index 42f35b5215391067b6a581fca332f2e4139b532d..a45be32c3c6ec02771e424534a3c1f817b9cc3a4 100644 --- a/.strict-typing +++ b/.strict-typing @@ -440,7 +440,6 @@ homeassistant.components.ssdp.* homeassistant.components.starlink.* homeassistant.components.statistics.* homeassistant.components.steamist.* -homeassistant.components.stookalert.* homeassistant.components.stookwijzer.* homeassistant.components.stream.* homeassistant.components.streamlabswater.* diff --git a/CODEOWNERS b/CODEOWNERS index 916ff63e696d3d453c78371a7d16dc405512c121..782f999601faafa69004f91f7109a56256ea1215 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1422,8 +1422,6 @@ build.json @home-assistant/supervisor /homeassistant/components/steamist/ @bdraco /tests/components/steamist/ @bdraco /homeassistant/components/stiebel_eltron/ @fucm -/homeassistant/components/stookalert/ @fwestenberg @frenck -/tests/components/stookalert/ @fwestenberg @frenck /homeassistant/components/stookwijzer/ @fwestenberg /tests/components/stookwijzer/ @fwestenberg /homeassistant/components/stream/ @hunterjm @uvjustin @allenporter diff --git a/homeassistant/components/stookalert/__init__.py b/homeassistant/components/stookalert/__init__.py deleted file mode 100644 index 0ef9c7fa845285b1a5fffcc10181ffc1efbbd3b9..0000000000000000000000000000000000000000 --- a/homeassistant/components/stookalert/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -"""The Stookalert integration.""" - -from __future__ import annotations - -import stookalert - -from homeassistant.config_entries import ConfigEntry -from homeassistant.const import Platform -from homeassistant.core import HomeAssistant - -from .const import CONF_PROVINCE, DOMAIN - -PLATFORMS = [Platform.BINARY_SENSOR] - - -async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: - """Set up Stookalert from a config entry.""" - hass.data.setdefault(DOMAIN, {}) - hass.data[DOMAIN][entry.entry_id] = stookalert.stookalert(entry.data[CONF_PROVINCE]) - await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) - return True - - -async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: - """Unload Stookalert config entry.""" - unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS) - if unload_ok: - del hass.data[DOMAIN][entry.entry_id] - return unload_ok diff --git a/homeassistant/components/stookalert/binary_sensor.py b/homeassistant/components/stookalert/binary_sensor.py deleted file mode 100644 index a2fff52f2a3bb0b749658811045327be4410c699..0000000000000000000000000000000000000000 --- a/homeassistant/components/stookalert/binary_sensor.py +++ /dev/null @@ -1,57 +0,0 @@ -"""Support for Stookalert Binary Sensor.""" - -from __future__ import annotations - -from datetime import timedelta - -import stookalert - -from homeassistant.components.binary_sensor import ( - BinarySensorDeviceClass, - BinarySensorEntity, -) -from homeassistant.config_entries import ConfigEntry -from homeassistant.core import HomeAssistant -from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo -from homeassistant.helpers.entity_platform import AddEntitiesCallback - -from .const import CONF_PROVINCE, DOMAIN - -SCAN_INTERVAL = timedelta(minutes=60) - - -async def async_setup_entry( - hass: HomeAssistant, - entry: ConfigEntry, - async_add_entities: AddEntitiesCallback, -) -> None: - """Set up Stookalert binary sensor from a config entry.""" - client = hass.data[DOMAIN][entry.entry_id] - async_add_entities([StookalertBinarySensor(client, entry)], update_before_add=True) - - -class StookalertBinarySensor(BinarySensorEntity): - """Defines a Stookalert binary sensor.""" - - _attr_attribution = "Data provided by rivm.nl" - _attr_device_class = BinarySensorDeviceClass.SAFETY - _attr_has_entity_name = True - _attr_name = None - - def __init__(self, client: stookalert.stookalert, entry: ConfigEntry) -> None: - """Initialize a Stookalert device.""" - self._client = client - self._attr_unique_id = entry.unique_id - self._attr_device_info = DeviceInfo( - identifiers={(DOMAIN, f"{entry.entry_id}")}, - name=f"Stookalert {entry.data[CONF_PROVINCE]}", - manufacturer="RIVM", - model="Stookalert", - entry_type=DeviceEntryType.SERVICE, - configuration_url="https://www.rivm.nl/stookalert", - ) - - def update(self) -> None: - """Update the data from the Stookalert handler.""" - self._client.get_alerts() - self._attr_is_on = self._client.state == 1 diff --git a/homeassistant/components/stookalert/config_flow.py b/homeassistant/components/stookalert/config_flow.py deleted file mode 100644 index 0d3bc0c17614d4d5a1bdfd74269827067f347a8b..0000000000000000000000000000000000000000 --- a/homeassistant/components/stookalert/config_flow.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Config flow to configure the Stookalert integration.""" - -from __future__ import annotations - -from typing import Any - -import voluptuous as vol - -from homeassistant.config_entries import ConfigFlow, ConfigFlowResult - -from .const import CONF_PROVINCE, DOMAIN, PROVINCES - - -class StookalertFlowHandler(ConfigFlow, domain=DOMAIN): - """Config flow for Stookalert.""" - - VERSION = 1 - - async def async_step_user( - self, user_input: dict[str, Any] | None = None - ) -> ConfigFlowResult: - """Handle a flow initialized by the user.""" - if user_input is not None: - await self.async_set_unique_id(user_input[CONF_PROVINCE]) - self._abort_if_unique_id_configured() - return self.async_create_entry( - title=user_input[CONF_PROVINCE], data=user_input - ) - - return self.async_show_form( - step_id="user", - data_schema=vol.Schema({vol.Required(CONF_PROVINCE): vol.In(PROVINCES)}), - ) diff --git a/homeassistant/components/stookalert/const.py b/homeassistant/components/stookalert/const.py deleted file mode 100644 index 9896eea212a3db17380a3dcf9e5d2792ed75d48b..0000000000000000000000000000000000000000 --- a/homeassistant/components/stookalert/const.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Constants for the Stookalert integration.""" - -import logging -from typing import Final - -DOMAIN: Final = "stookalert" -LOGGER = logging.getLogger(__package__) - -CONF_PROVINCE: Final = "province" - -PROVINCES: Final = ( - "Drenthe", - "Flevoland", - "Friesland", - "Gelderland", - "Groningen", - "Limburg", - "Noord-Brabant", - "Noord-Holland", - "Overijssel", - "Utrecht", - "Zeeland", - "Zuid-Holland", -) diff --git a/homeassistant/components/stookalert/diagnostics.py b/homeassistant/components/stookalert/diagnostics.py deleted file mode 100644 index c15e808ae198ec292f99d37f4df822a1e12e95f9..0000000000000000000000000000000000000000 --- a/homeassistant/components/stookalert/diagnostics.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Diagnostics support for Stookalert.""" - -from __future__ import annotations - -from typing import Any - -import stookalert - -from homeassistant.config_entries import ConfigEntry -from homeassistant.core import HomeAssistant - -from .const import DOMAIN - - -async def async_get_config_entry_diagnostics( - hass: HomeAssistant, entry: ConfigEntry -) -> dict[str, Any]: - """Return diagnostics for a config entry.""" - client: stookalert.stookalert = hass.data[DOMAIN][entry.entry_id] - return {"state": client.state} diff --git a/homeassistant/components/stookalert/manifest.json b/homeassistant/components/stookalert/manifest.json deleted file mode 100644 index 2bebc6397204550380f8025140bc33b7a63634cc..0000000000000000000000000000000000000000 --- a/homeassistant/components/stookalert/manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "domain": "stookalert", - "name": "RIVM Stookalert", - "codeowners": ["@fwestenberg", "@frenck"], - "config_flow": true, - "documentation": "https://www.home-assistant.io/integrations/stookalert", - "integration_type": "service", - "iot_class": "cloud_polling", - "requirements": ["stookalert==0.1.4"] -} diff --git a/homeassistant/components/stookalert/strings.json b/homeassistant/components/stookalert/strings.json deleted file mode 100644 index a05ae4e61e7384b3d1f064942af8d4c94289c0fc..0000000000000000000000000000000000000000 --- a/homeassistant/components/stookalert/strings.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "config": { - "step": { - "user": { - "data": { - "province": "Province" - } - } - }, - "abort": { - "already_configured": "[%key:common::config_flow::abort::already_configured_service%]" - } - } -} diff --git a/homeassistant/generated/config_flows.py b/homeassistant/generated/config_flows.py index 5cd9dd786fe4d74f7021f25541d29a9f569fd1ac..37ffc8868fd50c8ecbebf7d8968250ea4fe02880 100644 --- a/homeassistant/generated/config_flows.py +++ b/homeassistant/generated/config_flows.py @@ -574,7 +574,6 @@ FLOWS = { "starlink", "steam_online", "steamist", - "stookalert", "stookwijzer", "streamlabswater", "subaru", diff --git a/homeassistant/generated/integrations.json b/homeassistant/generated/integrations.json index 9494ab2e201b1188a04aeb5ecc0dd32099f1c649..b1b52332045e97948e6ec2346bdc7045d232222b 100644 --- a/homeassistant/generated/integrations.json +++ b/homeassistant/generated/integrations.json @@ -5951,12 +5951,6 @@ "config_flow": false, "iot_class": "local_polling" }, - "stookalert": { - "name": "RIVM Stookalert", - "integration_type": "service", - "config_flow": true, - "iot_class": "cloud_polling" - }, "stookwijzer": { "name": "Stookwijzer", "integration_type": "service", diff --git a/mypy.ini b/mypy.ini index ce51adc38162598114991e654801f558e9c5fbf2..fb58810515be6427f1724bb8349361c0a33c896e 100644 --- a/mypy.ini +++ b/mypy.ini @@ -4156,16 +4156,6 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true -[mypy-homeassistant.components.stookalert.*] -check_untyped_defs = true -disallow_incomplete_defs = true -disallow_subclassing_any = true -disallow_untyped_calls = true -disallow_untyped_decorators = true -disallow_untyped_defs = true -warn_return_any = true -warn_unreachable = true - [mypy-homeassistant.components.stookwijzer.*] check_untyped_defs = true disallow_incomplete_defs = true diff --git a/requirements_all.txt b/requirements_all.txt index da41db79e06422bcec04a901923c8c1bcda1a746..02e2f1f048ded05b3f6643f7bc4bd20037bf4c10 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2742,9 +2742,6 @@ statsd==3.2.1 # homeassistant.components.steam_online steamodd==4.21 -# homeassistant.components.stookalert -stookalert==0.1.4 - # homeassistant.components.stookwijzer stookwijzer==1.5.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 8e10a4e9b36e52962e98e792a535b4a29a2dba82..85b31f9c95b442a1bac2d2858635b02239fca4f0 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -2194,9 +2194,6 @@ statsd==3.2.1 # homeassistant.components.steam_online steamodd==4.21 -# homeassistant.components.stookalert -stookalert==0.1.4 - # homeassistant.components.stookwijzer stookwijzer==1.5.1 diff --git a/script/hassfest/quality_scale.py b/script/hassfest/quality_scale.py index b33649427c191b64752b00a6037633f69f825124..b1d7e597a076d7c3bd5510a65b47d66bec65befd 100644 --- a/script/hassfest/quality_scale.py +++ b/script/hassfest/quality_scale.py @@ -990,7 +990,6 @@ INTEGRATIONS_WITHOUT_QUALITY_SCALE_FILE = [ "steam_online", "steamist", "stiebel_eltron", - "stookalert", "stream", "streamlabswater", "subaru", diff --git a/tests/components/stookalert/__init__.py b/tests/components/stookalert/__init__.py deleted file mode 100644 index 3785c76639a32dcc986f825517bcfca624f9ad4a..0000000000000000000000000000000000000000 --- a/tests/components/stookalert/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests for the Stookalert integration.""" diff --git a/tests/components/stookalert/test_config_flow.py b/tests/components/stookalert/test_config_flow.py deleted file mode 100644 index 3664527cbcfe57af737df7ce6d63f8a0f771d6d9..0000000000000000000000000000000000000000 --- a/tests/components/stookalert/test_config_flow.py +++ /dev/null @@ -1,59 +0,0 @@ -"""Tests for the Stookalert config flow.""" - -from unittest.mock import patch - -from homeassistant.components.stookalert.const import CONF_PROVINCE, DOMAIN -from homeassistant.config_entries import SOURCE_USER -from homeassistant.core import HomeAssistant -from homeassistant.data_entry_flow import FlowResultType - -from tests.common import MockConfigEntry - - -async def test_full_user_flow(hass: HomeAssistant) -> None: - """Test the full user configuration flow.""" - result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": SOURCE_USER} - ) - - assert result.get("type") is FlowResultType.FORM - assert result.get("step_id") == "user" - - with patch( - "homeassistant.components.stookalert.async_setup_entry", return_value=True - ) as mock_setup_entry: - result2 = await hass.config_entries.flow.async_configure( - result["flow_id"], - user_input={ - CONF_PROVINCE: "Overijssel", - }, - ) - - assert result2.get("type") is FlowResultType.CREATE_ENTRY - assert result2.get("title") == "Overijssel" - assert result2.get("data") == { - CONF_PROVINCE: "Overijssel", - } - - assert len(mock_setup_entry.mock_calls) == 1 - - -async def test_already_configured(hass: HomeAssistant) -> None: - """Test we abort if the Stookalert province is already configured.""" - MockConfigEntry( - domain=DOMAIN, data={CONF_PROVINCE: "Overijssel"}, unique_id="Overijssel" - ).add_to_hass(hass) - - result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": SOURCE_USER} - ) - - result2 = await hass.config_entries.flow.async_configure( - result["flow_id"], - user_input={ - CONF_PROVINCE: "Overijssel", - }, - ) - - assert result2.get("type") is FlowResultType.ABORT - assert result2.get("reason") == "already_configured"