mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 04:06:35 +00:00
Put geo_events on a map instead of an entities card. (#2489)
This commit is contained in:
parent
41554ab14d
commit
f7a67af71b
@ -247,7 +247,10 @@ class HuiMapCard extends PolymerElement {
|
||||
const stateObj = this.hass.states[entityId];
|
||||
if (
|
||||
computeStateDomain(stateObj) === "geo_location" &&
|
||||
this._configGeoLocationSources.includes(stateObj.attributes.source)
|
||||
(this._configGeoLocationSources.includes(
|
||||
stateObj.attributes.source
|
||||
) ||
|
||||
this._configGeoLocationSources.includes("all"))
|
||||
) {
|
||||
allEntities.push(entityId);
|
||||
}
|
||||
|
@ -25,7 +25,11 @@ const DOMAINS_BADGES = [
|
||||
"sun",
|
||||
"timer",
|
||||
];
|
||||
const HIDE_DOMAIN = new Set(["persistent_notification", "configurator"]);
|
||||
const HIDE_DOMAIN = new Set([
|
||||
"persistent_notification",
|
||||
"configurator",
|
||||
"geo_location",
|
||||
]);
|
||||
|
||||
const computeCards = (
|
||||
states: Array<[string, HassEntity]>,
|
||||
@ -243,6 +247,16 @@ export const generateLovelaceConfig = (
|
||||
)
|
||||
);
|
||||
|
||||
// Add map of geo locations to default view if loaded
|
||||
if (hass.config.components.includes("geo_location")) {
|
||||
if (views[0] && views[0].cards) {
|
||||
views[0].cards.push({
|
||||
type: "map",
|
||||
geo_location_sources: ["all"],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure we don't have Home as title and first tab.
|
||||
if (views.length > 1 && title === "Home") {
|
||||
title = "Home Assistant";
|
||||
|
Loading…
x
Reference in New Issue
Block a user