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];
|
const stateObj = this.hass.states[entityId];
|
||||||
if (
|
if (
|
||||||
computeStateDomain(stateObj) === "geo_location" &&
|
computeStateDomain(stateObj) === "geo_location" &&
|
||||||
this._configGeoLocationSources.includes(stateObj.attributes.source)
|
(this._configGeoLocationSources.includes(
|
||||||
|
stateObj.attributes.source
|
||||||
|
) ||
|
||||||
|
this._configGeoLocationSources.includes("all"))
|
||||||
) {
|
) {
|
||||||
allEntities.push(entityId);
|
allEntities.push(entityId);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,11 @@ const DOMAINS_BADGES = [
|
|||||||
"sun",
|
"sun",
|
||||||
"timer",
|
"timer",
|
||||||
];
|
];
|
||||||
const HIDE_DOMAIN = new Set(["persistent_notification", "configurator"]);
|
const HIDE_DOMAIN = new Set([
|
||||||
|
"persistent_notification",
|
||||||
|
"configurator",
|
||||||
|
"geo_location",
|
||||||
|
]);
|
||||||
|
|
||||||
const computeCards = (
|
const computeCards = (
|
||||||
states: Array<[string, HassEntity]>,
|
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.
|
// Make sure we don't have Home as title and first tab.
|
||||||
if (views.length > 1 && title === "Home") {
|
if (views.length > 1 && title === "Home") {
|
||||||
title = "Home Assistant";
|
title = "Home Assistant";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user