Add repair issue about the deprecation of home plus control (#98828)

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
pull/98946/head
Robert Resch 2023-08-24 10:33:06 +02:00 committed by GitHub
parent 8b232047c4
commit 7926c5cea9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 0 deletions

View File

@ -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

View File

@ -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."
}
}
}