revert
This commit is contained in:
parent
6e498648c8
commit
9e9e51f605
@ -33,7 +33,6 @@ class ThermalZone:
|
|||||||
class ThermalConfig:
|
class ThermalConfig:
|
||||||
cpu: list[ThermalZone] | None = None
|
cpu: list[ThermalZone] | None = None
|
||||||
gpu: list[ThermalZone] | None = None
|
gpu: list[ThermalZone] | None = None
|
||||||
dsp: ThermalZone | None = None
|
|
||||||
pmic: list[ThermalZone] | None = None
|
pmic: list[ThermalZone] | None = None
|
||||||
memory: ThermalZone | None = None
|
memory: ThermalZone | None = None
|
||||||
intake: ThermalZone | None = None
|
intake: ThermalZone | None = None
|
||||||
@ -131,9 +130,6 @@ class HardwareBase(ABC):
|
|||||||
def get_thermal_config(self):
|
def get_thermal_config(self):
|
||||||
return ThermalConfig()
|
return ThermalConfig()
|
||||||
|
|
||||||
def set_display_power(self, on: bool):
|
|
||||||
pass
|
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def set_screen_brightness(self, percentage):
|
def set_screen_brightness(self, percentage):
|
||||||
pass
|
pass
|
||||||
|
@ -297,11 +297,13 @@ class Tici(HardwareBase):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def get_modem_temperatures(self):
|
def get_modem_temperatures(self):
|
||||||
|
if self.get_device_type() == "mici":
|
||||||
|
return []
|
||||||
timeout = 0.2 # Default timeout is too short
|
timeout = 0.2 # Default timeout is too short
|
||||||
try:
|
try:
|
||||||
modem = self.get_modem()
|
modem = self.get_modem()
|
||||||
temps = modem.Command("AT+QTEMP", math.ceil(timeout), dbus_interface=MM_MODEM, timeout=timeout)
|
temps = modem.Command("AT+QTEMP", math.ceil(timeout), dbus_interface=MM_MODEM, timeout=timeout)
|
||||||
return list(filter(lambda t: t != 255, map(int, temps.split(' ')[1].split(','))))
|
return list(map(int, temps.split(' ')[1].split(',')))
|
||||||
except Exception:
|
except Exception:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
@ -333,20 +335,12 @@ class Tici(HardwareBase):
|
|||||||
return ThermalConfig(cpu=[ThermalZone(f"cpu{i}-silver-usr") for i in range(4)] +
|
return ThermalConfig(cpu=[ThermalZone(f"cpu{i}-silver-usr") for i in range(4)] +
|
||||||
[ThermalZone(f"cpu{i}-gold-usr") for i in range(4)],
|
[ThermalZone(f"cpu{i}-gold-usr") for i in range(4)],
|
||||||
gpu=[ThermalZone("gpu0-usr"), ThermalZone("gpu1-usr")],
|
gpu=[ThermalZone("gpu0-usr"), ThermalZone("gpu1-usr")],
|
||||||
dsp=ThermalZone("compute-hvx-usr"),
|
|
||||||
memory=ThermalZone("ddr-usr"),
|
memory=ThermalZone("ddr-usr"),
|
||||||
pmic=[ThermalZone("pm8998_tz"), ThermalZone("pm8005_tz")],
|
pmic=[ThermalZone("pm8998_tz"), ThermalZone("pm8005_tz")],
|
||||||
intake=intake,
|
intake=intake,
|
||||||
exhaust=exhaust,
|
exhaust=exhaust,
|
||||||
case=case)
|
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):
|
def set_screen_brightness(self, percentage):
|
||||||
try:
|
try:
|
||||||
with open("/sys/class/backlight/panel0-backlight/max_brightness") as f:
|
with open("/sys/class/backlight/panel0-backlight/max_brightness") as f:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user