PyPlumIO 0.5.52__py3-none-any.whl → 0.5.54__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.
pyplumio/_version.py CHANGED
@@ -1,7 +1,14 @@
1
1
  # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
3
 
4
- __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
5
12
 
6
13
  TYPE_CHECKING = False
7
14
  if TYPE_CHECKING:
@@ -9,13 +16,19 @@ if TYPE_CHECKING:
9
16
  from typing import Union
10
17
 
11
18
  VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
12
20
  else:
13
21
  VERSION_TUPLE = object
22
+ COMMIT_ID = object
14
23
 
15
24
  version: str
16
25
  __version__: str
17
26
  __version_tuple__: VERSION_TUPLE
18
27
  version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
19
30
 
20
- __version__ = version = '0.5.52'
21
- __version_tuple__ = version_tuple = (0, 5, 52)
31
+ __version__ = version = '0.5.54'
32
+ __version_tuple__ = version_tuple = (0, 5, 54)
33
+
34
+ __commit_id__ = commit_id = None
pyplumio/connection.py CHANGED
@@ -11,8 +11,8 @@ from serial import EIGHTBITS, PARITY_NONE, STOPBITS_ONE
11
11
 
12
12
  from pyplumio.exceptions import ConnectionFailedError
13
13
  from pyplumio.helpers.task_manager import TaskManager
14
- from pyplumio.helpers.timeout import timeout
15
14
  from pyplumio.protocol import AsyncProtocol, Protocol
15
+ from pyplumio.utils import timeout
16
16
 
17
17
  _LOGGER = logging.getLogger(__name__)
18
18
 
pyplumio/data_types.py CHANGED
@@ -33,6 +33,13 @@ class DataType(ABC, Generic[T]):
33
33
 
34
34
  return f"{self.__class__.__name__}()"
35
35
 
36
+ def __hash__(self) -> int:
37
+ """Return a hash of the data type based on its value."""
38
+ if hasattr(self, "_value"):
39
+ return hash(self._value)
40
+
41
+ return hash(type(self))
42
+
36
43
  def __eq__(self, other: object) -> bool:
37
44
  """Compare if this data type is equal to other."""
38
45
  if (
@@ -195,6 +195,7 @@ class PhysicalDevice(Device, ABC):
195
195
  """
196
196
  _LOGGER.info("Requesting '%s' with %s", name, repr(frame_type))
197
197
  request = await Request.create(frame_type, recipient=self.address)
198
+ initial_retries = retries
198
199
  while retries > 0:
199
200
  try:
200
201
  self.queue.put_nowait(request)
@@ -204,7 +205,7 @@ class PhysicalDevice(Device, ABC):
204
205
 
205
206
  raise RequestError(
206
207
  f"Failed to request '{name}' with frame type '{frame_type}' after "
207
- f"{retries} retries.",
208
+ f"{initial_retries} retries.",
208
209
  frame_type=frame_type,
209
210
  )
210
211
 
@@ -236,7 +236,7 @@ class EcoMAX(PhysicalDevice):
236
236
  async def on_event_setup(self, setup: bool) -> None:
237
237
  """Request frames required to set up an ecoMAX entry."""
238
238
  _LOGGER.debug("Setting up device entry")
239
- await self.wait_for(ATTR_SENSORS)
239
+ await self.wait_for(ATTR_SENSORS, timeout=30.0)
240
240
  results = await asyncio.gather(
241
241
  *(
242
242
  self.request(description.provides, description.frame_type)
pyplumio/filters.py CHANGED
@@ -56,6 +56,9 @@ class SupportsComparison(Protocol):
56
56
 
57
57
  __slots__ = ()
58
58
 
59
+ def __hash__(self) -> int:
60
+ """Return a hash of the value."""
61
+
59
62
  def __eq__(self: SupportsComparison, other: SupportsComparison) -> bool:
60
63
  """Compare a value."""
61
64
 
@@ -130,6 +133,10 @@ class Filter(ABC):
130
133
  self._callback = callback
131
134
  self._value = UNDEFINED
132
135
 
136
+ def __hash__(self) -> int:
137
+ """Return a hash of the filter based on its callback."""
138
+ return hash(self._callback)
139
+
133
140
  def __eq__(self, other: Any) -> bool:
134
141
  """Compare callbacks."""
135
142
  if isinstance(other, Filter):
@@ -179,9 +186,10 @@ class _Aggregate(Filter):
179
186
  self._values.append(new_value)
180
187
  time_since_call = current_time - self._last_call_time
181
188
  if time_since_call >= self._timeout or len(self._values) >= self._sample_size:
182
- result = await self._callback(
189
+ sum_of_values = (
183
190
  np.sum(self._values) if numpy_installed else sum(self._values)
184
191
  )
192
+ result = await self._callback(float(sum_of_values))
185
193
  self._last_call_time = current_time
186
194
  self._values = []
187
195
  return result
@@ -114,6 +114,19 @@ class Frame(ABC):
114
114
  self._data = data if not kwargs else ensure_dict(data, kwargs)
115
115
  self._message = message
116
116
 
117
+ def __hash__(self) -> int:
118
+ """Return a hash of the frame based on its values."""
119
+ return hash(
120
+ (
121
+ self.recipient,
122
+ self.sender,
123
+ self.econet_type,
124
+ self.econet_version,
125
+ self._message,
126
+ frozenset(self._data.items()) if self._data else None,
127
+ )
128
+ )
129
+
117
130
  def __eq__(self, other: object) -> bool:
118
131
  """Compare if this frame is equal to other."""
119
132
  if isinstance(other, Frame):
@@ -5,7 +5,7 @@ from __future__ import annotations
5
5
  from abc import ABC, abstractmethod
6
6
  import asyncio
7
7
  from contextlib import suppress
8
- from dataclasses import dataclass
8
+ from dataclasses import asdict, dataclass
9
9
  import logging
10
10
  from typing import TYPE_CHECKING, Any, Literal, TypeVar, Union, get_args
11
11
 
@@ -115,6 +115,10 @@ class Parameter(ABC):
115
115
  f"index={self._index})"
116
116
  )
117
117
 
118
+ def __hash__(self) -> int:
119
+ """Return a hash of the parameter based on its values."""
120
+ return hash(frozenset(asdict(self.values).items()))
121
+
118
122
  def _call_relational_method(self, method_to_call: str, other: Any) -> Any:
119
123
  """Call a specified relational method."""
120
124
  if isinstance(other, Parameter):
pyplumio/stream.py CHANGED
@@ -20,7 +20,7 @@ from pyplumio.frames import (
20
20
  bcc,
21
21
  struct_header,
22
22
  )
23
- from pyplumio.helpers.timeout import timeout
23
+ from pyplumio.utils import timeout
24
24
 
25
25
  READER_TIMEOUT: Final = 10
26
26
  WRITER_TIMEOUT: Final = 10
@@ -67,7 +67,7 @@ class FrameWriter:
67
67
  await self._writer.wait_closed()
68
68
 
69
69
 
70
- class BufferManager:
70
+ class BufferedReader:
71
71
  """Represents a buffered reader for reading frames."""
72
72
 
73
73
  __slots__ = ("_buffer", "_reader")
@@ -89,7 +89,7 @@ class BufferManager:
89
89
  try:
90
90
  data = await self._reader.readexactly(bytes_to_read)
91
91
  self._buffer.extend(data)
92
- self.trim_to(size)
92
+ self.trim_to(DEFAULT_BUFFER_SIZE)
93
93
  except IncompleteReadError as e:
94
94
  raise ReadError(
95
95
  f"Incomplete read. Tried to read {bytes_to_read} additional bytes "
@@ -104,22 +104,36 @@ class BufferManager:
104
104
  f"Serial connection broken while trying to ensure {size} bytes: {e}"
105
105
  ) from e
106
106
 
107
+ async def peek(self, size: int) -> bytes:
108
+ """Read the specified number of bytes without consuming them."""
109
+ await self.ensure_buffer(size)
110
+ return memoryview(self._buffer)[:size].tobytes()
111
+
107
112
  async def consume(self, size: int) -> None:
108
113
  """Consume the specified number of bytes from the buffer."""
109
114
  await self.ensure_buffer(size)
110
115
  self._buffer = self._buffer[size:]
111
116
 
112
- async def peek(self, size: int) -> bytearray:
113
- """Read the specified number of bytes without consuming them."""
114
- await self.ensure_buffer(size)
115
- return self._buffer[:size]
116
-
117
- async def read(self, size: int) -> bytearray:
118
- """Read the bytes from buffer or stream and consume them."""
117
+ async def read_into_buffer(self, size: int) -> None:
118
+ """Read the specified number of bytes from the stream."""
119
119
  try:
120
- return await self.peek(size)
121
- finally:
122
- await self.consume(size)
120
+ chunk = await self._reader.read(size)
121
+ except asyncio.CancelledError:
122
+ _LOGGER.debug("Read operation cancelled while filling internal buffer.")
123
+ raise
124
+ except Exception as e:
125
+ raise OSError(
126
+ f"Serial connection broken while filling internal buffer: {e}"
127
+ ) from e
128
+
129
+ if not chunk:
130
+ _LOGGER.debug("Stream ended while filling internal buffer.")
131
+ raise OSError(
132
+ "Serial connection broken: stream ended while filling internal buffer"
133
+ )
134
+
135
+ self._buffer.extend(chunk)
136
+ self.trim_to(DEFAULT_BUFFER_SIZE)
123
137
 
124
138
  def seek_to(self, delimiter: SupportsIndex) -> bool:
125
139
  """Trim the buffer to the first occurrence of the delimiter.
@@ -137,27 +151,6 @@ class BufferManager:
137
151
  if len(self._buffer) > size:
138
152
  self._buffer = self._buffer[-size:]
139
153
 
140
- async def fill(self) -> None:
141
- """Fill the buffer with data from the stream."""
142
- try:
143
- chunk = await self._reader.read(MAX_FRAME_LENGTH)
144
- except asyncio.CancelledError:
145
- _LOGGER.debug("Read operation cancelled while filling read buffer.")
146
- raise
147
- except Exception as e:
148
- raise OSError(
149
- f"Serial connection broken while filling read buffer: {e}"
150
- ) from e
151
-
152
- if not chunk:
153
- _LOGGER.debug("Stream ended while filling read buffer.")
154
- raise OSError(
155
- "Serial connection broken: stream ended while filling read buffer"
156
- )
157
-
158
- self._buffer.extend(chunk)
159
- self.trim_to(DEFAULT_BUFFER_SIZE)
160
-
161
154
  @property
162
155
  def buffer(self) -> bytearray:
163
156
  """Return the internal buffer."""
@@ -177,22 +170,23 @@ class Header(NamedTuple):
177
170
  class FrameReader:
178
171
  """Represents a frame reader."""
179
172
 
180
- __slots__ = ("_buffer",)
173
+ __slots__ = ("_reader",)
181
174
 
182
- _buffer: BufferManager
175
+ _reader: BufferedReader
183
176
 
184
177
  def __init__(self, reader: StreamReader) -> None:
185
178
  """Initialize a new frame reader."""
186
- self._buffer = BufferManager(reader)
179
+ self._reader = BufferedReader(reader)
187
180
 
188
181
  async def _read_header(self) -> Header:
189
182
  """Locate and read a frame header."""
190
183
  while True:
191
- if self._buffer.seek_to(FRAME_START):
192
- header_bytes = await self._buffer.peek(HEADER_SIZE)
193
- return Header(*struct_header.unpack_from(header_bytes)[DELIMITER_SIZE:])
184
+ if self._reader.seek_to(FRAME_START):
185
+ header_bytes = await self._reader.peek(HEADER_SIZE)
186
+ header_fields = struct_header.unpack_from(header_bytes)
187
+ return Header(*header_fields[DELIMITER_SIZE:])
194
188
 
195
- await self._buffer.fill()
189
+ await self._reader.read_into_buffer(MAX_FRAME_LENGTH)
196
190
 
197
191
  @timeout(READER_TIMEOUT)
198
192
  async def read(self) -> Frame | None:
@@ -201,22 +195,22 @@ class FrameReader:
201
195
  frame_length, recipient, sender, econet_type, econet_version = header
202
196
 
203
197
  if frame_length > MAX_FRAME_LENGTH or frame_length < MIN_FRAME_LENGTH:
204
- await self._buffer.consume(HEADER_SIZE)
198
+ await self._reader.consume(HEADER_SIZE)
205
199
  raise ReadError(
206
200
  f"Unexpected frame length ({frame_length}), expected between "
207
201
  f"{MIN_FRAME_LENGTH} and {MAX_FRAME_LENGTH}"
208
202
  )
209
203
 
210
- frame_bytes = await self._buffer.peek(frame_length)
204
+ frame_bytes = await self._reader.peek(frame_length)
211
205
  checksum = bcc(frame_bytes[:BCC_INDEX])
212
206
  if checksum != frame_bytes[BCC_INDEX]:
213
- await self._buffer.consume(HEADER_SIZE)
207
+ await self._reader.consume(HEADER_SIZE)
214
208
  raise ChecksumError(
215
209
  f"Incorrect frame checksum: calculated {checksum}, "
216
210
  f"expected {frame_bytes[BCC_INDEX]}. Frame data: {frame_bytes.hex()}"
217
211
  )
218
212
 
219
- await self._buffer.consume(frame_length)
213
+ await self._reader.consume(frame_length)
220
214
  if recipient not in (DeviceType.ECONET, DeviceType.ALL):
221
215
  _LOGGER.debug(
222
216
  "Skipping frame intended for different recipient (%s)", recipient
pyplumio/utils.py CHANGED
@@ -2,9 +2,13 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from collections.abc import Mapping
5
+ import asyncio
6
+ from collections.abc import Awaitable, Callable, Mapping
7
+ from functools import wraps
6
8
  from typing import TypeVar
7
9
 
10
+ from typing_extensions import ParamSpec
11
+
8
12
  KT = TypeVar("KT") # Key type.
9
13
  VT = TypeVar("VT") # Value type.
10
14
 
@@ -40,4 +44,24 @@ def is_divisible(a: float, b: float, precision: int = 6) -> bool:
40
44
  return a_scaled % b_scaled == 0
41
45
 
42
46
 
43
- __all__ = ["ensure_dict", "is_divisible", "to_camelcase"]
47
+ T = TypeVar("T")
48
+ P = ParamSpec("P")
49
+
50
+
51
+ def timeout(
52
+ seconds: float,
53
+ ) -> Callable[[Callable[P, Awaitable[T]]], Callable[P, Awaitable[T]]]:
54
+ """Decorate a timeout for the awaitable."""
55
+
56
+ def decorator(func: Callable[P, Awaitable[T]]) -> Callable[P, Awaitable[T]]:
57
+ @wraps(func)
58
+ async def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
59
+ return await asyncio.wait_for(func(*args, **kwargs), timeout=seconds)
60
+
61
+ setattr(wrapper, "_has_timeout_seconds", seconds)
62
+ return wrapper
63
+
64
+ return decorator
65
+
66
+
67
+ __all__ = ["ensure_dict", "is_divisible", "to_camelcase", "timeout"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyPlumIO
3
- Version: 0.5.52
3
+ Version: 0.5.54
4
4
  Summary: PyPlumIO is a native ecoNET library for Plum ecoMAX controllers.
5
5
  Author-email: Denis Paavilainen <denpa@denpa.pro>
6
6
  License: MIT License
@@ -25,26 +25,26 @@ Description-Content-Type: text/markdown
25
25
  License-File: LICENSE
26
26
  Requires-Dist: dataslots==1.2.0
27
27
  Requires-Dist: pyserial-asyncio==0.6
28
- Requires-Dist: typing-extensions==4.14.0
28
+ Requires-Dist: typing-extensions<5.0,>=4.14.0
29
29
  Provides-Extra: test
30
30
  Requires-Dist: codespell==2.4.1; extra == "test"
31
- Requires-Dist: coverage==7.9.1; extra == "test"
32
- Requires-Dist: freezegun==1.5.2; extra == "test"
33
- Requires-Dist: mypy==1.16.1; extra == "test"
31
+ Requires-Dist: coverage==7.10.5; extra == "test"
32
+ Requires-Dist: freezegun==1.5.5; extra == "test"
33
+ Requires-Dist: mypy==1.17.1; extra == "test"
34
34
  Requires-Dist: numpy<3.0.0,>=2.0.0; extra == "test"
35
35
  Requires-Dist: pyserial-asyncio-fast==0.16; extra == "test"
36
36
  Requires-Dist: pytest==8.4.1; extra == "test"
37
- Requires-Dist: pytest-asyncio==1.0.0; extra == "test"
38
- Requires-Dist: ruff==0.11.13; extra == "test"
39
- Requires-Dist: tox==4.26.0; extra == "test"
40
- Requires-Dist: types-pyserial==3.5.0.20250326; extra == "test"
37
+ Requires-Dist: pytest-asyncio==1.1.0; extra == "test"
38
+ Requires-Dist: ruff==0.12.10; extra == "test"
39
+ Requires-Dist: tox==4.28.4; extra == "test"
40
+ Requires-Dist: types-pyserial==3.5.0.20250822; extra == "test"
41
41
  Provides-Extra: docs
42
42
  Requires-Dist: sphinx==8.1.3; extra == "docs"
43
43
  Requires-Dist: sphinx_rtd_theme==3.0.2; extra == "docs"
44
44
  Requires-Dist: readthedocs-sphinx-search==0.3.2; extra == "docs"
45
45
  Provides-Extra: dev
46
46
  Requires-Dist: pyplumio[docs,test]; extra == "dev"
47
- Requires-Dist: pre-commit==4.2.0; extra == "dev"
47
+ Requires-Dist: pre-commit==4.3.0; extra == "dev"
48
48
  Requires-Dist: tomli==2.2.1; extra == "dev"
49
49
  Dynamic: license-file
50
50
 
@@ -1,21 +1,21 @@
1
1
  pyplumio/__init__.py,sha256=3H5SO4WFw5mBTFeEyD4w0H8-MsNo93NyOH3RyMN7IS0,3337
2
2
  pyplumio/__main__.py,sha256=3IwHHSq-iay5FaeMc95klobe-xv82yydSKcBE7BFZ6M,500
3
- pyplumio/_version.py,sha256=yGNU5eJ0S_ns8vdsPIX0Yq-JAj22V0bb0R9aJSWHpgE,513
4
- pyplumio/connection.py,sha256=9MCPb8W62uqCrzd1YCROcn9cCjRY8E65934FnJDF5Js,5902
3
+ pyplumio/_version.py,sha256=Kso5O0qgc2O4WADsLkE0mLHNOrYeVP6CbRg5BIXR8FM,706
4
+ pyplumio/connection.py,sha256=u-iOzEUqoEEL4YLpLtzBWi5Qy8_RABgKD8DyXf-er-4,5892
5
5
  pyplumio/const.py,sha256=eoq-WNJ8TO3YlP7dC7KkVQRKGjt9FbRZ6M__s29vb1U,5659
6
- pyplumio/data_types.py,sha256=r-QOIZiIpBFo4kRongyu8n0BHTaEU6wWMTmNkWBNjq8,9223
6
+ pyplumio/data_types.py,sha256=BTDxwErRo_odvFT5DNfIniNh8ZfyjRKEDaJmoEJqdEg,9426
7
7
  pyplumio/exceptions.py,sha256=_B_0EgxDxd2XyYv3WpZM733q0cML5m6J-f55QOvYRpI,996
8
- pyplumio/filters.py,sha256=8IPDa8GQLKf4OdoLwlTxFyffvZXt-VrE6nKpttMVTLg,15400
8
+ pyplumio/filters.py,sha256=QEtOptXym2Fb82cdPpS1dajkTpvYi3VuQaYoLl4CSQ4,15658
9
9
  pyplumio/protocol.py,sha256=DWM-yJnm2EQPLvGzXNlkQ0IpKQn44e-WkNB_DqZAag8,8313
10
10
  pyplumio/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- pyplumio/stream.py,sha256=XzDZ1mkwUwy8wHtVII2W9t_8NpCQEwFmnlMeHwh8cd0,7832
12
- pyplumio/utils.py,sha256=D6_SJzYkFjXoUrlNPt_mIQAP8hjMU05RsTqlAFphj3Y,1205
13
- pyplumio/devices/__init__.py,sha256=OLPY_Kk5E2SiJ4FLN2g6zmKQdQfutePV5jRH9kRHAMA,8260
14
- pyplumio/devices/ecomax.py,sha256=3_Hk6RaQ2e9WqIJ2NdPhofgVFjLbWIyR3TsRmMG35WY,16043
11
+ pyplumio/stream.py,sha256=zFMKZ_GxsSGcaBTJigVM1CK3uGjlEJXgcvKqus8MDzk,7740
12
+ pyplumio/utils.py,sha256=ktV8_Th2DiwQ0W6afOCau9kBJ8pOrqR-SM2Y2GRy-xE,1869
13
+ pyplumio/devices/__init__.py,sha256=d0E5hTV7UPa8flq8TNlKf_jt4cOSbRigSE9jjDHrmDI,8302
14
+ pyplumio/devices/ecomax.py,sha256=28Tr3WE8jI_zTYXYgSfR8nhppwzkQdmfAivt_iBUbTA,16057
15
15
  pyplumio/devices/ecoster.py,sha256=X46ky5XT8jHMFq9sBW0ve8ZI_tjItQDMt4moXsW-ogY,307
16
16
  pyplumio/devices/mixer.py,sha256=7WdUVgwO4VXmaPNzh3ZWpKr2ooRXWemz2KFHAw35_Rk,2731
17
17
  pyplumio/devices/thermostat.py,sha256=MHMKe45fQ7jKlhBVObJ7McbYQKuF6-LOKSHy-9VNsCU,2253
18
- pyplumio/frames/__init__.py,sha256=iHydFDClh3EDjElBis6nicNmF0QnahguBEtY_HOHsck,7885
18
+ pyplumio/frames/__init__.py,sha256=QAjdvZxQj5Av1OKFqdlSgZBn3RbCcRVMQv_lCnTkW5M,8272
19
19
  pyplumio/frames/messages.py,sha256=ImQGWFFTa2eaXfytQmFZKC-IxyPRkxD8qp0bEm16-ws,3628
20
20
  pyplumio/frames/requests.py,sha256=jr-_XSSCCDDTbAmrw95CKyWa5nb7JNeGzZ2jDXIxlAo,7348
21
21
  pyplumio/frames/responses.py,sha256=M6Ky4gg2AoShmRXX0x6nftajxrvmQLKPVRWbwyhvI0E,6663
@@ -24,8 +24,7 @@ pyplumio/helpers/async_cache.py,sha256=EGQcU8LWJpVx3Hk6iaI-3mqAhnR5ACfBOGb9tWw-V
24
24
  pyplumio/helpers/event_manager.py,sha256=aKNlhsPNTy3eOSfWVb9TJxtIsN9GAQv9XxhOi_BOhlM,8097
25
25
  pyplumio/helpers/factory.py,sha256=c3sitnkUjJWz7fPpTE9uRIpa8h46Qim3xsAblMw3eDo,1049
26
26
  pyplumio/helpers/task_manager.py,sha256=N71F6Ag1HHxdf5zJeCMcEziFdH9lmJKtMPoRGjJ-E40,1209
27
- pyplumio/helpers/timeout.py,sha256=2wAcOug-2TgdCchKbfv0VhAfNzP-MPM0TEFtRNFJ_m8,803
28
- pyplumio/parameters/__init__.py,sha256=2YTJJF-ehMLbPJwp02I1fycyLsatIXPSlTxXLwtkHtk,16054
27
+ pyplumio/parameters/__init__.py,sha256=YKIXmb_-E2HeIVljDHdD2bLbsfUsQ8sVhl9sl7kLzyo,16220
29
28
  pyplumio/parameters/ecomax.py,sha256=4UqI7cokCt7qS9Du4-7JgLhM7mhHCHt8SWPl_qncmXQ,26239
30
29
  pyplumio/parameters/mixer.py,sha256=RjhfUU_62STyNV0Ud9A4G4FEvVwo02qGVl8h1QvqQXI,6646
31
30
  pyplumio/parameters/thermostat.py,sha256=-DK2Mb78CGrKmdhwAD0M3GiGJatczPnl1e2gVeT19tI,5070
@@ -57,8 +56,8 @@ pyplumio/structures/statuses.py,sha256=1h-EUw1UtuS44E19cNOSavUgZeAxsLgX3iS0eVC8p
57
56
  pyplumio/structures/temperatures.py,sha256=2VD3P_vwp9PEBkOn2-WhifOR8w-UYNq35aAxle0z2Vg,2831
58
57
  pyplumio/structures/thermostat_parameters.py,sha256=st3x3HkjQm3hqBrn_fpvPDQu8fuc-Sx33ONB19ViQak,3007
59
58
  pyplumio/structures/thermostat_sensors.py,sha256=rO9jTZWGQpThtJqVdbbv8sYMYHxJi4MfwZQza69L2zw,3399
60
- pyplumio-0.5.52.dist-info/licenses/LICENSE,sha256=m-UuZFjXJ22uPTGm9kSHS8bqjsf5T8k2wL9bJn1Y04o,1088
61
- pyplumio-0.5.52.dist-info/METADATA,sha256=FMrf9h1q6n2yj7eafOP4MxGkRwTPEw3a0rMDi_xvyh4,5611
62
- pyplumio-0.5.52.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
63
- pyplumio-0.5.52.dist-info/top_level.txt,sha256=kNBz9UPPkPD9teDn3U_sEy5LjzwLm9KfADCXtBlbw8A,9
64
- pyplumio-0.5.52.dist-info/RECORD,,
59
+ pyplumio-0.5.54.dist-info/licenses/LICENSE,sha256=m-UuZFjXJ22uPTGm9kSHS8bqjsf5T8k2wL9bJn1Y04o,1088
60
+ pyplumio-0.5.54.dist-info/METADATA,sha256=dy0asMgq9FuRsiENh0PctlZYWcagYIKalPTtlLjeT5o,5617
61
+ pyplumio-0.5.54.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
62
+ pyplumio-0.5.54.dist-info/top_level.txt,sha256=kNBz9UPPkPD9teDn3U_sEy5LjzwLm9KfADCXtBlbw8A,9
63
+ pyplumio-0.5.54.dist-info/RECORD,,
@@ -1,32 +0,0 @@
1
- """Contains a timeout decorator."""
2
-
3
- from __future__ import annotations
4
-
5
- import asyncio
6
- from collections.abc import Awaitable, Callable
7
- from functools import wraps
8
- from typing import TypeVar
9
-
10
- from typing_extensions import ParamSpec
11
-
12
- T = TypeVar("T")
13
- P = ParamSpec("P")
14
-
15
-
16
- def timeout(
17
- seconds: float,
18
- ) -> Callable[[Callable[P, Awaitable[T]]], Callable[P, Awaitable[T]]]:
19
- """Decorate a timeout for the awaitable."""
20
-
21
- def decorator(func: Callable[P, Awaitable[T]]) -> Callable[P, Awaitable[T]]:
22
- @wraps(func)
23
- async def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
24
- return await asyncio.wait_for(func(*args, **kwargs), timeout=seconds)
25
-
26
- setattr(wrapper, "_has_timeout_seconds", seconds)
27
- return wrapper
28
-
29
- return decorator
30
-
31
-
32
- __all__ = ["timeout"]