vcgencmd measure_temp and thermal_zone0 are the same

This commit is contained in:
Maxim Devaev 2022-03-19 23:08:11 +03:00
parent c2634cb69f
commit d4c307b804
2 changed files with 1 additions and 10 deletions

View File

@ -54,10 +54,9 @@ class HwInfoSubmanager(BaseInfoSubmanager):
self.__state_poll = state_poll
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_cpu_temp(),
self.__get_gpu_temp(),
self.__get_throttling(),
)
return {
@ -68,7 +67,6 @@ class HwInfoSubmanager(BaseInfoSubmanager):
"health": {
"temp": {
"cpu": cpu_temp,
"gpu": gpu_temp,
},
"throttling": throttling,
},
@ -127,12 +125,6 @@ class HwInfoSubmanager(BaseInfoSubmanager):
}
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]:
cmd = [*self.__vcgencmd_cmd, arg]
try:

View File

@ -1,5 +1,4 @@
#!/bin/sh
case $1 in
get_throttled) echo "throttled=0x0";;
measure_temp) echo "temp=35.0'C";;
esac