mirror of
https://github.com/commaai/agnos-builder.git
synced 2026-07-13 10:52:06 +08:00
brightnessd: fix seconds -> hours
This commit is contained in:
Executable
+11
@@ -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
|
||||
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user