mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-06 16:07:48 +00:00
review
This commit is contained in:
parent
e9c5e51f25
commit
e4ebb320e5
@ -243,12 +243,11 @@ class HistoryStream {
|
|||||||
entityId in this.combinedHistory &&
|
entityId in this.combinedHistory &&
|
||||||
entityId in streamMessage.states
|
entityId in streamMessage.states
|
||||||
) {
|
) {
|
||||||
|
const lastCombined = this.combinedHistory[entityId][-1];
|
||||||
newHistory[entityId] = this.combinedHistory[entityId].concat(
|
newHistory[entityId] = this.combinedHistory[entityId].concat(
|
||||||
streamMessage.states[entityId]
|
streamMessage.states[entityId]
|
||||||
);
|
);
|
||||||
if (
|
if (streamMessage.states[entityId][0] > lastCombined) {
|
||||||
streamMessage.states[entityId][0] > this.combinedHistory[entityId][-1]
|
|
||||||
) {
|
|
||||||
// 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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user