More improvements to battery monitor.

This commit is contained in:
Storm Dragon
2025-08-08 19:58:47 -04:00
parent cdce0140cc
commit 9159fcac43

View File

@@ -101,7 +101,7 @@ class BatteryMonitor:
return
try:
subprocess.run(['spd-say', '-w', message], check=True)
subprocess.run(['espeak-ng', '-v', 'en-us', '-a', '200', message], check=True)
except Exception as e:
logger.error(f"Speech error: {e}")
@@ -125,7 +125,7 @@ class BatteryMonitor:
logger.critical(f"Battery at {level}% - initiating shutdown")
self.speak("Critical battery level. System shutting down now.")
time.sleep(2) # Give speech time to complete
subprocess.run(['sudo', 'poweroff'], check=True)
subprocess.run(['systemctl', 'poweroff'], check=True)
return
elif level <= 5 and not self.warned_5: