mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Fix problems in map card when hours_to_show is 0 (#15900)
This commit is contained in:
parent
7c62b08fdd
commit
da2de3c7d2
@ -33,6 +33,7 @@ import {
|
||||
HistoryStates,
|
||||
subscribeHistoryStatesTimeWindow,
|
||||
} from "../../../data/history";
|
||||
import { hasConfigOrEntitiesChanged } from "../common/has-changed";
|
||||
import { HomeAssistant } from "../../../types";
|
||||
import { findEntities } from "../common/find-entities";
|
||||
import { processConfigEntities } from "../common/process-config-entities";
|
||||
@ -187,7 +188,7 @@ class HuiMapCard extends LitElement implements LovelaceCard {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return hasConfigOrEntitiesChanged(this, changedProps);
|
||||
}
|
||||
|
||||
public connectedCallback() {
|
||||
@ -203,7 +204,11 @@ class HuiMapCard extends LitElement implements LovelaceCard {
|
||||
}
|
||||
|
||||
private _subscribeHistory() {
|
||||
if (!isComponentLoaded(this.hass!, "history") || this._subscribed) {
|
||||
if (
|
||||
!isComponentLoaded(this.hass!, "history") ||
|
||||
this._subscribed ||
|
||||
!(this._config?.hours_to_show ?? DEFAULT_HOURS_TO_SHOW)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
this._subscribed = subscribeHistoryStatesTimeWindow(
|
||||
@ -324,7 +329,7 @@ class HuiMapCard extends LitElement implements LovelaceCard {
|
||||
config: MapCardConfig,
|
||||
history?: HistoryStates
|
||||
): HaMapPaths[] | undefined => {
|
||||
if (!history) {
|
||||
if (!history || !(config.hours_to_show ?? DEFAULT_HOURS_TO_SHOW)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user