-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhwsensors.py
executable file
·102 lines (82 loc) · 2.59 KB
/
hwsensors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
"""Hardware monitoring base class for hardware sensors
"""
from abc import ABC, abstractmethod
class HWSensorBase(ABC):
"""Base class for system hardware monitoring sensors
"""
headings = []
@abstractmethod
def get_label(self, params: list) -> str | None:
"""Get label"""
raise NotImplementedError
@abstractmethod
def update(self) -> None:
"""Update hardware sensor
"""
raise NotImplementedError
def get_headings(self) -> list:
"""Get list of headings"""
return self.headings
@abstractmethod
def get_section(self, params: list) -> str | None:
"""Get section"""
raise NotImplementedError
@abstractmethod
def get_subsection(self, params: list) -> str | None:
"""Get section"""
raise NotImplementedError
@abstractmethod
def get_current(self, params: list) -> int | None:
"""Get current sensor data
"""
raise NotImplementedError
@abstractmethod
def get_min(self, params: list) -> int | None:
"""Get minimum value for sensor data
"""
raise NotImplementedError
@abstractmethod
def get_max(self, params: list) -> int | None:
"""Get maximum value for sensor data
"""
raise NotImplementedError
@abstractmethod
def get_mean(self, params: list) -> int | None:
"""Get average value for sensor data
"""
raise NotImplementedError
@abstractmethod
def get_csv_headings(self) -> list:
"""Return headings for csv file for sensor
"""
raise NotImplementedError
@abstractmethod
def get_csv_data(self) -> list:
"""Return list of sensor data for sensor
"""
raise NotImplementedError
# @abstractmethod
# def get_win_lines(self) -> int:
# """return number of lines needed for this data's curses window
# """
# raise NotImplementedError
# @abstractmethod
# def get_win_columns(self) -> int:
# """return the number of columns needed for this data's curses window
# """
# raise NotImplementedError
# @abstractmethod
# def get_win_heading(self, params: list) -> str:
# """return a heading for this data's curses window
# """
# raise NotImplementedError
# @abstractmethod
# def get_win_sensor(self, params: list) -> str:
# """return a label for this data's curses window
# """
# raise Not ImplementedError
@abstractmethod
def is_empty(self) -> bool:
"""Is the sensor empty?
"""
return False