mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-26 17:23:35 +05:00
refactor(KIAUH): use util functions for Klipper and Moonraker to get their status
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -11,20 +11,32 @@
|
||||
|
||||
import os
|
||||
import shutil
|
||||
from typing import List, Dict
|
||||
from typing import Dict, Literal
|
||||
|
||||
from kiauh.core.config_manager.config_manager import ConfigManager
|
||||
from kiauh.modules.moonraker import (
|
||||
DEFAULT_MOONRAKER_PORT,
|
||||
MODULE_PATH,
|
||||
MOONRAKER_DIR,
|
||||
MOONRAKER_ENV_DIR,
|
||||
)
|
||||
from kiauh.modules.moonraker.moonraker import Moonraker
|
||||
from kiauh.utils.common import get_install_status_common, get_repo_name
|
||||
from kiauh.utils.logger import Logger
|
||||
from kiauh.utils.system_utils import (
|
||||
get_ipv4_addr,
|
||||
)
|
||||
|
||||
|
||||
def get_moonraker_status() -> Dict[Literal["status", "repo"], str]:
|
||||
return {
|
||||
"status": get_install_status_common(
|
||||
Moonraker, MOONRAKER_DIR, MOONRAKER_ENV_DIR
|
||||
),
|
||||
"repo": get_repo_name(MOONRAKER_DIR),
|
||||
}
|
||||
|
||||
|
||||
def create_example_moonraker_conf(
|
||||
instance: Moonraker, ports_map: Dict[str, int]
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user