Skip to content

Commit

Permalink
log battery infos (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodja committed Jul 17, 2024
1 parent 6af88a4 commit a12f93f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion field_friend/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit a12f93f

Please sign in to comment.