Fix bug where no deltas where created for Android

pull/95/head
JulioV 2020-04-09 12:07:35 -04:00
parent c2fbc3ad7a
commit 5d68b5052c
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ if(nrow(battery) > 0){
consumption <- battery %>%
mutate(group = ifelse(lag(battery_status) != battery_status, 1, 0) %>% coalesce(0),
group_id = cumsum(group) + 1) %>%
filter(battery_status == 2 || battery_status == 3) %>%
filter(battery_status == 2 | battery_status == 3) %>%
group_by(group_id) %>%
summarize(battery_diff = first(battery_level) - last(battery_level),
time_diff = (last(timestamp) - first(timestamp)) / (1000 * 60 * 60),