mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix sensor card to not crash when it finds no state history (#17181)
This commit is contained in:
parent
9ac3f745b3
commit
3d2734eb88
@ -119,6 +119,9 @@ export const coordinatesMinimalResponseCompressedState = (
|
|||||||
detail: number,
|
detail: number,
|
||||||
limits?: { min?: number; max?: number }
|
limits?: { min?: number; max?: number }
|
||||||
): number[][] | undefined => {
|
): number[][] | undefined => {
|
||||||
|
if (!history) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
const numericHistory: NumericEntityHistoryState[] = history.map((item) => ({
|
const numericHistory: NumericEntityHistoryState[] = history.map((item) => ({
|
||||||
state: Number(item.s),
|
state: Number(item.s),
|
||||||
// With minimal response and compressed state, we don't have last_changed,
|
// With minimal response and compressed state, we don't have last_changed,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user