Add a timestamp with the last update to each card

This commit is contained in:
ChaoticByte 2025-02-23 21:17:03 +01:00
parent a8c8dca4aa
commit 75881cbe48
No known key found for this signature in database
2 changed files with 12 additions and 2 deletions

View file

@ -6,6 +6,7 @@
import platform
import requests
import subprocess
import time
from enum import Enum
from typing import Tuple
@ -25,12 +26,17 @@ class System:
self.description = description
self.state = SystemState.UNKNOWN
self.state_verbose = ""
self.last_update = 0
def get_actions(self) -> dict:
# to be overridden
# return {'ActionName': callable, ...}
return {}
def _update_state(self):
self.update_state()
self.last_update = time.time()
def update_state(self):
# to be overridden
self.state = SystemState.UNKNOWN