File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -62,19 +62,18 @@ async function fetchSingleRange(
6262 list . push ( dup ) ;
6363 return {
6464 entityId : entityIdWithAttribute ,
65- range : [
66- startT ,
67- + new Date ( last . last_updated ) ,
68- ] , // cap range to now
65+ range : [ startT , + new Date ( dup . last_updated ) ] , // cap range to now
6966 attributes : {
7067 unit_of_measurement : "" ,
7168 ...list [ 0 ] . attributes ,
7269 } ,
73- history : list . map ( ( entry ) => ( {
74- ...entry ,
75- state : attribute ? entry . attributes [ attribute ] : entry . state ,
76- last_updated : + new Date ( entry . last_updated || entry . last_changed ) ,
77- } ) ) ,
70+ history : list
71+ . map ( ( entry ) => ( {
72+ ...entry ,
73+ state : attribute ? entry . attributes [ attribute ] : entry . state ,
74+ last_updated : + new Date ( entry . last_updated || entry . last_changed ) ,
75+ } ) )
76+ . filter ( ( { last_updated } ) => last_updated ) ,
7877 } ;
7978}
8079export default class Cache {
You can’t perform that action at this time.
0 commit comments