mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-10 04:41:10 +00:00
use NestedDeserializableDataclass for config
This commit is contained in:
parent
96664684f8
commit
3eb358d618
13 changed files with 188 additions and 130 deletions
|
|
@ -5,6 +5,7 @@ from enum import StrEnum
|
|||
from psutil import cpu_percent, sensors_temperatures, virtual_memory
|
||||
|
||||
from alerting import alerts
|
||||
from alerting.enum import AlertType, Severity
|
||||
|
||||
|
||||
@dataclass
|
||||
|
|
@ -138,9 +139,9 @@ class Sensors:
|
|||
except FileNotFoundError:
|
||||
await alerts.send_alert(
|
||||
alerts.Alert(
|
||||
alert_type=alerts.AlertType.ERROR,
|
||||
alert_type=AlertType.ERROR,
|
||||
message="upsc is not installed!",
|
||||
severity=alerts.Severity.CRITICAL,
|
||||
severity=Severity.CRITICAL,
|
||||
)
|
||||
)
|
||||
return None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue