diff --git a/hardware_components/abstract_hardware_components.py b/hardware_components/abstract_hardware_components.py index 668cffb7955399b15051777b447cd3bb5fcbe1bb..e12aa6fb89320885087e0ac0a5ab06e6d3c5e4e4 100644 --- a/hardware_components/abstract_hardware_components.py +++ b/hardware_components/abstract_hardware_components.py @@ -24,13 +24,14 @@ class ControllerAbstract(ABC): self.exec_logger.warning(f'CPU temperature reading is not available for {self.board_name}') cpu_temp = np.nan else: - cpu_temp = self._get_cpu_temp() + cpu_temp = self._cpu_temp if cpu_temp > self.max_cpu_temp: self.soh_logger.warning(f'CPU temperature of {self.board_name} is over the limit!') return cpu_temp @abstractmethod - def _get_cpu_temp(self): + @property + def _cpu_temp(self): pass class MuxAbstract(ABC): diff --git a/hardware_components/raspberry_pi.py b/hardware_components/raspberry_pi.py index 284be0e4e25b975b9c149bd5758d682b8333ec1a..1169a2e9838b89dbed803358c5913fdd209588e5 100644 --- a/hardware_components/raspberry_pi.py +++ b/hardware_components/raspberry_pi.py @@ -17,5 +17,5 @@ class Controller(ControllerAbstract): self.max_cpu_temp = 85. # °C @property - def _get_cpu_temp(self): + def _cpu_temp(self): return CPUTemperature().temperature \ No newline at end of file