Renamed thing.py to system.py and set a proper title

This commit is contained in:
ChaoticByte 2025-02-23 16:37:18 +01:00
parent eb8f666823
commit a235041277
No known key found for this signature in database
3 changed files with 3 additions and 3 deletions

30
dashboard/system.py Normal file
View file

@ -0,0 +1,30 @@
# Copyright (c) 2025, Julian Müller (ChaoticByte)
from enum import Enum
# base classes and types and stuff
class SystemState(Enum):
OK = 0
FAILED = 1
UNKNOWN = 2
class System:
def __init__(self, name: str, description: str):
self.name = name
self.description = description
self.state = SystemState.UNKNOWN
self.state_verbose = ""
def get_actions(self) -> dict:
# to be overridden
# return {'ActionName': callable, ...}
return {}
def update_state(self):
# to be overridden
self.state = SystemState.UNKNOWN
self.state_verbose = ""