From 6e498648c88bfe535a93dc60a00e32e45fb46978 Mon Sep 17 00:00:00 2001 From: ajouatom Date: Sun, 18 May 2025 13:27:08 +0900 Subject: [PATCH] fix.. dsp... --- system/hardware/base.py | 4 ++++ system/hardware/tici/hardware.py | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/system/hardware/base.py b/system/hardware/base.py index c7c765f..90b42b2 100644 --- a/system/hardware/base.py +++ b/system/hardware/base.py @@ -33,6 +33,7 @@ class ThermalZone: class ThermalConfig: cpu: list[ThermalZone] | None = None gpu: list[ThermalZone] | None = None + dsp: ThermalZone | None = None pmic: list[ThermalZone] | None = None memory: ThermalZone | None = None intake: ThermalZone | None = None @@ -130,6 +131,9 @@ class HardwareBase(ABC): def get_thermal_config(self): return ThermalConfig() + def set_display_power(self, on: bool): + pass + @abstractmethod def set_screen_brightness(self, percentage): pass diff --git a/system/hardware/tici/hardware.py b/system/hardware/tici/hardware.py index b2d00a4..5a8e41b 100644 --- a/system/hardware/tici/hardware.py +++ b/system/hardware/tici/hardware.py @@ -340,6 +340,13 @@ class Tici(HardwareBase): exhaust=exhaust, case=case) + def set_display_power(self, on): + try: + with open("/sys/class/backlight/panel0-backlight/bl_power", "w") as f: + f.write("0" if on else "4") + except Exception: + pass + def set_screen_brightness(self, percentage): try: with open("/sys/class/backlight/panel0-backlight/max_brightness") as f: