mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
vcgencmd measure_temp and thermal_zone0 are the same
This commit is contained in:
parent
c2634cb69f
commit
d4c307b804
@ -54,10 +54,9 @@ class HwInfoSubmanager(BaseInfoSubmanager):
|
|||||||
self.__state_poll = state_poll
|
self.__state_poll = state_poll
|
||||||
|
|
||||||
async def get_state(self) -> Dict:
|
async def get_state(self) -> Dict:
|
||||||
(model, cpu_temp, gpu_temp, throttling) = await asyncio.gather(
|
(model, cpu_temp, throttling) = await asyncio.gather(
|
||||||
self.__get_dt_model(),
|
self.__get_dt_model(),
|
||||||
self.__get_cpu_temp(),
|
self.__get_cpu_temp(),
|
||||||
self.__get_gpu_temp(),
|
|
||||||
self.__get_throttling(),
|
self.__get_throttling(),
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
@ -68,7 +67,6 @@ class HwInfoSubmanager(BaseInfoSubmanager):
|
|||||||
"health": {
|
"health": {
|
||||||
"temp": {
|
"temp": {
|
||||||
"cpu": cpu_temp,
|
"cpu": cpu_temp,
|
||||||
"gpu": gpu_temp,
|
|
||||||
},
|
},
|
||||||
"throttling": throttling,
|
"throttling": throttling,
|
||||||
},
|
},
|
||||||
@ -127,12 +125,6 @@ class HwInfoSubmanager(BaseInfoSubmanager):
|
|||||||
}
|
}
|
||||||
return None
|
return None
|
||||||
|
|
||||||
async def __get_gpu_temp(self) -> Optional[float]:
|
|
||||||
return (await self.__parse_vcgencmd(
|
|
||||||
arg="measure_temp",
|
|
||||||
parser=(lambda text: float(text.split("=")[1].split("'")[0])),
|
|
||||||
))
|
|
||||||
|
|
||||||
async def __parse_vcgencmd(self, arg: str, parser: Callable[[str], _RetvalT]) -> Optional[_RetvalT]:
|
async def __parse_vcgencmd(self, arg: str, parser: Callable[[str], _RetvalT]) -> Optional[_RetvalT]:
|
||||||
cmd = [*self.__vcgencmd_cmd, arg]
|
cmd = [*self.__vcgencmd_cmd, arg]
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
case $1 in
|
case $1 in
|
||||||
get_throttled) echo "throttled=0x0";;
|
get_throttled) echo "throttled=0x0";;
|
||||||
measure_temp) echo "temp=35.0'C";;
|
|
||||||
esac
|
esac
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user