Add a timestamp with the last update to each card
This commit is contained in:
parent
a8c8dca4aa
commit
75881cbe48
2 changed files with 12 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue