From 2f607fc5bdc5b33146f43701bb60604a5eece983 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 8 Dec 2021 15:55:08 -0800 Subject: [PATCH] brightnessd: fix seconds -> hours --- flash_all.sh | 11 +++++++++++ userspace/usr/comma/brightnessd.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 flash_all.sh diff --git a/flash_all.sh b/flash_all.sh new file mode 100755 index 0000000..b76ba5b --- /dev/null +++ b/flash_all.sh @@ -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 diff --git a/userspace/usr/comma/brightnessd.py b/userspace/usr/comma/brightnessd.py index 1b7c72c..fee3197 100755 --- a/userspace/usr/comma/brightnessd.py +++ b/userspace/usr/comma/brightnessd.py @@ -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))