mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Fix maps card with location sources (#16778)
This commit is contained in:
parent
1bf03f020e
commit
29c564bb69
@ -34,7 +34,10 @@ import {
|
|||||||
HistoryStates,
|
HistoryStates,
|
||||||
subscribeHistoryStatesTimeWindow,
|
subscribeHistoryStatesTimeWindow,
|
||||||
} from "../../../data/history";
|
} from "../../../data/history";
|
||||||
import { hasConfigOrEntitiesChanged } from "../common/has-changed";
|
import {
|
||||||
|
hasConfigChanged,
|
||||||
|
hasConfigOrEntitiesChanged,
|
||||||
|
} from "../common/has-changed";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import { findEntities } from "../common/find-entities";
|
import { findEntities } from "../common/find-entities";
|
||||||
import { processConfigEntities } from "../common/process-config-entities";
|
import { processConfigEntities } from "../common/process-config-entities";
|
||||||
@ -194,7 +197,15 @@ class HuiMapCard extends LitElement implements LovelaceCard {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return hasConfigOrEntitiesChanged(this, changedProps);
|
if (this._config?.geo_location_sources) {
|
||||||
|
if (oldHass.states !== this.hass.states) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this._config?.entities
|
||||||
|
? hasConfigOrEntitiesChanged(this, changedProps)
|
||||||
|
: hasConfigChanged(this, changedProps);
|
||||||
}
|
}
|
||||||
|
|
||||||
public connectedCallback() {
|
public connectedCallback() {
|
||||||
|
@ -4,7 +4,10 @@ import { EntityRegistryDisplayEntry } from "../../../data/entity_registry";
|
|||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import { processConfigEntities } from "./process-config-entities";
|
import { processConfigEntities } from "./process-config-entities";
|
||||||
|
|
||||||
function hasConfigChanged(element: any, changedProps: PropertyValues): boolean {
|
export function hasConfigChanged(
|
||||||
|
element: any,
|
||||||
|
changedProps: PropertyValues
|
||||||
|
): boolean {
|
||||||
if (changedProps.has("_config")) {
|
if (changedProps.has("_config")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user