This commit is contained in:
J. Nick Koston 2023-01-21 17:03:39 -10:00
parent 45316b458f
commit e1d17f3d3a

View File

@ -249,7 +249,9 @@ class HistoryStream {
newHistory[entityId] = entityCombinedHistory.concat( newHistory[entityId] = entityCombinedHistory.concat(
streamMessage.states[entityId] streamMessage.states[entityId]
); );
if (streamMessage.states[entityId][0] > lastEntityCombinedHistory) { if (
streamMessage.states[entityId][0].lu > lastEntityCombinedHistory.lu
) {
// If the history is out of order we have to sort it. // If the history is out of order we have to sort it.
newHistory[entityId] = newHistory[entityId].sort( newHistory[entityId] = newHistory[entityId].sort(
(a, b) => a.lu - b.lu (a, b) => a.lu - b.lu