Skip to content

Commit

Permalink
bla3
Browse files Browse the repository at this point in the history
  • Loading branch information
theyosh committed May 3, 2024
1 parent 93c856f commit cd81467
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions gui/components/common/Graph.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
// new_data = extendGraphData(new_data);
// }
// if (['relays', 'buttons'].indexOf(mode) !== -1) {
// new_data = extendGraphData(new_data);
// }
if (['relays', 'buttons'].indexOf(mode) !== -1) {
new_data = extendGraphData(new_data);
}
if (mode === 'sensors' && settings.graph_smooth_value > 0) {
new_data = smoothing(new_data, settings.graph_smooth_value);
Expand Down
4 changes: 2 additions & 2 deletions gui/helpers/graph-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ export const extendGraphData = (data) => {
let now = new Date();

let end = structuredClone(data[data.length-1]);
end.timestamp = Math.round(now.getTime() / 1000000);
end.timestamp = Math.round(now.getTime());

now.setDate(now.getDate() - 1);
let start = structuredClone(data[0]);
start.timestamp = Math.round(now.getTime() / 1000000);
start.timestamp = Math.round(now.getTime());

return [start,...data,end]
}
Expand Down

0 comments on commit cd81467

Please sign in to comment.