alerting if upsc is not installed

This commit is contained in:
saqriphnix 2024-08-17 12:32:25 +03:00
parent 66bc90da5c
commit 17e5d1be0c
2 changed files with 15 additions and 3 deletions

View file

@ -98,7 +98,10 @@ async def vuln_check() -> list[alerts.Alert]:
async def ups_check() -> list[alerts.Alert]:
sensor = sensors.Sensors.get_ups()
sensor = await sensors.Sensors.get_ups()
if not sensor: return
alert_list = []
if IS_TESTING or sensor.battery_charge_percentage < sensor.battery_critical_percentage: