Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 6 additions & 5 deletions python/PiFinder/sys_utils_nixos.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@
import zipfile
import logging
from pathlib import Path
from typing import Optional

import requests

import dbus
import pam
from PiFinder import utils

import gi

gi.require_version("NM", "1.0")
from gi.repository import GLib, NM

from PiFinder import utils
from gi.repository import GLib, NM # noqa: E402

BACKUP_PATH = str(utils.data_dir / "PiFinder_backup.zip")
AP_CONNECTION_NAME = "PiFinder-AP"
Expand Down Expand Up @@ -424,7 +425,7 @@ def shutdown() -> None:
UPGRADE_REF_FILE = Path("/run/pifinder/upgrade-ref")


def fetch_version_manifest() -> dict | None:
def fetch_version_manifest() -> Optional[dict]:
"""Fetch the channel/version manifest from GitHub."""
try:
resp = requests.get(VERSIONS_URL, timeout=10)
Expand Down Expand Up @@ -542,7 +543,7 @@ def switch_camera(cam_type: str) -> None:
Requires reboot (dtoverlay change).
"""
logger.info("SYS: Switching camera to %s via nixos-rebuild", cam_type)
flake_path = str(utils.pifinder_home)
flake_path = str(utils.home_dir / "PiFinder")
result = _run([
"sudo", "nixos-rebuild", "switch",
"--flake", f"{flake_path}#pifinder-{cam_type}",
Expand Down
4 changes: 4 additions & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ module = [
'picamera2',
'bottle',
'libinput',
'dbus',
'gi',
'gi.repository',
'gi.repository.*',
]
ignore_missing_imports = true
ignore_errors = true
Expand Down
Loading