diff --git a/src/panels/lovelace/cards/hui-map-card.ts b/src/panels/lovelace/cards/hui-map-card.ts index 917b53e276..ad8ec6cc1d 100644 --- a/src/panels/lovelace/cards/hui-map-card.ts +++ b/src/panels/lovelace/cards/hui-map-card.ts @@ -40,7 +40,7 @@ import { formatTimeWeekday, } from "../../../common/datetime/format_time"; -const DEFAULT_HOURS_TO_SHOW = 24; +const DEFAULT_HOURS_TO_SHOW = 0; @customElement("hui-map-card") class HuiMapCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass!: HomeAssistant; @@ -213,7 +213,7 @@ class HuiMapCard extends LitElement implements LovelaceCard { } this._stateHistory = combinedHistory; }, - this._config!.hours_to_show! || DEFAULT_HOURS_TO_SHOW, + this._config!.hours_to_show! ?? DEFAULT_HOURS_TO_SHOW, this._configEntities!, false, false @@ -341,7 +341,7 @@ class HuiMapCard extends LitElement implements LovelaceCard { const p = {} as HaMapPathPoint; p.point = [latitude, longitude] as LatLngTuple; const t = new Date(entityState.lu * 1000); - if (config.hours_to_show! || DEFAULT_HOURS_TO_SHOW > 144) { + if (config.hours_to_show! ?? DEFAULT_HOURS_TO_SHOW > 144) { // if showing > 6 days in the history trail, show the full // date and time p.tooltip = formatDateTime(t, this.hass.locale);