Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b847e63
Fix: nested config dirs
HugoCLSC Jun 22, 2026
a884f0c
Merge remote-tracking branch 'origin/dev' into fix/symlink-mirror
HugoCLSC Jun 23, 2026
ac93331
Dev devt: del comments and logger for debug
HugoCLSC Jun 23, 2026
9e6cf30
Update BlocksScreen/tools/configuration_manager/configurator.py
HugoCLSC Jun 23, 2026
c80adee
Bug fix: Ignore beacon on merge, saved configs duplicatino
HugoCLSC Jun 24, 2026
b542273
Del: commented code
HugoCLSC Jun 24, 2026
68b4ce5
Fix: Only create symlinks and cpy files if they are actually diff
HugoCLSC Jun 24, 2026
565670d
Merge remote-tracking branch 'origin/fix/symlink-mirror' into fix/con…
HugoCLSC Jun 24, 2026
6c3231a
Merge remote-tracking branch 'origin/dev' into fix/configurator-saved…
HugoCLSC Jun 24, 2026
80c6629
Fix: src/target paths, nested dirs checking and file merging with no …
HugoCLSC Jun 24, 2026
8426262
Fix: sync on missing symlinks and diff cpy files
HugoCLSC Jun 24, 2026
131fbf6
Merge branch 'dev' into fix/configurator-saved-duplication
HugoCLSC Jun 24, 2026
5d574b4
Merge remote-tracking branch 'origin/fix/configurator-saved-duplicati…
HugoCLSC Jun 25, 2026
cae7648
Feat: auto add beacon serial path to configurations
HugoCLSC Jun 25, 2026
f21093d
ref: dev debt formatting
HugoCLSC Jun 25, 2026
c3b8dc7
Add DeviceDiscovery updater hook
HugoCLSC Sep 25, 2026
c8937b1
Device Discovery client and updater changes, UI coupling with Dev dis…
HugoCLSC Sep 25, 2026
753ed08
Updater package fetching and workflow
HugoCLSC Sep 25, 2026
64eb148
Merge origin/Release-2.0 into feat/device-discovery
HugoCLSC Sep 25, 2026
e16f6de
Document ID-final AMU matching and test it end to end
HugoCLSC Sep 25, 2026
11673e1
feat(devices): confirm AMU config before applying and fix discovery gaps
HugoCLSC Sep 28, 2026
32de247
Dev debt: changed BlocksScreen target branch
HugoCLSC Sep 30, 2026
d98691a
Dev debt: change RF50 configs target branch
HugoCLSC Oct 6, 2026
8408a6e
Add configuration manager to BlocksScreen initialization
HugoCLSC Oct 13, 2026
f13fddd
Merge remote-tracking branch 'origin/dev' into feat/device-discovery
gmmcosta15 Oct 14, 2026
77514cd
refactor(device-discovery): fold serial_scanner into serial_devices, …
gmmcosta15 Oct 14, 2026
fb03256
Merge remote-tracking branch 'origin/dev' into feat/device-discovery
gmmcosta15 Oct 14, 2026
779a83b
Fix updater target branches
HugoCLSC Oct 14, 2026
f727e27
Merge branch 'dev' into feat/device-discovery
gmmcosta15 Oct 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 35 additions & 5 deletions BlocksScreen/BlocksScreen.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from lib.panels.mainWindow import MainWindow # noqa: E402
from logger import CrashHandler, LogManager, install_crash_handler, setup_logging
from PyQt6 import QtCore, QtGui, QtWidgets # noqa: E402
from tools.configuration_manager import ConfigManager
from tools.configuration_manager import DeviceConfigManager, DeviceConfigWatcher

install_crash_handler()

Expand Down Expand Up @@ -166,12 +166,17 @@ def on_quit() -> None:
LogManager.shutdown()


conf_man: DeviceConfigManager | None = None
device_watcher: DeviceConfigWatcher | None = None


def initialize_conf_manager() -> None:
global conf_man
try:
conf_man = ConfigManager(get_configparser())
logging.info("[DeviceConfigManager] Initializing...")
conf_man = DeviceConfigManager(get_configparser())
except Exception as e:
_logger.error(
logging.error(
"Caught Exception on configuration_manager tool: %s" % e, exc_info=True
)

Expand Down Expand Up @@ -294,24 +299,49 @@ def eventFilter(self, a0: QtCore.QObject | None, a1: QtCore.QEvent | None) -> bo
if __name__ == "__main__":
setup_logging(
filename="logs/BlocksScreen.log",
level=logging.DEBUG,
level=logging.INFO,
console_output=True,
console_level=logging.DEBUG,
console_level=logging.INFO,
capture_stderr=True,
capture_stdout=False,
)
_logger = logging.getLogger(__name__)
_logger.info("============ BlocksScreen Initializing ============")

initialize_conf_manager()
BlocksScreen = BlocksScreenApp([])
BlocksScreen.setApplicationName("BlocksScreen")
BlocksScreen.setApplicationDisplayName("BlocksScreen")
BlocksScreen.setDesktopFileName("BlocksScreen")
_splash = show_splash()
main_window = MainWindow()

if conf_man is not None:
if conf_man.boot_changed:
# Klipper may have started before the boot sync rewrote
# printer.cfg; restarted once Moonraker is up and no job runs.
main_window.request_klipper_restart()
# Live side of the device templates: printer.cfg follows devices
# plugged in while running (after the user's OK for templates that
# ask for it), and Klipper is restarted to load it.
# Optional: without it the screen works as before, just no hotplug.
try:
_logger.info("[DEVICE WATCHER] Initializing...")
device_watcher = DeviceConfigWatcher(conf_man, parent=main_window)
device_watcher.config_changed.connect(main_window.on_device_config_changed)
device_watcher.confirmation_required.connect(
main_window.on_device_confirmation_required
)
main_window.device_config_accepted.connect(device_watcher.accept)
main_window.device_config_declined.connect(device_watcher.decline)
device_watcher.start()
BlocksScreen.aboutToQuit.connect(device_watcher.stop)
except Exception as e: # noqa: BLE001
_logger.error("Device hotplug disabled: %s", e, exc_info=True)
BlocksScreen.processEvents()
BlocksScreen.aboutToQuit.connect(on_quit)
_setup_sigterm(BlocksScreen)

# Event-driven repaint: fire the moment the window first paints (parented to
# main_window so it lives as long as the window).
_FirstPaintRefresh(main_window)
Expand Down
13 changes: 13 additions & 0 deletions BlocksScreen/devices/discovery/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Client side of the device discovery service.

The daemon itself lives in the separate DeviceDiscovery repo and runs as
device-discoveryd.service; this package only talks to its Unix socket.

- `DeviceDiscoveryClient`: long-lived Qt client (snapshot + hotplug signals)
- `fetch_snapshot`: one-shot blocking query, no Qt event loop needed
- `serial_devices.SerialScanner`: daemon scan with a /dev/serial/by-id fallback
"""

from .client import DeviceDiscoveryClient, default_socket_path, fetch_snapshot

__all__ = ["DeviceDiscoveryClient", "default_socket_path", "fetch_snapshot"]
Loading