Skip to content

Commit

Permalink
add issue for moving to core integration
Browse files Browse the repository at this point in the history
  • Loading branch information
jozefKruszynski committed Dec 2, 2024
1 parent edba21b commit 934ea7d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
19 changes: 17 additions & 2 deletions custom_components/mass/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from homeassistant.config_entries import ConfigEntry, ConfigEntryState
from homeassistant.const import CONF_URL, EVENT_HOMEASSISTANT_STOP, Platform
from homeassistant.core import Event, HomeAssistant
from homeassistant.core import Event, HomeAssistant, DOMAIN as HOMEASSISTANT_DOMAIN
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers import device_registry as dr
Expand Down Expand Up @@ -62,7 +62,22 @@ async def async_setup_entry(
http_session = async_get_clientsession(hass, verify_ssl=False)
mass_url = entry.data[CONF_URL]
mass = MusicAssistantClient(mass_url, http_session)

async_create_issue(
hass,
DOMAIN,
f"move_integration_to_ha_core{DOMAIN}",
breaks_in_ha_version="2024.12.0",
is_fixable=False,
is_persistent=True,
learn_more_url="https://music-assistant.io/integration/installation/#migrating-from-the-hacs-integration-to-the-ha-integration",
issue_domain=DOMAIN,
severity=IssueSeverity.WARNING,
translation_key="move_integration_to_ha_core",
translation_placeholders={
"domain": DOMAIN,
"integration_title": "mass",
},
)
try:
async with asyncio.timeout(CONNECT_TIMEOUT):
await mass.connect()
Expand Down
2 changes: 1 addition & 1 deletion custom_components/mass/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"domain": "mass",
"name": "Music Assistant",
"name": "Music Assistant - Custom",
"after_dependencies": ["media_source", "media_player"],
"codeowners": ["@music-assistant"],
"config_flow": true,
Expand Down
4 changes: 4 additions & 0 deletions custom_components/mass/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"invalid_server_version": {
"title": "The Music Assistant server is not the correct version",
"description": "Check if there are updates available for the Music Assistant Server and/or integration."
},
"move_integration_to_ha_core": {
"title": "Move to Core Integration",
"description": "The Music Assistant integration has been integrated to HA Core. You may keep using the custom integration, but it will receive no further support/updates, and will be removed entirely from HACS in the near future."
}
},
"config": {
Expand Down
4 changes: 4 additions & 0 deletions custom_components/mass/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"invalid_server_version": {
"title": "The Music Assistant server is not the correct version",
"description": "Check if there are updates available for the Music Assistant Server and/or integration."
},
"move_integration_to_ha_core": {
"title": "Move to Core Integration",
"description": "The Music Assistant integration has been integrated to HA Core. You may keep using the custom integration, but it will receive no further support/updates, and will be removed entirely from HACS in the near future."
}
},
"config": {
Expand Down

0 comments on commit 934ea7d

Please sign in to comment.