From cb17a01e48132f7adc2452ce71758512d99a7e1f Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 26 Jul 2022 20:01:15 +0200 Subject: [PATCH] Raise YAML removal issue for nVent RAYCHEM SENZ (#75757) --- homeassistant/components/senz/__init__.py | 18 ++++++++++++++++++ homeassistant/components/senz/manifest.json | 2 +- homeassistant/components/senz/strings.json | 6 ++++++ .../components/senz/translations/en.json | 6 ++++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/senz/__init__.py b/homeassistant/components/senz/__init__.py index 012b40f5def..9155c8ca036 100644 --- a/homeassistant/components/senz/__init__.py +++ b/homeassistant/components/senz/__init__.py @@ -7,6 +7,7 @@ import logging from aiosenz import SENZAPI, Thermostat from httpx import RequestError +from homeassistant.components.repairs import IssueSeverity, async_create_issue from homeassistant.config_entries import ConfigEntry from homeassistant.const import Platform from homeassistant.core import HomeAssistant @@ -16,6 +17,7 @@ from homeassistant.helpers import ( config_validation as cv, httpx_client, ) +from homeassistant.helpers.typing import ConfigType from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed from .api import SENZConfigEntryAuth @@ -32,6 +34,22 @@ PLATFORMS = [Platform.CLIMATE] SENZDataUpdateCoordinator = DataUpdateCoordinator[dict[str, Thermostat]] +async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: + """Set up the SENZ integration.""" + if DOMAIN in config: + async_create_issue( + hass, + DOMAIN, + "removed_yaml", + breaks_in_ha_version="2022.8.0", + is_fixable=False, + severity=IssueSeverity.WARNING, + translation_key="removed_yaml", + ) + + return True + + async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up SENZ from a config entry.""" implementation = ( diff --git a/homeassistant/components/senz/manifest.json b/homeassistant/components/senz/manifest.json index 937a20d8482..36687e46d4a 100644 --- a/homeassistant/components/senz/manifest.json +++ b/homeassistant/components/senz/manifest.json @@ -4,7 +4,7 @@ "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/senz", "requirements": ["aiosenz==1.0.0"], - "dependencies": ["application_credentials"], + "dependencies": ["application_credentials", "repairs"], "codeowners": ["@milanmeu"], "iot_class": "cloud_polling" } diff --git a/homeassistant/components/senz/strings.json b/homeassistant/components/senz/strings.json index 316f7234f9b..74ca9f5e3bf 100644 --- a/homeassistant/components/senz/strings.json +++ b/homeassistant/components/senz/strings.json @@ -16,5 +16,11 @@ "create_entry": { "default": "[%key:common::config_flow::create_entry::authenticated%]" } + }, + "issues": { + "removed_yaml": { + "title": "The nVent RAYCHEM SENZ YAML configuration has been removed", + "description": "Configuring nVent RAYCHEM SENZ using YAML has been removed.\n\nYour existing YAML configuration is not used by Home Assistant.\n\nRemove the YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue." + } } } diff --git a/homeassistant/components/senz/translations/en.json b/homeassistant/components/senz/translations/en.json index bdf574691c5..fc1cfd561d4 100644 --- a/homeassistant/components/senz/translations/en.json +++ b/homeassistant/components/senz/translations/en.json @@ -16,5 +16,11 @@ "title": "Pick Authentication Method" } } + }, + "issues": { + "removed_yaml": { + "description": "Configuring nVent RAYCHEM SENZ using YAML has been removed.\n\nYour existing YAML configuration is not used by Home Assistant.\n\nRemove the YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue.", + "title": "The nVent RAYCHEM SENZ YAML configuration has been removed" + } } } \ No newline at end of file