Compare commits

..

2 Commits

Author SHA1 Message Date
dw-0
c8f713c00e fix: no validation of optional_speedups option
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
2025-04-12 00:36:34 +02:00
Pavel Sorejs
95cf809378 feat: add option to customize python binary for Klipper and Moonraker, add option to not install Moonraker speedups (#671)
Add option to cusomize python binary for klipper and moonraker. Add option to not install moonraker speedups.
2025-04-06 22:23:39 +02:00
2 changed files with 16 additions and 5 deletions

View File

@@ -13,6 +13,10 @@ repositories:
https://github.com/Klipper3d/klipper
[moonraker]
# Moonraker supports two optional Python packages that can be used to reduce its CPU load
# If set to true, those packages will be installed during the Moonraker installation
optional_speedups: True
# add custom repositories here, if at least one is given, the first in the list will be used by default
# otherwise the official repository is used
#

View File

@@ -53,17 +53,20 @@ class Repository:
url: str
branch: str
@dataclass
class KlipperSettings:
repositories: List[Repository] | None = field(default=None)
use_python_binary: str | None = field(default=None)
@dataclass
class MoonrakerSettings:
optional_speedups: bool | None = field(default=None)
repositories: List[Repository] | None = field(default=None)
use_python_binary: str | None = field(default=None)
@dataclass
class WebUiSettings:
port: int | None = field(default=None)
@@ -158,8 +161,6 @@ class KiauhSettings:
self._validate_int("fluidd", "port")
self._validate_bool("fluidd", "unstable_releases")
self._validate_bool("moonraker", "optional_speedups")
except ValueError:
err = f"Invalid value for option '{self._v_option}' in section '{self._v_section}'"
@@ -215,7 +216,9 @@ class KiauhSettings:
"kiauh", "backup_before_update"
)
self.moonraker.optional_speedups = self.config.getboolean("moonraker", "optional_speedups", True)
self.moonraker.optional_speedups = self.config.getboolean(
"moonraker", "optional_speedups", True
)
kl_repos = self.config.getval("klipper", "repositories")
self.klipper.repositories = self.__set_repo_state(kl_repos)
@@ -223,8 +226,12 @@ class KiauhSettings:
mr_repos = self.config.getval("moonraker", "repositories")
self.moonraker.repositories = self.__set_repo_state(mr_repos)
self.klipper.use_python_binary = self.config.getval("klipper", "use_python_binary", None)
self.moonraker.use_python_binary = self.config.getval("moonraker", "use_python_binary", None)
self.klipper.use_python_binary = self.config.getval(
"klipper", "use_python_binary", None
)
self.moonraker.use_python_binary = self.config.getval(
"moonraker", "use_python_binary", None
)
self.mainsail.port = self.config.getint("mainsail", "port")
self.mainsail.unstable_releases = self.config.getboolean(