forked from home-assistant/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate the map integration (home-assistant#113215)
* Deprecate the map integration * Revert changes in DashboardsCollection._async_load_data * Add option to allow single word in dashboard URL * Update tests * Translate title * Add icon * Improve test coverage
- Loading branch information
1 parent
fef2d7d
commit a16ea3d
Showing
19 changed files
with
480 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,52 @@ | ||
"""Support for showing device locations.""" | ||
|
||
from homeassistant.components import frontend | ||
from homeassistant.core import HomeAssistant | ||
from homeassistant.components import onboarding | ||
from homeassistant.components.lovelace import _create_map_dashboard | ||
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant | ||
from homeassistant.helpers import config_validation as cv | ||
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue | ||
from homeassistant.helpers.storage import Store | ||
from homeassistant.helpers.typing import ConfigType | ||
|
||
DOMAIN = "map" | ||
|
||
CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) | ||
|
||
STORAGE_KEY = DOMAIN | ||
STORAGE_VERSION_MAJOR = 1 | ||
|
||
|
||
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: | ||
"""Register the built-in map panel.""" | ||
frontend.async_register_built_in_panel(hass, "map", "map", "hass:tooltip-account") | ||
"""Create a map panel.""" | ||
|
||
if DOMAIN in config: | ||
async_create_issue( | ||
hass, | ||
HOMEASSISTANT_DOMAIN, | ||
f"deprecated_yaml_{DOMAIN}", | ||
breaks_in_ha_version="2024.10.0", | ||
is_fixable=False, | ||
is_persistent=False, | ||
issue_domain=DOMAIN, | ||
severity=IssueSeverity.WARNING, | ||
translation_key="deprecated_yaml", | ||
translation_placeholders={ | ||
"domain": DOMAIN, | ||
"integration_title": "map", | ||
}, | ||
) | ||
|
||
store: Store[dict[str, bool]] = Store( | ||
hass, | ||
STORAGE_VERSION_MAJOR, | ||
STORAGE_KEY, | ||
) | ||
data = await store.async_load() | ||
if data: | ||
return True | ||
|
||
if onboarding.async_is_onboarded(hass): | ||
await _create_map_dashboard(hass) | ||
|
||
await store.async_save({"migrated": True}) | ||
|
||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.