python-daikin-itm 0.1.0__tar.gz → 0.1.1__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-daikin-itm
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Asynchronous Python client for the Daikin intelligent Touch Manager (iTM).
5
5
  Keywords: async,client,daikin,itm,intelligent touch manager,hvac
6
6
  Author: Robbin Janssen, Robin Mulder
@@ -52,8 +52,6 @@ A Python package to control the indoor units connected to a Daikin
52
52
  built-in web UI, so it needs no cloud service and no extra hardware: only
53
53
  network access to the iTM and a user account on it.
54
54
 
55
- Based on the original work by Robin Mulder (Exonet).
56
-
57
55
  Used by the Home Assistant integration
58
56
  [home-assistant-daikin-itm](https://github.com/robbinjanssen/home-assistant-daikin-itm).
59
57
 
@@ -220,6 +218,7 @@ class SessionStore(Protocol):
220
218
  | `SessionEnded` | The iTM ended the session (it answered with a LOGOUT update), e.g. because the token was stale. |
221
219
  | `VersionMismatch` | The iTM expects another web UI version string (subclass of `SessionEnded`); carries it in `.version`. |
222
220
  | `ItmCommandError` | The iTM answered a command with a dialog, the UI was not as expected, or a change was not confirmed in time. |
221
+ | `SetpointOutOfRange` | The unit does not accept the setpoint (subclass of `ItmCommandError`). The allowed setpoints depend on the unit and its operation mode; the ones it accepts now are in `.allowed`. |
223
222
  | `ZoneNotFound` | A zone of the zone path is not there (subclass of `ItmCommandError`); the names that are there are in `.available`. |
224
223
 
225
224
  Network errors are raised as `aiohttp.ClientError` or `TimeoutError`.
@@ -23,8 +23,6 @@ A Python package to control the indoor units connected to a Daikin
23
23
  built-in web UI, so it needs no cloud service and no extra hardware: only
24
24
  network access to the iTM and a user account on it.
25
25
 
26
- Based on the original work by Robin Mulder (Exonet).
27
-
28
26
  Used by the Home Assistant integration
29
27
  [home-assistant-daikin-itm](https://github.com/robbinjanssen/home-assistant-daikin-itm).
30
28
 
@@ -191,6 +189,7 @@ class SessionStore(Protocol):
191
189
  | `SessionEnded` | The iTM ended the session (it answered with a LOGOUT update), e.g. because the token was stale. |
192
190
  | `VersionMismatch` | The iTM expects another web UI version string (subclass of `SessionEnded`); carries it in `.version`. |
193
191
  | `ItmCommandError` | The iTM answered a command with a dialog, the UI was not as expected, or a change was not confirmed in time. |
192
+ | `SetpointOutOfRange` | The unit does not accept the setpoint (subclass of `ItmCommandError`). The allowed setpoints depend on the unit and its operation mode; the ones it accepts now are in `.allowed`. |
194
193
  | `ZoneNotFound` | A zone of the zone path is not there (subclass of `ItmCommandError`); the names that are there are in `.available`. |
195
194
 
196
195
  Network errors are raised as `aiohttp.ClientError` or `TimeoutError`.
@@ -13,6 +13,7 @@ from .exceptions import (
13
13
  LoginRejected,
14
14
  ProtocolError,
15
15
  SessionEnded,
16
+ SetpointOutOfRange,
16
17
  VersionMismatch,
17
18
  ZoneNotFound,
18
19
  )
@@ -31,6 +32,7 @@ __all__ = [
31
32
  "ProtocolError",
32
33
  "SessionEnded",
33
34
  "SessionStore",
35
+ "SetpointOutOfRange",
34
36
  "Unit",
35
37
  "VersionMismatch",
36
38
  "ZoneNotFound",
@@ -29,6 +29,7 @@ from .exceptions import (
29
29
  LoginRejected,
30
30
  ProtocolError,
31
31
  SessionEnded,
32
+ SetpointOutOfRange,
32
33
  VersionMismatch,
33
34
  ZoneNotFound,
34
35
  )
@@ -807,8 +808,7 @@ class ItmClient:
807
808
  raise ItmCommandError(msg)
808
809
  nums = list(current.setpoint_range)
809
810
  if value not in nums:
810
- msg = f"{unit}: setpoint {value} outside allowed range {nums}"
811
- raise ItmCommandError(msg)
811
+ raise SetpointOutOfRange(unit, value, current.setpoint_range)
812
812
  if current.setpoint == value:
813
813
  return current
814
814
  await s.choose(P_SETPOINT, nums.index(value))
@@ -59,3 +59,27 @@ class ZoneNotFound(ItmCommandError): # noqa: N818 - public API name
59
59
  super().__init__(f"{zone!r} not found here; available: {available}")
60
60
  self.zone = zone
61
61
  self.available = available
62
+
63
+
64
+ class SetpointOutOfRange(ItmCommandError): # noqa: N818 - public API name
65
+ """The unit does not accept the setpoint; carries the setpoints it does accept.
66
+
67
+ The allowed setpoints depend on the unit and its operation mode, so they may have
68
+ changed since the unit was last read.
69
+ """
70
+
71
+ def __init__(self, unit: str, value: int, allowed: tuple[int, ...]) -> None:
72
+ """Initialize the error.
73
+
74
+ Args:
75
+ ----
76
+ unit: The name of the unit.
77
+ value: The setpoint that was asked for.
78
+ allowed: The setpoints the unit accepts now, as read while writing.
79
+
80
+ """
81
+ msg = f"{unit}: setpoint {value} outside allowed range {list(allowed)}"
82
+ super().__init__(msg)
83
+ self.unit = unit
84
+ self.value = value
85
+ self.allowed = allowed
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-daikin-itm"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  description = "Asynchronous Python client for the Daikin intelligent Touch Manager (iTM)."
5
5
  license = "MIT"
6
6
  license-files = ["LICENSE"]
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "python-daikin-itm"
3
3
  # The version is set from the release tag by the release workflow.
4
- version = "0.1.0"
4
+ version = "0.1.1"
5
5
  description = "Asynchronous Python client for the Daikin intelligent Touch Manager (iTM)."
6
6
  authors = [
7
7
  { name = "Robbin Janssen", email = "robbinjanssen@gmail.com" },