Update to v1.4.2
Feat: tray icon now shows API/watcher health rather than unit ages. unit submenu removed, now handled by recieving software. Chore: remove old unneeded code from deprecated features (console colorization, Missing/pending age limits)
This commit is contained in:
@@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## [1.4.2] - 2026-03-17
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Tray icon color now reflects watcher + API health rather than unit ages — green=API OK, amber=API disabled, red=API failing, purple=watcher error.
|
||||||
|
- Status menu text updated to show `Running — API OK | N unit(s) | scan Xm ago`.
|
||||||
|
- Units submenu removed from tray — status tracking for individual units is handled by terra-view, not the watcher.
|
||||||
|
- Unit list still logged to console and log file for debugging, but no OK/Pending/Missing judgement applied.
|
||||||
|
- `watcher_status` field added to heartbeat payload so terra-view receives accurate watcher health data.
|
||||||
|
|
||||||
## [1.4.1] - 2026-03-17
|
## [1.4.1] - 2026-03-17
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Series 3 Watcher v1.4.1
|
# Series 3 Watcher v1.4.2
|
||||||
|
|
||||||
Monitors Instantel **Series 3 (Minimate)** call-in activity on a Blastware server. Runs as a **system tray app** that starts automatically on login, reports heartbeats to terra-view, and self-updates from Gitea.
|
Monitors Instantel **Series 3 (Minimate)** call-in activity on a Blastware server. Runs as a **system tray app** that starts automatically on login, reports heartbeats to terra-view, and self-updates from Gitea.
|
||||||
|
|
||||||
@@ -82,7 +82,6 @@ All settings live in `config.ini`. The Setup Wizard covers every field, but here
|
|||||||
|-----|-------------|
|
|-----|-------------|
|
||||||
| `ENABLE_LOGGING` | `true` / `false` |
|
| `ENABLE_LOGGING` | `true` / `false` |
|
||||||
| `LOG_RETENTION_DAYS` | Auto-clear log after this many days (default `30`) |
|
| `LOG_RETENTION_DAYS` | Auto-clear log after this many days (default `30`) |
|
||||||
| `COLORIZE` | ANSI colours in console — leave `false` on Win7 |
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -117,7 +116,7 @@ To view connected watchers: **Settings → Developer → Watcher Manager**.
|
|||||||
|
|
||||||
## Versioning
|
## Versioning
|
||||||
|
|
||||||
Follows **Semantic Versioning**. Current release: **v1.4.1**.
|
Follows **Semantic Versioning**. Current release: **v1.4.2**.
|
||||||
See `CHANGELOG.md` for full history.
|
See `CHANGELOG.md` for full history.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ ENABLE_LOGGING = True
|
|||||||
LOG_FILE = C:\Users\%USERNAME%\AppData\Local\Series3Watcher\agent_logs\series3_watcher.log
|
LOG_FILE = C:\Users\%USERNAME%\AppData\Local\Series3Watcher\agent_logs\series3_watcher.log
|
||||||
LOG_RETENTION_DAYS = 30
|
LOG_RETENTION_DAYS = 30
|
||||||
|
|
||||||
# Console colors - (Doesn't work on windows 7)
|
|
||||||
COLORIZE = FALSE
|
|
||||||
|
|
||||||
# .MLG parsing
|
# .MLG parsing
|
||||||
MLG_HEADER_BYTES = 2048 ; used for unit-id extraction
|
MLG_HEADER_BYTES = 2048 ; used for unit-id extraction
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
[Setup]
|
[Setup]
|
||||||
AppName=Series 3 Watcher
|
AppName=Series 3 Watcher
|
||||||
AppVersion=1.4.1
|
AppVersion=1.4.2
|
||||||
AppPublisher=Terra-Mechanics Inc.
|
AppPublisher=Terra-Mechanics Inc.
|
||||||
DefaultDirName={pf}\Series3Watcher
|
DefaultDirName={pf}\Series3Watcher
|
||||||
DefaultGroupName=Series 3 Watcher
|
DefaultGroupName=Series 3 Watcher
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ def load_config(path: str) -> Dict[str, Any]:
|
|||||||
"Series3Watcher", "agent_logs", "series3_watcher.log"
|
"Series3Watcher", "agent_logs", "series3_watcher.log"
|
||||||
)),
|
)),
|
||||||
"LOG_RETENTION_DAYS": get_int("LOG_RETENTION_DAYS", 30),
|
"LOG_RETENTION_DAYS": get_int("LOG_RETENTION_DAYS", 30),
|
||||||
"COLORIZE": get_bool("COLORIZE", False), # Win7 default off
|
|
||||||
"MLG_HEADER_BYTES": max(256, min(get_int("MLG_HEADER_BYTES", 2048), 65536)),
|
"MLG_HEADER_BYTES": max(256, min(get_int("MLG_HEADER_BYTES", 2048), 65536)),
|
||||||
"RECENT_WARN_DAYS": get_int("RECENT_WARN_DAYS", 30),
|
"RECENT_WARN_DAYS": get_int("RECENT_WARN_DAYS", 30),
|
||||||
"MAX_EVENT_AGE_DAYS": get_int("MAX_EVENT_AGE_DAYS", 365),
|
"MAX_EVENT_AGE_DAYS": get_int("MAX_EVENT_AGE_DAYS", 365),
|
||||||
@@ -82,10 +81,6 @@ def load_config(path: str) -> Dict[str, Any]:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# --------------- ANSI helpers ---------------
|
|
||||||
def ansi(enabled: bool, code: str) -> str:
|
|
||||||
return code if enabled else ""
|
|
||||||
|
|
||||||
|
|
||||||
# --------------- Logging --------------------
|
# --------------- Logging --------------------
|
||||||
def log_message(path: str, enabled: bool, msg: str) -> None:
|
def log_message(path: str, enabled: bool, msg: str) -> None:
|
||||||
@@ -310,9 +305,11 @@ def run_watcher(state: Dict[str, Any], stop_event: threading.Event) -> None:
|
|||||||
Main watcher loop. Runs in a background thread when launched from the tray.
|
Main watcher loop. Runs in a background thread when launched from the tray.
|
||||||
|
|
||||||
state dict is written on every scan cycle:
|
state dict is written on every scan cycle:
|
||||||
state["status"] — "ok" | "pending" | "missing" | "error" | "starting"
|
state["status"] — "running" | "error" | "starting"
|
||||||
state["units"] — list of dicts: {uid, status, age_hours, last, fname}
|
state["api_status"] — "ok" | "fail" | "disabled"
|
||||||
|
state["units"] — list of dicts: {uid, age_hours, last, fname}
|
||||||
state["last_scan"] — datetime of last successful scan (or None)
|
state["last_scan"] — datetime of last successful scan (or None)
|
||||||
|
state["last_api"] — datetime of last successful API POST (or None)
|
||||||
state["last_error"] — last error string (or None)
|
state["last_error"] — last error string (or None)
|
||||||
state["log_dir"] — directory containing the log file
|
state["log_dir"] — directory containing the log file
|
||||||
state["cfg"] — loaded config dict
|
state["cfg"] — loaded config dict
|
||||||
@@ -345,21 +342,13 @@ def run_watcher(state: Dict[str, Any], stop_event: threading.Event) -> None:
|
|||||||
|
|
||||||
WATCH_PATH = cfg["WATCH_PATH"]
|
WATCH_PATH = cfg["WATCH_PATH"]
|
||||||
SCAN_INTERVAL = int(cfg["SCAN_INTERVAL"])
|
SCAN_INTERVAL = int(cfg["SCAN_INTERVAL"])
|
||||||
OK_HOURS = float(cfg["OK_HOURS"])
|
|
||||||
MISSING_HOURS = float(cfg["MISSING_HOURS"])
|
|
||||||
ENABLE_LOGGING = bool(cfg["ENABLE_LOGGING"])
|
ENABLE_LOGGING = bool(cfg["ENABLE_LOGGING"])
|
||||||
LOG_FILE = cfg["LOG_FILE"]
|
LOG_FILE = cfg["LOG_FILE"]
|
||||||
LOG_RETENTION_DAYS = int(cfg["LOG_RETENTION_DAYS"])
|
LOG_RETENTION_DAYS = int(cfg["LOG_RETENTION_DAYS"])
|
||||||
COLORIZE = bool(cfg["COLORIZE"])
|
|
||||||
MLG_HEADER_BYTES = int(cfg["MLG_HEADER_BYTES"])
|
MLG_HEADER_BYTES = int(cfg["MLG_HEADER_BYTES"])
|
||||||
RECENT_WARN_DAYS = int(cfg["RECENT_WARN_DAYS"])
|
RECENT_WARN_DAYS = int(cfg["RECENT_WARN_DAYS"])
|
||||||
MAX_EVENT_AGE_DAYS = int(cfg["MAX_EVENT_AGE_DAYS"])
|
MAX_EVENT_AGE_DAYS = int(cfg["MAX_EVENT_AGE_DAYS"])
|
||||||
|
|
||||||
C_OK = ansi(COLORIZE, "\033[92m")
|
|
||||||
C_PEN = ansi(COLORIZE, "\033[93m")
|
|
||||||
C_MIS = ansi(COLORIZE, "\033[91m")
|
|
||||||
C_RST = ansi(COLORIZE, "\033[0m")
|
|
||||||
|
|
||||||
print(
|
print(
|
||||||
"[CFG] WATCH_PATH={} SCAN_INTERVAL={}s MAX_EVENT_AGE_DAYS={} API_ENABLED={}".format(
|
"[CFG] WATCH_PATH={} SCAN_INTERVAL={}s MAX_EVENT_AGE_DAYS={} API_ENABLED={}".format(
|
||||||
WATCH_PATH, SCAN_INTERVAL, MAX_EVENT_AGE_DAYS, bool(cfg.get("API_ENABLED", False))
|
WATCH_PATH, SCAN_INTERVAL, MAX_EVENT_AGE_DAYS, bool(cfg.get("API_ENABLED", False))
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
Series 3 Watcher — Settings Dialog v1.4.0
|
Series 3 Watcher — Settings Dialog v1.4.2
|
||||||
|
|
||||||
Provides a Tkinter settings dialog that doubles as a first-run wizard.
|
Provides a Tkinter settings dialog that doubles as a first-run wizard.
|
||||||
|
|
||||||
@@ -39,7 +39,6 @@ DEFAULTS = {
|
|||||||
"Series3Watcher", "agent_logs", "series3_watcher.log"
|
"Series3Watcher", "agent_logs", "series3_watcher.log"
|
||||||
),
|
),
|
||||||
"LOG_RETENTION_DAYS": "30",
|
"LOG_RETENTION_DAYS": "30",
|
||||||
"COLORIZE": "false",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -233,7 +232,6 @@ class SettingsDialog:
|
|||||||
# Logging
|
# Logging
|
||||||
self.var_enable_logging = tk.BooleanVar(value=v["ENABLE_LOGGING"].lower() in ("1","true","yes","on"))
|
self.var_enable_logging = tk.BooleanVar(value=v["ENABLE_LOGGING"].lower() in ("1","true","yes","on"))
|
||||||
self.var_log_retention_days = tk.StringVar(value=v["LOG_RETENTION_DAYS"])
|
self.var_log_retention_days = tk.StringVar(value=v["LOG_RETENTION_DAYS"])
|
||||||
self.var_colorize = tk.BooleanVar(value=v["COLORIZE"].lower() in ("1","true","yes","on"))
|
|
||||||
|
|
||||||
# --- UI construction ---
|
# --- UI construction ---
|
||||||
|
|
||||||
@@ -399,7 +397,6 @@ class SettingsDialog:
|
|||||||
f = self._tab_frame(nb, "Logging")
|
f = self._tab_frame(nb, "Logging")
|
||||||
_add_label_check(f, 0, "Enable Logging", self.var_enable_logging)
|
_add_label_check(f, 0, "Enable Logging", self.var_enable_logging)
|
||||||
_add_label_spinbox(f, 1, "Log Retention (days)", self.var_log_retention_days, 1, 365)
|
_add_label_spinbox(f, 1, "Log Retention (days)", self.var_log_retention_days, 1, 365)
|
||||||
_add_label_check(f, 2, "Colorize console output", self.var_colorize)
|
|
||||||
|
|
||||||
# --- Validation helpers ---
|
# --- Validation helpers ---
|
||||||
|
|
||||||
@@ -470,7 +467,6 @@ class SettingsDialog:
|
|||||||
"ENABLE_LOGGING": "true" if self.var_enable_logging.get() else "false",
|
"ENABLE_LOGGING": "true" if self.var_enable_logging.get() else "false",
|
||||||
"LOG_FILE": self.var_log_file.get().strip(),
|
"LOG_FILE": self.var_log_file.get().strip(),
|
||||||
"LOG_RETENTION_DAYS": str(int_values["Log Retention Days"]),
|
"LOG_RETENTION_DAYS": str(int_values["Log Retention Days"]),
|
||||||
"COLORIZE": "true" if self.var_colorize.get() else "false",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user