Skip to content

Commit d6c5af6

Browse files
author
Vicente Salvador
committed
Constant FAN_SPEED not defined in stub stats
1 parent d9ebfe9 commit d6c5af6

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

library/sensors/sensors_stub_random.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ def is_available() -> bool:
7575
return True
7676

7777
class System(sensors.System):
78+
@staticmethod
79+
def stats() -> Tuple[
80+
float, float, float]: # fan (%) / fan speed / temp (°C)
81+
return random.uniform(0, 100), random.uniform(800, 2500), random.uniform(30, 90)
82+
7883
@staticmethod
7984
def fan_percent(fan_name: str = None) -> float:
8085
return random.uniform(0, 100)

library/sensors/sensors_stub_static.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,20 @@ def is_available() -> bool:
9292
return True
9393

9494
class System(sensors.System):
95+
@staticmethod
96+
def stats() -> Tuple[
97+
float, float, float]: # fan (%) / fan speed / temp (°C)
98+
return (PERCENTAGE_SENSOR_VALUE,
99+
CPU_FAN_SPEED,
100+
TEMPERATURE_SENSOR_VALUE)
101+
95102
@staticmethod
96103
def fan_percent(fan_name: str = None) -> float:
97104
return PERCENTAGE_SENSOR_VALUE
98105

99106
@staticmethod
100107
def fan_speed(fan_name: str = None) -> float:
101-
return FAN_SPEED
108+
return CPU_FAN_SPEED
102109

103110
@staticmethod
104111
def temperature(sys_temp: str = None) -> float:

library/stats.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,6 @@ def stats(cls):
433433

434434

435435
theme_system_data = config.THEME_DATA['STATS']['SYSTEM']
436-
437436
save_last_value(fan_percent, cls.last_values_system_fan_percent,
438437
theme_system_data['FAN_PERCENT']['LINE_GRAPH'].get("HISTORY_SIZE", DEFAULT_HISTORY_SIZE))
439438
save_last_value(fan_speed, cls.last_values_system_fan_speed,
48.3 KB
Loading
48.3 KB
Loading

0 commit comments

Comments
 (0)