Skip to content

Commit

Permalink
Increase CO2 sample interval to 15 min
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickpeterse committed Aug 7, 2023
1 parent 1e3da5c commit 7130891
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/openflow/inputs/co2.inko
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let SAMPLE_INTERVAL = 30

# The interval (in seconds) at which to calculate a new CO2 value based on the
# gathered samples.
let UPDATE_INTERVAL = 600
let UPDATE_INTERVAL = 900

# How many samples we should gather before updating the CO2 levels.
let pub SAMPLES = UPDATE_INTERVAL / SAMPLE_INTERVAL
Expand Down
15 changes: 15 additions & 0 deletions test/openflow/inputs/test_co2.inko
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ fn pub tests(t: mut Tests) {
let samples = recover [
875, 875, 875, 875, 875, 875, 875, 875, 875, 875,
875, 875, 875, 875, 875, 875, 875, 875, 875, 875,
875, 875, 875, 875, 875, 875, 875, 875, 875, 875,

900, 900, 900, 900, 900, 900, 900, 900, 900, 900,
900, 900, 900, 900, 900, 900, 900, 900, 900, 900,
900, 900, 900, 900, 900, 900, 900, 900, 900, 900,
]
let input = input(state, samples: samples)

Expand Down Expand Up @@ -174,14 +176,17 @@ fn pub tests(t: mut Tests) {
# The first update.
750, 750, 750, 750, 750, 750, 750, 750, 750, 750,
750, 750, 750, 750, 750, 750, 750, 750, 750, 750,
750, 750, 750, 750, 750, 750, 750, 750, 750, 750,

# The second update, where we'll maintain the speed for a while.
650, 650, 650, 650, 650, 650, 650, 650, 650, 650,
650, 650, 650, 650, 650, 650, 650, 650, 650, 650,
650, 650, 650, 650, 650, 650, 650, 650, 650, 650,

# The third update, where we'll reduce the speed.
550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
]

let input = input(state, samples: samples)
Expand All @@ -201,14 +206,17 @@ fn pub tests(t: mut Tests) {
# The first update.
750, 750, 750, 750, 750, 750, 750, 750, 750, 750,
750, 750, 750, 750, 750, 750, 750, 750, 750, 750,
750, 750, 750, 750, 750, 750, 750, 750, 750, 750,

# The second update.
700, 700, 700, 700, 700, 700, 700, 700, 700, 700,
700, 700, 700, 700, 700, 700, 700, 700, 700, 700,
700, 700, 700, 700, 700, 700, 700, 700, 700, 700,

# The third update.
550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
]

let input = input(state, samples: samples)
Expand All @@ -229,10 +237,12 @@ fn pub tests(t: mut Tests) {
# The first update.
700, 700, 700, 700, 700, 700, 700, 700, 700, 700,
700, 700, 700, 700, 700, 700, 700, 700, 700, 700,
700, 700, 700, 700, 700, 700, 700, 700, 700, 700,

# The second update.
600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
]

let input = input(state, samples: samples)
Expand All @@ -250,14 +260,17 @@ fn pub tests(t: mut Tests) {
# The first update.
900, 900, 900, 900, 900, 900, 900, 900, 900, 900,
900, 900, 900, 900, 900, 900, 900, 900, 900, 900,
900, 900, 900, 900, 900, 900, 900, 900, 900, 900,

# The second update.
700, 700, 700, 700, 700, 700, 700, 700, 700, 700,
700, 700, 700, 700, 700, 700, 700, 700, 700, 700,
700, 700, 700, 700, 700, 700, 700, 700, 700, 700,

# The third update.
500, 500, 500, 500, 500, 500, 500, 500, 500, 500,
500, 500, 500, 500, 500, 500, 500, 500, 500, 500,
500, 500, 500, 500, 500, 500, 500, 500, 500, 500,
]

let input = input(state, samples: samples)
Expand All @@ -278,10 +291,12 @@ fn pub tests(t: mut Tests) {
# Update 1
750, 750, 750, 750, 750, 750, 750, 750, 750, 750,
750, 750, 750, 750, 750, 750, 750, 750, 750, 750,
750, 750, 750, 750, 750, 750, 750, 750, 750, 750,

# Update 2
675, 675, 675, 675, 675, 675, 675, 675, 675, 675,
675, 675, 675, 675, 675, 675, 675, 675, 675, 675,
675, 675, 675, 675, 675, 675, 675, 675, 675, 675,
]

let input = input(state, samples: samples)
Expand Down

0 comments on commit 7130891

Please sign in to comment.