diff --git a/homeassistant/components/home_plus_control/__init__.py b/homeassistant/components/home_plus_control/__init__.py index b6a1fc68a17..0accf53970d 100644 --- a/homeassistant/components/home_plus_control/__init__.py +++ b/homeassistant/components/home_plus_control/__init__.py @@ -15,6 +15,11 @@ from homeassistant.helpers import ( dispatcher, ) from homeassistant.helpers.device_registry import async_get as async_get_device_registry +from homeassistant.helpers.issue_registry import ( + IssueSeverity, + async_create_issue, + async_delete_issue, +) from homeassistant.helpers.typing import ConfigType from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed @@ -49,6 +54,8 @@ PLATFORMS = [Platform.SWITCH] _LOGGER = logging.getLogger(__name__) +_ISSUE_MOTE_TO_NETAMO = "move_to_netamo" + async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Legrand Home+ Control component from configuration.yaml.""" @@ -57,6 +64,20 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: if DOMAIN not in config: return True + async_create_issue( + hass, + DOMAIN, + _ISSUE_MOTE_TO_NETAMO, + is_fixable=False, + is_persistent=False, + breaks_in_ha_version="2023.12.0", # Netamo decided to shutdown the api in december + severity=IssueSeverity.WARNING, + translation_key=_ISSUE_MOTE_TO_NETAMO, + translation_placeholders={ + "url": "https://www.home-assistant.io/integrations/netatmo/" + }, + ) + # Register the implementation from the config information config_flow.HomePlusControlFlowHandler.async_register_implementation( hass, @@ -70,6 +91,20 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up Legrand Home+ Control from a config entry.""" hass_entry_data = hass.data[DOMAIN].setdefault(entry.entry_id, {}) + async_create_issue( + hass, + DOMAIN, + _ISSUE_MOTE_TO_NETAMO, + is_fixable=False, + is_persistent=False, + breaks_in_ha_version="2023.12.0", # Netamo decided to shutdown the api in december + severity=IssueSeverity.WARNING, + translation_key=_ISSUE_MOTE_TO_NETAMO, + translation_placeholders={ + "url": "https://www.home-assistant.io/integrations/netatmo/" + }, + ) + # Retrieve the registered implementation implementation = ( await config_entry_oauth2_flow.async_get_config_entry_implementation( @@ -168,4 +203,6 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> # And finally unload the domain config entry data hass.data[DOMAIN].pop(config_entry.entry_id) + async_delete_issue(hass, DOMAIN, _ISSUE_MOTE_TO_NETAMO) + return unload_ok diff --git a/homeassistant/components/home_plus_control/strings.json b/homeassistant/components/home_plus_control/strings.json index 9e860b397fb..d795323586d 100644 --- a/homeassistant/components/home_plus_control/strings.json +++ b/homeassistant/components/home_plus_control/strings.json @@ -16,5 +16,11 @@ "create_entry": { "default": "[%key:common::config_flow::create_entry::authenticated%]" } + }, + "issues": { + "move_to_netamo": { + "title": "Legrand Home+ Control deprecation", + "description": "Home Assistant has been informed that the platform the Legrand Home+ Control integration is using, will be shutting down upcoming December.\n\nOnce that happens, it means this integration is no longer functional. We advise you to remove this integration and switch to the [Netatmo]({url}) integration, which provides a replacement for controlling your Legrand Home+ Control devices." + } } }