Fix map autofit (#18799)

This commit is contained in:
karwosts 2023-11-28 15:29:52 -08:00 committed by GitHub
parent 6134f415e9
commit 081bd98e98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -216,12 +216,13 @@ class HuiMapCard extends LitElement implements LovelaceCard {
protected willUpdate(changedProps: PropertyValues): void {
super.willUpdate(changedProps);
if (
changedProps.has("hass") &&
(changedProps.has("hass") &&
this._config?.geo_location_sources &&
!deepEqual(
this._getSourceEntities(changedProps.get("hass")?.states),
this._getSourceEntities(this.hass.states)
)
)) ||
(this._config?.entities && hasConfigOrEntitiesChanged(this, changedProps))
) {
this._mapEntities = this._getMapEntities();
}