Skip to content

Commit

Permalink
Create issue to stop using custom component
Browse files Browse the repository at this point in the history
  • Loading branch information
rikroe committed Dec 1, 2024
1 parent 4a3e6e8 commit 250c044
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
45 changes: 45 additions & 0 deletions create_issue.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff --git a/custom_components/bmw_connected_drive/__init__.py b/custom_components/bmw_connected_drive/__init__.py
index 9e43cfc..9921e3f 100644
--- a/custom_components/bmw_connected_drive/__init__.py
+++ b/custom_components/bmw_connected_drive/__init__.py
@@ -14,6 +14,7 @@ from homeassistant.helpers import (
device_registry as dr,
discovery,
entity_registry as er,
+ issue_registry as ir,
)
import homeassistant.helpers.config_validation as cv

@@ -130,6 +131,16 @@ async def _async_migrate_entries(
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up BMW Connected Drive from a config entry."""

+ ir.async_create_issue(
+ hass,
+ DOMAIN,
+ "stop_using_custom_component",
+ version="2024.12.0",
+ is_fixable=False,
+ severity=ir.IssueSeverity.ERROR,
+ translation_key="stop_using_custom_component",
+ )
+
_async_migrate_options_from_data_if_missing(hass, entry)

await _async_migrate_entries(hass, entry)
diff --git a/custom_components/bmw_connected_drive/strings.json b/custom_components/bmw_connected_drive/strings.json
index 8078971..65be86f 100644
--- a/custom_components/bmw_connected_drive/strings.json
+++ b/custom_components/bmw_connected_drive/strings.json
@@ -215,5 +215,11 @@
"missing_captcha": {
"message": "Login requires captcha validation"
}
+ },
+ "issues": {
+ "stop_using_custom_component": {
+ "title": "Stop using custom component",
+ "description": "The custom component for BMW Connected Drive is outdated. Please remove the custom component and use the version shipped with Home Assistant."
+ }
}
}
11 changes: 11 additions & 0 deletions custom_components/bmw_connected_drive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
device_registry as dr,
discovery,
entity_registry as er,
issue_registry as ir,
)
import homeassistant.helpers.config_validation as cv

Expand Down Expand Up @@ -130,6 +131,16 @@ def update_unique_id(entry: er.RegistryEntry) -> dict[str, str] | None:
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up BMW Connected Drive from a config entry."""

ir.async_create_issue(
hass,
DOMAIN,
"stop_using_custom_component",
version="2024.12.0",
is_fixable=False,
severity=ir.IssueSeverity.ERROR,
translation_key="stop_using_custom_component",
)

_async_migrate_options_from_data_if_missing(hass, entry)

await _async_migrate_entries(hass, entry)
Expand Down
6 changes: 6 additions & 0 deletions custom_components/bmw_connected_drive/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,11 @@
"missing_captcha": {
"message": "Login requires captcha validation"
}
},
"issues": {
"stop_using_custom_component": {
"title": "Stop using custom component",
"description": "The custom component for BMW Connected Drive is outdated. Please remove the custom component and use the version shipped with Home Assistant."
}
}
}

0 comments on commit 250c044

Please sign in to comment.