Skip to content

Commit

Permalink
Protect important comment
Browse files Browse the repository at this point in the history
  • Loading branch information
hmpf committed Oct 12, 2023
1 parent f970218 commit d344a10
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/zinolib/event_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ def create_list(cls, raw_history_list):

class Event(BaseModel):
"""
Base-class with common fields for all events.
Here there be dragons!
The following cannot be set here, only per subclass::
port: str = ""
description: str = ""
op_state: str = ""
For that reason, never ``Event()``, always ``Event.create()``!
"""
class Type(StrEnum):
ALARM = "alarm"
Expand All @@ -118,11 +128,6 @@ class Type(StrEnum):
polladdr: Optional[IPvAnyAddress] = None
priority: int = 100

# Cannot be set here, only per subclass
# port: str = ""
# description: str = ""
# op_state: str = ""

log: List[LogEntry] = []
history: List[HistoryEntry] = []
SUBTYPES: ClassVar[dict] = {}
Expand Down

0 comments on commit d344a10

Please sign in to comment.