fumis 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
fumis/__init__.py ADDED
@@ -0,0 +1,58 @@
1
+ """Asynchronous Python client for the Fumis WiRCU API."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from .const import StoveModelInfo, StoveStatus
6
+ from .exceptions import (
7
+ FumisAuthenticationError,
8
+ FumisConnectionError,
9
+ FumisConnectionTimeoutError,
10
+ FumisError,
11
+ FumisResponseError,
12
+ FumisStoveOfflineError,
13
+ )
14
+ from .fumis import Fumis
15
+ from .models import (
16
+ Antifreeze,
17
+ Controller,
18
+ Diagnostic,
19
+ DiagnosticItem,
20
+ EcoMode,
21
+ Fan,
22
+ Fuel,
23
+ Hybrid,
24
+ Info,
25
+ Power,
26
+ Statistic,
27
+ Temperature,
28
+ TimerProgram,
29
+ Unit,
30
+ WeekSchedule,
31
+ )
32
+
33
+ __all__ = [
34
+ "Antifreeze",
35
+ "Controller",
36
+ "Diagnostic",
37
+ "DiagnosticItem",
38
+ "EcoMode",
39
+ "Fan",
40
+ "Fuel",
41
+ "Fumis",
42
+ "FumisAuthenticationError",
43
+ "FumisConnectionError",
44
+ "FumisConnectionTimeoutError",
45
+ "FumisError",
46
+ "FumisResponseError",
47
+ "FumisStoveOfflineError",
48
+ "Hybrid",
49
+ "Info",
50
+ "Power",
51
+ "Statistic",
52
+ "StoveModelInfo",
53
+ "StoveStatus",
54
+ "Temperature",
55
+ "TimerProgram",
56
+ "Unit",
57
+ "WeekSchedule",
58
+ ]
fumis/_cli.py ADDED
@@ -0,0 +1,36 @@
1
+ """Entry point shim for the optional Fumis CLI.
2
+
3
+ Kept as a standalone module so the console script remains importable
4
+ regardless of whether the ``cli`` extra is installed: if the CLI
5
+ dependencies (``typer``, ``rich``) are missing we raise a friendly
6
+ ``SystemExit`` with an install hint instead of a bare ``ImportError``.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ _CLI_EXTRA_MODULES = frozenset({"typer", "rich", "textual", "textual_plotext"})
12
+
13
+
14
+ def main() -> None:
15
+ """Invoke the Typer CLI with a graceful error if extras are missing."""
16
+ try:
17
+ # Deferred import so the console script remains importable even
18
+ # when the optional ``cli`` extra is not installed.
19
+ # pylint: disable-next=import-outside-toplevel
20
+ from fumis.cli import cli # noqa: PLC0415
21
+ except ModuleNotFoundError as err: # pragma: no cover
22
+ # Only convert to a friendly install hint when the *optional* deps
23
+ # are missing. Anything else (e.g. a renamed internal module) must
24
+ # still surface as a real error for debugging.
25
+ # pylint chokes on the type of ModuleNotFoundError.name, so silence
26
+ # the spurious no-member warning on the split() call below.
27
+ missing_module: str = err.name or ""
28
+ missing_root = missing_module.split(".", 1)[0] # pylint: disable=no-member
29
+ if missing_root not in _CLI_EXTRA_MODULES:
30
+ raise
31
+ msg = (
32
+ "The Fumis CLI requires the 'cli' extra. "
33
+ "Install it with: pip install 'fumis[cli]'"
34
+ )
35
+ raise SystemExit(msg) from err
36
+ cli()