python-izone 1.3.4__py3-none-any.whl → 1.3.6__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.
- pizone/__init__.py +49 -10
- pizone/const.py +4 -0
- pizone/controller.py +445 -171
- pizone/discovery.py +552 -54
- pizone/exceptions.py +19 -0
- pizone/power.py +29 -19
- pizone/types.py +11 -0
- pizone/version.py +2 -2
- pizone/zone.py +25 -13
- {python_izone-1.3.4.dist-info → python_izone-1.3.6.dist-info}/METADATA +3 -2
- python_izone-1.3.6.dist-info/RECORD +14 -0
- python_izone-1.3.4.dist-info/RECORD +0 -12
- {python_izone-1.3.4.dist-info → python_izone-1.3.6.dist-info}/WHEEL +0 -0
- {python_izone-1.3.4.dist-info → python_izone-1.3.6.dist-info}/licenses/licence.txt +0 -0
pizone/__init__.py
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"""Interface to the iZone air conditioner controller.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
:
|
|
3
|
+
Prefer :func:`~pizone.discovery.create_discovery` or
|
|
4
|
+
:func:`~pizone.discovery.discovery` to obtain a discovery service, then create
|
|
5
|
+
or discover :class:`~pizone.controller.Controller` instances through that
|
|
6
|
+
service. Zones and power monitors are owned by their controller.
|
|
5
7
|
|
|
6
8
|
Synchronous property reads return cached device data and do not raise
|
|
7
9
|
:exc:`ConnectionError`. Async command and refresh methods perform HTTP I/O and
|
|
@@ -14,25 +16,62 @@ Layered connection state on :class:`~pizone.controller.Controller`:
|
|
|
14
16
|
- :attr:`~pizone.controller.Controller.bridge_connected` — ASH bridge HTTP transport
|
|
15
17
|
- :attr:`~pizone.controller.Controller.connected` — bridge plus valid iZone AC data
|
|
16
18
|
- :attr:`~pizone.power.Power.connected` — power monitor I/O (when enabled)
|
|
19
|
+
|
|
20
|
+
Power support is off by default. Enable at runtime before create/refresh when
|
|
21
|
+
the consumer needs iPower (for example future Home Assistant power entities)::
|
|
22
|
+
|
|
23
|
+
import pizone
|
|
24
|
+
pizone.ENABLE_POWER = True
|
|
17
25
|
"""
|
|
18
26
|
|
|
27
|
+
import sys
|
|
28
|
+
from types import ModuleType
|
|
29
|
+
from typing import Any
|
|
30
|
+
|
|
31
|
+
from . import power as power_mod
|
|
19
32
|
from .controller import Controller
|
|
20
|
-
from .discovery import DiscoveryService, Listener, discovery
|
|
21
|
-
from .exceptions import ControllerCommandError, ResponseDecodeError
|
|
33
|
+
from .discovery import DiscoveryService, Listener, create_discovery, discovery
|
|
34
|
+
from .exceptions import ControllerCommandError, ResponseDecodeError, UnpairedBridgeError
|
|
22
35
|
from .power import BatteryLevel, Power, PowerChannel, PowerDevice, PowerGroup
|
|
36
|
+
from .types import ControllerEndpoint
|
|
23
37
|
from .zone import Zone
|
|
24
38
|
|
|
39
|
+
|
|
40
|
+
def __getattr__(name: str) -> Any:
|
|
41
|
+
if name == "ENABLE_POWER":
|
|
42
|
+
return power_mod.ENABLE_POWER
|
|
43
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class _PizoneModule(ModuleType):
|
|
47
|
+
"""Allow ``pizone.ENABLE_POWER = True`` to update :mod:`pizone.power`."""
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def ENABLE_POWER(self) -> bool:
|
|
51
|
+
return power_mod.ENABLE_POWER
|
|
52
|
+
|
|
53
|
+
@ENABLE_POWER.setter
|
|
54
|
+
def ENABLE_POWER(self, value: bool) -> None:
|
|
55
|
+
power_mod.ENABLE_POWER = bool(value)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
sys.modules[__name__].__class__ = _PizoneModule
|
|
59
|
+
|
|
25
60
|
__all__ = [
|
|
61
|
+
"ENABLE_POWER",
|
|
62
|
+
"BatteryLevel",
|
|
26
63
|
"Controller",
|
|
27
64
|
"ControllerCommandError",
|
|
28
|
-
"
|
|
29
|
-
"Zone",
|
|
65
|
+
"ControllerEndpoint",
|
|
30
66
|
"DiscoveryService",
|
|
31
67
|
"Listener",
|
|
32
|
-
"discovery",
|
|
33
68
|
"Power",
|
|
34
|
-
"PowerGroup",
|
|
35
|
-
"PowerDevice",
|
|
36
69
|
"PowerChannel",
|
|
37
|
-
"
|
|
70
|
+
"PowerDevice",
|
|
71
|
+
"PowerGroup",
|
|
72
|
+
"ResponseDecodeError",
|
|
73
|
+
"UnpairedBridgeError",
|
|
74
|
+
"Zone",
|
|
75
|
+
"create_discovery",
|
|
76
|
+
"discovery",
|
|
38
77
|
]
|
pizone/const.py
ADDED