mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Restore default hours to show on map card to 0 (#15220)
* Restore default hours to show on map card to 0 fixes #15216 * tweak * always clear this._subscribed right away on unsub * adjust * merge from #15217 * merge from #15217
This commit is contained in:
parent
9220d65f78
commit
41420c3af3
@ -40,7 +40,7 @@ import {
|
|||||||
formatTimeWeekday,
|
formatTimeWeekday,
|
||||||
} from "../../../common/datetime/format_time";
|
} from "../../../common/datetime/format_time";
|
||||||
|
|
||||||
const DEFAULT_HOURS_TO_SHOW = 24;
|
const DEFAULT_HOURS_TO_SHOW = 0;
|
||||||
@customElement("hui-map-card")
|
@customElement("hui-map-card")
|
||||||
class HuiMapCard extends LitElement implements LovelaceCard {
|
class HuiMapCard extends LitElement implements LovelaceCard {
|
||||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
@ -213,7 +213,7 @@ class HuiMapCard extends LitElement implements LovelaceCard {
|
|||||||
}
|
}
|
||||||
this._stateHistory = combinedHistory;
|
this._stateHistory = combinedHistory;
|
||||||
},
|
},
|
||||||
this._config!.hours_to_show! || DEFAULT_HOURS_TO_SHOW,
|
this._config!.hours_to_show! ?? DEFAULT_HOURS_TO_SHOW,
|
||||||
this._configEntities!,
|
this._configEntities!,
|
||||||
false,
|
false,
|
||||||
false
|
false
|
||||||
@ -341,7 +341,7 @@ class HuiMapCard extends LitElement implements LovelaceCard {
|
|||||||
const p = {} as HaMapPathPoint;
|
const p = {} as HaMapPathPoint;
|
||||||
p.point = [latitude, longitude] as LatLngTuple;
|
p.point = [latitude, longitude] as LatLngTuple;
|
||||||
const t = new Date(entityState.lu * 1000);
|
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
|
// if showing > 6 days in the history trail, show the full
|
||||||
// date and time
|
// date and time
|
||||||
p.tooltip = formatDateTime(t, this.hass.locale);
|
p.tooltip = formatDateTime(t, this.hass.locale);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user