From a12f93fba72269126ab986ba7f35f373420a756a Mon Sep 17 00:00:00 2001 From: Rodja Trappe Date: Wed, 17 Jul 2024 09:14:14 +0200 Subject: [PATCH] log battery infos (#120) --- field_friend/system.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/field_friend/system.py b/field_friend/system.py index 5d458810..82c0c061 100644 --- a/field_friend/system.py +++ b/field_friend/system.py @@ -243,5 +243,8 @@ def get_jetson_cpu_temperature(self): return float(temp) / 1000.0 # Convert from milli °C to °C def log_status(self): - msg = f'cpu: {psutil.cpu_percent():.0f}% mem: {psutil.virtual_memory().percent:.0f}% temp: {self.get_jetson_cpu_temperature():.1f}°C' + msg = f'cpu: {psutil.cpu_percent():.0f}% ' + msg += f'mem: {psutil.virtual_memory().percent:.0f}% ' + msg += f'temp: {self.get_jetson_cpu_temperature():.1f}°C ' + msg += f'battery: {self.field_friend.bms.state.short_string}' self.log.info(msg)