-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move activity history code from utils to interfaces and types
- Loading branch information
1 parent
281e7f0
commit c2d9557
Showing
7 changed files
with
59 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from .state_interface import StateInterface | ||
from .plc_interface import PLCInterface | ||
from .activity_history import ActivityHistoryInterface | ||
from .os_interface import OSInterface | ||
from .plc_interface import PLCInterface | ||
from .state_interface import StateInterface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from __future__ import annotations | ||
import datetime | ||
import pydantic | ||
|
||
|
||
class ActivityDatapoint(pydantic.BaseModel): | ||
"""A datapoint of the activity history.""" | ||
|
||
local_time: datetime.time | ||
is_measuring: bool = False | ||
has_errors: bool = False | ||
is_uploading: bool = False | ||
camtracker_startups: int = 0 | ||
opus_startups: int = 0 | ||
cli_calls: int = 0 | ||
|
||
|
||
class ActivityDatapointList(pydantic.RootModel[list[ActivityDatapoint]]): | ||
"""A datapoint of the activity history.""" | ||
|
||
root: list[ActivityDatapoint] | ||
|
||
|
||
example = { | ||
"localTime": "12:00", "measuring": True, "errors": False, "uploading": False | ||
} | ||
|
||
|
||
class ActivityHistory(pydantic.BaseModel): | ||
"""A datapoint of the activity history.""" | ||
|
||
datapoints: ActivityDatapointList = ActivityDatapointList(root=[]) | ||
date: datetime.date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
from .activity_history import ActivityHistoryInterface as ActivityHistoryInterface | ||
from .logger import Logger | ||
from .astronomy import Astronomy | ||
from .exception_email_client import ExceptionEmailClient | ||
from .helios_image_processing import HeliosImageProcessing | ||
from .functions import read_last_file_line | ||
from .helios_image_processing import HeliosImageProcessing | ||
from .logger import Logger |