gsd 8 months ago
parent
commit
6f2f80929c
  1. 8
      pipboyIO/next/serialAX.py

8
pipboyIO/next/serialAX.py

@ -136,10 +136,10 @@ class Listener(asyncio.Protocol):
DISPLAY_ID = 10001 DISPLAY_ID = 10001
try: try:
while self.is_connected: while self.is_connected:
cpu_percent = psutil.cpu_percent(interval=None) cpu_percent = round(psutil.cpu_percent(interval=None), 1)
if self.transport and not self.transport.is_closing(): if self.transport and not self.transport.is_closing():
msg = f"{DISPLAY_ID} {cpu_percent:5.1f} 0\n" msg = f"{DISPLAY_ID} {cpu_percent} 0\n"
print(msg) print(msg)
self.transport.write(msg.encode()) self.transport.write(msg.encode())
@ -152,10 +152,10 @@ class Listener(asyncio.Protocol):
try: try:
while self.is_connected: while self.is_connected:
mem = psutil.virtual_memory() mem = psutil.virtual_memory()
mem_percent = mem.percent / 10 mem_percent = round(mem.percent / 10, 1)
if self.transport and not self.transport.is_closing(): if self.transport and not self.transport.is_closing():
msg = f"{DISPLAY_ID} {mem_percent:5.1f} 0\n" msg = f"{DISPLAY_ID} {mem_percent} 0\n"
print(msg) print(msg)
self.transport.write(msg.encode()) self.transport.write(msg.encode())

Loading…
Cancel
Save