brightnessd: fix seconds -> hours

This commit is contained in:
Adeeb Shihadeh
2021-12-08 15:55:08 -08:00
parent 35f9fff11b
commit 2f607fc5bd
2 changed files with 12 additions and 1 deletions
Executable
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd $DIR
fastboot format userdata
./flash_bootloader.sh
./flash_kernel.sh
./flash_system.sh
fastboot continue
+1 -1
View File
@@ -34,7 +34,7 @@ if __name__ == "__main__":
last_off_ts = time.monotonic()
# calculate new max
uptime_hours = (time.monotonic() - last_off_ts) / 60*60
uptime_hours = (time.monotonic() - last_off_ts) / (60*60)
clipped_perc = MAX_PERCENT - (HOURLY_PERC_DECREASE*uptime_hours)
clipped_perc = int(max(min(clipped_perc, MAX_PERCENT), MIN_PERCENT))