mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-05 15:37:47 +00:00
review
This commit is contained in:
parent
e4ebb320e5
commit
51a69f1042
@ -243,11 +243,12 @@ class HistoryStream {
|
||||
entityId in this.combinedHistory &&
|
||||
entityId in streamMessage.states
|
||||
) {
|
||||
const lastCombined = this.combinedHistory[entityId][-1];
|
||||
newHistory[entityId] = this.combinedHistory[entityId].concat(
|
||||
const entityCombinedHistory = this.combinedHistory[entityId];
|
||||
const lastEntityCombinedHistory = entityCombinedHistory[-1];
|
||||
newHistory[entityId] = entityCombinedHistory.concat(
|
||||
streamMessage.states[entityId]
|
||||
);
|
||||
if (streamMessage.states[entityId][0] > lastCombined) {
|
||||
if (streamMessage.states[entityId][0] > lastEntityCombinedHistory) {
|
||||
// If the history is out of order we have to sort it.
|
||||
newHistory[entityId] = newHistory[entityId].sort(
|
||||
(a, b) => a.lu - b.lu
|
||||
|
Loading…
x
Reference in New Issue
Block a user