Skip to content

Commit

Permalink
fix!: deprecate YAML configuration (#2685)
Browse files Browse the repository at this point in the history
* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update strings.json

* Update strings.json

* Revert strings.json

* Update strings.json: removed "restart_required"

I thought I was going to implement it but I haven't yet.
Deleted:
    "restart_required": {
      "title": "Restart required",
      "fix_flow": {
        "step": {
          "confirm_restart": {
            "title": "Restart required",
            "description": "Restart of Home Assistant is required to finish download/update of {name}, click submit to restart now."
          }
        }
      }
    },
  • Loading branch information
danielbrunt57 authored Nov 28, 2024
1 parent 22806c3 commit e2a1444
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions custom_components/alexa_media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
from homeassistant.helpers import config_validation as cv, device_registry as dr
from homeassistant.helpers.discovery import async_load_platform
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from homeassistant.util import dt, slugify
import voluptuous as vol
Expand Down Expand Up @@ -134,6 +135,25 @@ async def async_setup(hass, config, discovery_info=None):
)
return True

async_create_issue(
hass,
DOMAIN,
"deprecated_yaml_configuration",
is_fixable=False,
issue_domain=DOMAIN,
severity=IssueSeverity.WARNING,
translation_key="deprecated_yaml_configuration",
learn_more_url="https://github.com/alandtse/alexa_media_player/wiki/Configuration#configurationyaml",
)
_LOGGER.warning(
"YAML configuration of Alexa Media Player is deprecated "
"and will be removed in version 4.14.0."
"There will be no automatic import of this. "
"Please remove it from your configuration, "
"restart Home Assistant and use the UI to configure it instead. "
"Settings > Devices and services > Integrations > ADD INTEGRATION"
)

domainconfig = config.get(DOMAIN)
for account in domainconfig[CONF_ACCOUNTS]:
entry_found = False
Expand Down
6 changes: 6 additions & 0 deletions custom_components/alexa_media/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,11 @@
}
}
}
},
"issues": {
"deprecated_yaml_configuration": {
"title": "YAML configuration is deprecated",
"description": "YAML configuration of Alexa Media Player is deprecated\nand will be removed in version 4.14.0.\nThere will be no automatic import of this.\nPlease remove it from your configuration, restart Home Assistant and use the UI to configure it instead.\nSettings > Devices & services > Integrations > ADD INTEGRATION"
}
}
}

0 comments on commit e2a1444

Please sign in to comment.