components: correct imports
All imports must now be relative to work correctly with the moonraker parent package. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
b9a17e07e9
commit
0f8638fec7
|
@ -21,10 +21,10 @@ from typing import (
|
|||
Union
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from http_client import HttpClient
|
||||
from components.database import MoonrakerDatabase
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest
|
||||
from .http_client import HttpClient
|
||||
from .database import MoonrakerDatabase
|
||||
|
||||
|
||||
MOONLIGHT_URL = "https://arksine.github.io/moonlight"
|
||||
|
|
|
@ -34,8 +34,8 @@ from typing import (
|
|||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest, WebsocketManager
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest, WebsocketManager
|
||||
from tornado.httputil import HTTPServerRequest
|
||||
from tornado.web import RequestHandler
|
||||
from .database import MoonrakerDatabase as DBComp
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
from __future__ import annotations
|
||||
import asyncio
|
||||
import logging
|
||||
from confighelper import SentinelClass
|
||||
from ..confighelper import SentinelClass
|
||||
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
|
@ -14,9 +14,9 @@ from typing import (
|
|||
Dict
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from ..confighelper import ConfigHelper
|
||||
from .gpio import GpioFactory
|
||||
from app import InternalTransport as ITransport
|
||||
from ..app import InternalTransport as ITransport
|
||||
|
||||
SENTINEL = SentinelClass.get_instance()
|
||||
|
||||
|
|
|
@ -20,10 +20,9 @@ from typing import (
|
|||
Deque,
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from . import klippy_apis
|
||||
APIComp = klippy_apis.KlippyAPI
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest
|
||||
from .klippy_apis import KlippyAPI as APIComp
|
||||
GCQueue = Deque[Dict[str, Any]]
|
||||
TempStore = Dict[str, Dict[str, Deque[float]]]
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ from io import BytesIO
|
|||
from functools import reduce
|
||||
from threading import Lock as ThreadLock
|
||||
import lmdb
|
||||
from utils import SentinelClass, ServerError
|
||||
from ..utils import SentinelClass, ServerError
|
||||
|
||||
# Annotation imports
|
||||
from typing import (
|
||||
|
@ -33,8 +33,8 @@ from typing import (
|
|||
cast
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest
|
||||
DBRecord = Union[int, float, bool, str, List[Any], Dict[str, Any]]
|
||||
DBType = Optional[DBRecord]
|
||||
_T = TypeVar("_T")
|
||||
|
|
|
@ -20,7 +20,7 @@ from typing import (
|
|||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from ..confighelper import ConfigHelper
|
||||
|
||||
STAT_PATH = "/proc/self/stat"
|
||||
DOC_URL = (
|
||||
|
|
|
@ -8,8 +8,8 @@ import asyncio
|
|||
import pathlib
|
||||
import logging
|
||||
import json
|
||||
from websockets import BaseSocketClient
|
||||
from utils import get_unix_peer_credentials
|
||||
from ..websockets import BaseSocketClient
|
||||
from ..utils import get_unix_peer_credentials
|
||||
|
||||
# Annotation imports
|
||||
from typing import (
|
||||
|
@ -22,10 +22,10 @@ from typing import (
|
|||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from moonraker import Server
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from klippy_connection import KlippyConnection as Klippy
|
||||
from ..server import Server
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest
|
||||
from ..klippy_connection import KlippyConnection as Klippy
|
||||
|
||||
UNIX_BUFFER_LIMIT = 20 * 1024 * 1024
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ from . import file_manager as fm
|
|||
|
||||
from typing import TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from ...confighelper import ConfigHelper
|
||||
|
||||
def load_component(config: ConfigHelper) -> fm.FileManager:
|
||||
return fm.load_component(config)
|
||||
|
|
|
@ -18,7 +18,7 @@ import time
|
|||
from copy import deepcopy
|
||||
from inotify_simple import INotify
|
||||
from inotify_simple import flags as iFlags
|
||||
from utils import MOONRAKER_PATH
|
||||
from ...utils import MOONRAKER_PATH
|
||||
|
||||
# Annotation imports
|
||||
from typing import (
|
||||
|
@ -40,14 +40,14 @@ from typing import (
|
|||
|
||||
if TYPE_CHECKING:
|
||||
from inotify_simple import Event as InotifyEvent
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from klippy_connection import KlippyConnection
|
||||
from components import database
|
||||
from components import klippy_apis
|
||||
from components import shell_command
|
||||
from components.job_queue import JobQueue
|
||||
from components.job_state import JobState
|
||||
from ...confighelper import ConfigHelper
|
||||
from ...websockets import WebRequest
|
||||
from ...klippy_connection import KlippyConnection
|
||||
from .. import database
|
||||
from .. import klippy_apis
|
||||
from .. import shell_command
|
||||
from ..job_queue import JobQueue
|
||||
from ..job_state import JobState
|
||||
StrOrPath = Union[str, pathlib.Path]
|
||||
DBComp = database.MoonrakerDatabase
|
||||
APIComp = klippy_apis.KlippyAPI
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# This file may be distributed under the terms of the GNU GPLv3 license.
|
||||
from __future__ import annotations
|
||||
import logging
|
||||
from utils import load_system_module
|
||||
from ..utils import load_system_module
|
||||
|
||||
# Annotation imports
|
||||
from typing import (
|
||||
|
@ -18,8 +18,8 @@ from typing import (
|
|||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from eventloop import EventLoop
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..eventloop import EventLoop
|
||||
GPIO_CALLBACK = Callable[[float, float, int], Optional[Awaitable[None]]]
|
||||
|
||||
class GpioFactory:
|
||||
|
@ -267,7 +267,7 @@ class GpioEvent(GpioBase):
|
|||
self.error_count = 0
|
||||
ret = self.callback(eventtime, evt_duration, self.value)
|
||||
if ret is not None:
|
||||
self.event_loop.create_task(ret)
|
||||
self.event_loop.create_task(ret) # type: ignore
|
||||
|
||||
def _increment_error(self, eventtime: float) -> None:
|
||||
if eventtime - self.last_error_reset > ERROR_RESET_TIME:
|
||||
|
|
|
@ -17,8 +17,8 @@ from typing import (
|
|||
List,
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest
|
||||
from .database import MoonrakerDatabase as DBComp
|
||||
from .job_state import JobState
|
||||
from .file_manager.file_manager import FileManager
|
||||
|
|
|
@ -12,7 +12,7 @@ import asyncio
|
|||
import pathlib
|
||||
import tempfile
|
||||
import logging
|
||||
from utils import ServerError
|
||||
from ..utils import ServerError
|
||||
from tornado.escape import url_escape, url_unescape
|
||||
from tornado.httpclient import AsyncHTTPClient, HTTPRequest, HTTPError
|
||||
from tornado.httputil import HTTPHeaders
|
||||
|
@ -27,8 +27,8 @@ from typing import (
|
|||
Any
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from server import Server
|
||||
from confighelper import ConfigHelper
|
||||
from ..server import Server
|
||||
from ..confighelper import ConfigHelper
|
||||
from io import BufferedWriter
|
||||
StrOrPath = Union[str, pathlib.Path]
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ from typing import (
|
|||
Union,
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest
|
||||
from .klippy_apis import KlippyAPI
|
||||
from .file_manager.file_manager import FileManager
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ from typing import (
|
|||
List,
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from ..confighelper import ConfigHelper
|
||||
from .klippy_apis import KlippyAPI
|
||||
|
||||
class JobState:
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
# This file may be distributed under the terms of the GNU GPLv3 license.
|
||||
|
||||
from __future__ import annotations
|
||||
from utils import SentinelClass
|
||||
from websockets import WebRequest, Subscribable
|
||||
from ..utils import SentinelClass
|
||||
from ..websockets import WebRequest, Subscribable
|
||||
|
||||
# Annotation imports
|
||||
from typing import (
|
||||
|
@ -20,9 +20,9 @@ from typing import (
|
|||
Mapping,
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from klippy_connection import KlippyConnection as Klippy
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest
|
||||
from ..klippy_connection import KlippyConnection as Klippy
|
||||
Subscription = Dict[str, Optional[List[Any]]]
|
||||
_T = TypeVar("_T")
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ from typing import (
|
|||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from ..confighelper import ConfigHelper
|
||||
from ldap3.abstract.entry import Entry
|
||||
|
||||
class MoonrakerLDAP:
|
||||
|
|
|
@ -21,8 +21,8 @@ import distro
|
|||
import tempfile
|
||||
import getpass
|
||||
import configparser
|
||||
from confighelper import FileSourceWrapper
|
||||
from utils import MOONRAKER_PATH
|
||||
from ..confighelper import FileSourceWrapper
|
||||
from ..utils import MOONRAKER_PATH
|
||||
|
||||
# Annotation imports
|
||||
from typing import (
|
||||
|
@ -39,10 +39,10 @@ from typing import (
|
|||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from app import MoonrakerApp
|
||||
from klippy_connection import KlippyConnection
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest
|
||||
from ..app import MoonrakerApp
|
||||
from ..klippy_connection import KlippyConnection
|
||||
from .shell_command import ShellCommandFactory as SCMDComp
|
||||
from .database import MoonrakerDatabase
|
||||
from .file_manager.file_manager import FileManager
|
||||
|
|
|
@ -13,7 +13,7 @@ import pathlib
|
|||
import ssl
|
||||
from collections import deque
|
||||
import paho.mqtt.client as paho_mqtt
|
||||
from websockets import Subscribable, WebRequest, JsonRPC, APITransport
|
||||
from ..websockets import Subscribable, WebRequest, JsonRPC, APITransport
|
||||
|
||||
# Annotation imports
|
||||
from typing import (
|
||||
|
@ -30,9 +30,9 @@ from typing import (
|
|||
Deque,
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from app import APIDefinition
|
||||
from confighelper import ConfigHelper
|
||||
from klippy_connection import KlippyConnection as Klippy
|
||||
from ..app import APIDefinition
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..klippy_connection import KlippyConnection as Klippy
|
||||
FlexCallback = Callable[[bytes], Optional[Coroutine]]
|
||||
RPCCallback = Callable[..., Coroutine]
|
||||
|
||||
|
|
|
@ -12,22 +12,16 @@ import logging
|
|||
# Annotation imports
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
Type,
|
||||
Optional,
|
||||
Dict,
|
||||
Any,
|
||||
List,
|
||||
Union,
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest
|
||||
from .http_client import HttpClient
|
||||
from . import klippy_apis
|
||||
|
||||
APIComp = klippy_apis.KlippyAPI
|
||||
|
||||
from .klippy_apis import KlippyAPI as APIComp
|
||||
|
||||
class Notifier:
|
||||
def __init__(self, config: ConfigHelper) -> None:
|
||||
|
|
|
@ -15,8 +15,8 @@ from typing import (
|
|||
List,
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest
|
||||
from .klippy_apis import KlippyAPI as APIComp
|
||||
from .file_manager.file_manager import FileManager
|
||||
from .job_queue import JobQueue
|
||||
|
|
|
@ -13,7 +13,7 @@ import errno
|
|||
import logging
|
||||
import asyncio
|
||||
from collections import deque
|
||||
from utils import ServerError
|
||||
from ..utils import ServerError
|
||||
|
||||
# Annotation imports
|
||||
from typing import (
|
||||
|
@ -28,11 +28,9 @@ from typing import (
|
|||
Coroutine,
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from . import klippy_apis
|
||||
from .file_manager import file_manager
|
||||
APIComp = klippy_apis.KlippyAPI
|
||||
FMComp = file_manager.FileManager
|
||||
from ..confighelper import ConfigHelper
|
||||
from .klippy_apis import KlippyAPI as APIComp
|
||||
from .file_manager.file_manager import FileManager as FMComp
|
||||
FlexCallback = Callable[..., Optional[Coroutine]]
|
||||
|
||||
MIN_EST_TIME = 10.
|
||||
|
|
|
@ -27,15 +27,14 @@ from typing import (
|
|||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest
|
||||
from .machine import Machine
|
||||
from . import klippy_apis
|
||||
from .klippy_apis import KlippyAPI as APIComp
|
||||
from .mqtt import MQTTClient
|
||||
from .template import JinjaTemplate
|
||||
from .http_client import HttpClient
|
||||
from klippy_connection import KlippyConnection
|
||||
APIComp = klippy_apis.KlippyAPI
|
||||
|
||||
class PrinterPower:
|
||||
def __init__(self, config: ConfigHelper) -> None:
|
||||
|
|
|
@ -26,8 +26,8 @@ from typing import (
|
|||
Dict,
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest, WebsocketManager
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest, WebsocketManager
|
||||
from . import shell_command
|
||||
STAT_CALLBACK = Callable[[int], Optional[Awaitable]]
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ from typing import (
|
|||
Any
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from ..confighelper import ConfigHelper
|
||||
from .file_manager.file_manager import FileManager
|
||||
|
||||
class Secrets:
|
||||
|
|
|
@ -27,8 +27,9 @@ from typing import (
|
|||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest
|
||||
from .mqtt import MQTTClient
|
||||
|
||||
SENSOR_UPDATE_TIME = 1.0
|
||||
SENSOR_EVENT_NAME = "sensors:sensor_update"
|
||||
|
@ -42,12 +43,6 @@ class SensorConfiguration:
|
|||
source: str = ""
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
|
||||
from .mqtt import MQTTClient
|
||||
|
||||
|
||||
def _set_result(
|
||||
name: str, value: Union[int, float], store: Dict[str, Union[int, float]]
|
||||
) -> None:
|
||||
|
|
|
@ -10,7 +10,7 @@ import shlex
|
|||
import logging
|
||||
import signal
|
||||
import asyncio
|
||||
from utils import ServerError
|
||||
from ..utils import ServerError
|
||||
|
||||
# Annotation imports
|
||||
from typing import (
|
||||
|
@ -24,7 +24,7 @@ from typing import (
|
|||
Set,
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from ..confighelper import ConfigHelper
|
||||
OutputCallback = Optional[Callable[[bytes], None]]
|
||||
|
||||
class ShellCommandError(ServerError):
|
||||
|
|
|
@ -14,7 +14,7 @@ import pathlib
|
|||
import base64
|
||||
import tornado.websocket
|
||||
from tornado.escape import url_escape
|
||||
from websockets import Subscribable, WebRequest
|
||||
from ..websockets import Subscribable, WebRequest
|
||||
|
||||
import logging.handlers
|
||||
import tempfile
|
||||
|
@ -31,20 +31,20 @@ from typing import (
|
|||
Any,
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from app import InternalTransport
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebsocketManager, BaseSocketClient
|
||||
from ..app import InternalTransport
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebsocketManager, BaseSocketClient
|
||||
from tornado.websocket import WebSocketClientConnection
|
||||
from components.database import MoonrakerDatabase
|
||||
from components.klippy_apis import KlippyAPI
|
||||
from components.job_state import JobState
|
||||
from components.machine import Machine
|
||||
from components.file_manager.file_manager import FileManager
|
||||
from components.http_client import HttpClient
|
||||
from components.power import PrinterPower
|
||||
from components.announcements import Announcements
|
||||
from components.webcam import WebcamManager, WebCam
|
||||
from klippy_connection import KlippyConnection
|
||||
from .database import MoonrakerDatabase
|
||||
from .klippy_apis import KlippyAPI
|
||||
from .job_state import JobState
|
||||
from .machine import Machine
|
||||
from .file_manager.file_manager import FileManager
|
||||
from .http_client import HttpClient
|
||||
from .power import PrinterPower
|
||||
from .announcements import Announcements
|
||||
from .webcam import WebcamManager, WebCam
|
||||
from ..klippy_connection import KlippyConnection
|
||||
|
||||
COMPONENT_VERSION = "0.0.1"
|
||||
SP_VERSION = "0.1"
|
||||
|
|
|
@ -17,8 +17,8 @@ from typing import (
|
|||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from server import Server
|
||||
from confighelper import ConfigHelper
|
||||
from ..server import Server
|
||||
from ..confighelper import ConfigHelper
|
||||
from .secrets import Secrets
|
||||
|
||||
class TemplateFactory:
|
||||
|
|
|
@ -9,7 +9,7 @@ from . import update_manager as um
|
|||
|
||||
from typing import TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from ...confighelper import ConfigHelper
|
||||
|
||||
def load_component(config: ConfigHelper) -> um.UpdateManager:
|
||||
return um.load_component(config)
|
||||
|
|
|
@ -24,7 +24,7 @@ from typing import (
|
|||
Tuple
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from ...confighelper import ConfigHelper
|
||||
from .update_manager import CommandHelper
|
||||
from ..machine import Machine
|
||||
from ..file_manager.file_manager import FileManager
|
||||
|
|
|
@ -8,15 +8,15 @@ from __future__ import annotations
|
|||
import os
|
||||
import sys
|
||||
import copy
|
||||
from utils import MOONRAKER_PATH
|
||||
from ...utils import MOONRAKER_PATH
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
Dict
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from components.database import MoonrakerDatabase
|
||||
from ...confighelper import ConfigHelper
|
||||
from ..database import MoonrakerDatabase
|
||||
|
||||
KLIPPER_DEFAULT_PATH = os.path.expanduser("~/klipper")
|
||||
KLIPPER_DEFAULT_EXEC = os.path.expanduser("~/klippy-env/bin/python")
|
||||
|
|
|
@ -10,8 +10,8 @@ import time
|
|||
|
||||
from typing import TYPE_CHECKING, Dict, Any, Optional
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from utils import ServerError
|
||||
from ...confighelper import ConfigHelper
|
||||
from ...utils import ServerError
|
||||
from .update_manager import CommandHelper
|
||||
|
||||
class BaseDeploy:
|
||||
|
|
|
@ -23,8 +23,8 @@ from typing import (
|
|||
List,
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from components import shell_command
|
||||
from ...confighelper import ConfigHelper
|
||||
from ...components import shell_command
|
||||
from .update_manager import CommandHelper
|
||||
from ..http_client import HttpClient
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import zipfile
|
|||
import time
|
||||
import tempfile
|
||||
import re
|
||||
from thirdparty.packagekit import enums as PkEnum
|
||||
from ...thirdparty.packagekit import enums as PkEnum
|
||||
from . import base_config
|
||||
from .base_deploy import BaseDeploy
|
||||
from .app_deploy import AppDeploy
|
||||
|
@ -37,18 +37,18 @@ from typing import (
|
|||
cast
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from server import Server
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from klippy_connection import KlippyConnection
|
||||
from components.shell_command import ShellCommandFactory as SCMDComp
|
||||
from components.database import MoonrakerDatabase as DBComp
|
||||
from components.database import NamespaceWrapper
|
||||
from components.dbus_manager import DbusManager
|
||||
from components.machine import Machine
|
||||
from components.http_client import HttpClient
|
||||
from components.file_manager.file_manager import FileManager
|
||||
from eventloop import FlexTimer
|
||||
from ...server import Server
|
||||
from ...confighelper import ConfigHelper
|
||||
from ...websockets import WebRequest
|
||||
from ...klippy_connection import KlippyConnection
|
||||
from ..shell_command import ShellCommandFactory as SCMDComp
|
||||
from ..database import MoonrakerDatabase as DBComp
|
||||
from ..database import NamespaceWrapper
|
||||
from ..dbus_manager import DbusManager
|
||||
from ..machine import Machine
|
||||
from ..http_client import HttpClient
|
||||
from ..file_manager.file_manager import FileManager
|
||||
from ...eventloop import FlexTimer
|
||||
from dbus_next import Variant
|
||||
from dbus_next.aio import ProxyInterface
|
||||
JsonType = Union[List[Any], Dict[str, Any]]
|
||||
|
|
|
@ -13,7 +13,7 @@ import re
|
|||
import time
|
||||
import zipfile
|
||||
from .app_deploy import AppDeploy
|
||||
from utils import verify_source
|
||||
from ...utils import verify_source
|
||||
|
||||
# Annotation imports
|
||||
from typing import (
|
||||
|
@ -25,7 +25,7 @@ from typing import (
|
|||
List,
|
||||
)
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from ...confighelper import ConfigHelper
|
||||
from .update_manager import CommandHelper
|
||||
|
||||
RINFO_KEYS = [
|
||||
|
|
|
@ -20,9 +20,9 @@ from typing import (
|
|||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from server import Server
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from ..server import Server
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest
|
||||
from .database import MoonrakerDatabase
|
||||
from .machine import Machine
|
||||
from .shell_command import ShellCommandFactory
|
||||
|
|
|
@ -28,10 +28,8 @@ from typing import (
|
|||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from websockets import WebRequest
|
||||
from . import klippy_apis
|
||||
APIComp = klippy_apis.KlippyAPI
|
||||
from ..confighelper import ConfigHelper
|
||||
from ..websockets import WebRequest
|
||||
|
||||
class OnOff(str, Enum):
|
||||
on: str = "on"
|
||||
|
@ -447,9 +445,15 @@ class WLED:
|
|||
# Full control of wled
|
||||
# state: True, False, "on", "off"
|
||||
# preset: wled preset (int) to use (ignored if state False or "Off")
|
||||
async def set_wled_state(self: WLED, strip: str, state: str = None,
|
||||
preset: int = -1, brightness: int = -1,
|
||||
intensity: int = -1, speed: int = -1) -> None:
|
||||
async def set_wled_state(
|
||||
self: WLED,
|
||||
strip: str,
|
||||
state: Optional[str] = None,
|
||||
preset: int = -1,
|
||||
brightness: int = -1,
|
||||
intensity: int = -1,
|
||||
speed: int = -1
|
||||
) -> None:
|
||||
status = None
|
||||
|
||||
if isinstance(state, bool):
|
||||
|
|
|
@ -14,7 +14,7 @@ from zeroconf.asyncio import AsyncServiceInfo, AsyncZeroconf
|
|||
from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from confighelper import ConfigHelper
|
||||
from ..confighelper import ConfigHelper
|
||||
from .machine import Machine
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue