Raise YAML removal issue for nVent RAYCHEM SENZ (#75757)

pull/75779/head
Franck Nijhof 2022-07-26 20:01:15 +02:00 committed by GitHub
parent fad7a6cb08
commit cb17a01e48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import logging
from aiosenz import SENZAPI, Thermostat from aiosenz import SENZAPI, Thermostat
from httpx import RequestError from httpx import RequestError
from homeassistant.components.repairs import IssueSeverity, async_create_issue
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform from homeassistant.const import Platform
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
@ -16,6 +17,7 @@ from homeassistant.helpers import (
config_validation as cv, config_validation as cv,
httpx_client, httpx_client,
) )
from homeassistant.helpers.typing import ConfigType
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .api import SENZConfigEntryAuth from .api import SENZConfigEntryAuth
@ -32,6 +34,22 @@ PLATFORMS = [Platform.CLIMATE]
SENZDataUpdateCoordinator = DataUpdateCoordinator[dict[str, Thermostat]] 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: async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up SENZ from a config entry.""" """Set up SENZ from a config entry."""
implementation = ( implementation = (

View File

@ -4,7 +4,7 @@
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/senz", "documentation": "https://www.home-assistant.io/integrations/senz",
"requirements": ["aiosenz==1.0.0"], "requirements": ["aiosenz==1.0.0"],
"dependencies": ["application_credentials"], "dependencies": ["application_credentials", "repairs"],
"codeowners": ["@milanmeu"], "codeowners": ["@milanmeu"],
"iot_class": "cloud_polling" "iot_class": "cloud_polling"
} }

View File

@ -16,5 +16,11 @@
"create_entry": { "create_entry": {
"default": "[%key:common::config_flow::create_entry::authenticated%]" "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."
}
} }
} }

View File

@ -16,5 +16,11 @@
"title": "Pick Authentication Method" "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"
}
} }
} }