zigpy 1.2.1__tar.gz → 1.3.0__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.
- {zigpy-1.2.1/zigpy.egg-info → zigpy-1.3.0}/PKG-INFO +2 -2
- {zigpy-1.2.1 → zigpy-1.3.0}/pyproject.toml +1 -1
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_serial.py +2 -36
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/event/event_base.py +1 -4
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/ota/__init__.py +15 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/serial.py +30 -53
- {zigpy-1.2.1 → zigpy-1.3.0/zigpy.egg-info}/PKG-INFO +2 -2
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy.egg-info/requires.txt +1 -1
- {zigpy-1.2.1 → zigpy-1.3.0}/COPYING +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/LICENSE +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/README.md +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/setup.cfg +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/setup.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_app_state.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_appdb.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_appdb_migration.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_application.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_backups.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_config.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_datastructures.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_datastructures_cpython.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_device.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_endpoint.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_event.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_group.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_listeners.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_packet_callbacks.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_quirks.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_quirks_registry.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_quirks_v2.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_struct.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_topology.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_types.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_zcl.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_zcl_clusters.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_zcl_foundation.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_zcl_helpers.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_zdo.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_zdo_types.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tests/test_zigbee_util.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tools/__init__.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/tools/regenerate_mypy_ignores.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/__init__.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/__init__.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v0.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v1.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v10.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v11.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v12.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v13.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v14.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v15.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v2.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v3.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v4.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v5.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v6.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v7.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v8.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/appdb_schemas/schema_v9.sql +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/application.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/backports/__init__.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/backups.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/config/__init__.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/config/defaults.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/config/validators.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/const.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/datastructures.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/device.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/endpoint.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/event/__init__.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/exceptions.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/group.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/listeners.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/ota/image.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/ota/json_schemas.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/ota/manager.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/ota/providers.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/ota/validators.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/profiles/__init__.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/profiles/zgp.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/profiles/zha.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/profiles/zll.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/py.typed +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/quirks/__init__.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/quirks/registry.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/quirks/v2/__init__.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/quirks/v2/homeassistant/__init__.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/quirks/v2/homeassistant/binary_sensor.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/quirks/v2/homeassistant/number.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/quirks/v2/homeassistant/sensor.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/state.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/topology.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/types/__init__.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/types/basic.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/types/named.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/types/struct.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/typing.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/util.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/__init__.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/clusters/__init__.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/clusters/closures.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/clusters/general.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/clusters/general_const.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/clusters/greenpower.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/clusters/homeautomation.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/clusters/hvac.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/clusters/lighting.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/clusters/lightlink.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/clusters/manufacturer_specific.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/clusters/measurement.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/clusters/protocol.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/clusters/security.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/clusters/smartenergy.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/clusters/wwah.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/foundation.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zcl/helpers.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zdo/__init__.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zdo/types.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zgp/__init__.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy/zgp/types.py +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy.egg-info/SOURCES.txt +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy.egg-info/dependency_links.txt +0 -0
- {zigpy-1.2.1 → zigpy-1.3.0}/zigpy.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: zigpy
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.0
|
|
4
4
|
Summary: Library implementing a Zigbee stack
|
|
5
5
|
Author-email: Russell Cloran <rcloran@gmail.com>
|
|
6
6
|
License: GPL-3.0
|
|
@@ -16,7 +16,7 @@ Requires-Dist: crccheck
|
|
|
16
16
|
Requires-Dist: cryptography
|
|
17
17
|
Requires-Dist: voluptuous
|
|
18
18
|
Requires-Dist: jsonschema
|
|
19
|
-
Requires-Dist:
|
|
19
|
+
Requires-Dist: serialx>=1.4.0
|
|
20
20
|
Requires-Dist: typing_extensions
|
|
21
21
|
Requires-Dist: frozendict
|
|
22
22
|
Dynamic: license-file
|
|
@@ -54,7 +54,7 @@ async def test_serial_normal(
|
|
|
54
54
|
kwargs["rtscts"] = rtscts
|
|
55
55
|
|
|
56
56
|
with patch(
|
|
57
|
-
"zigpy.serial.
|
|
57
|
+
"zigpy.serial.serialx_create_serial_connection",
|
|
58
58
|
AsyncMock(
|
|
59
59
|
return_value=(AsyncMock(), AsyncMock())
|
|
60
60
|
),
|
|
@@ -71,32 +71,7 @@ async def test_serial_normal(
|
|
|
71
71
|
assert mock_calls[0].kwargs[kwarg] == expected_kwargs[kwarg]
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
async def
|
|
75
|
-
loop = asyncio.get_running_loop()
|
|
76
|
-
protocol_factory = Mock()
|
|
77
|
-
|
|
78
|
-
with patch.object(
|
|
79
|
-
loop,
|
|
80
|
-
"create_connection",
|
|
81
|
-
AsyncMock(
|
|
82
|
-
return_value=(AsyncMock(), AsyncMock())
|
|
83
|
-
),
|
|
84
|
-
):
|
|
85
|
-
await zigpy.serial.create_serial_connection(
|
|
86
|
-
loop, protocol_factory, "socket://1.2.3.4:5678"
|
|
87
|
-
)
|
|
88
|
-
await zigpy.serial.create_serial_connection(
|
|
89
|
-
loop, protocol_factory, "socket://1.2.3.4"
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
assert len(loop.create_connection.mock_calls) == 2
|
|
93
|
-
assert loop.create_connection.mock_calls[0].kwargs["host"] == "1.2.3.4"
|
|
94
|
-
assert loop.create_connection.mock_calls[0].kwargs["port"] == 5678
|
|
95
|
-
assert loop.create_connection.mock_calls[1].kwargs["host"] == "1.2.3.4"
|
|
96
|
-
assert loop.create_connection.mock_calls[1].kwargs["port"] == 6638
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
async def test_pyserial_error_remapping(tmp_path: pathlib.Path) -> None:
|
|
74
|
+
async def test_serial_error_remapping(tmp_path: pathlib.Path) -> None:
|
|
100
75
|
loop = asyncio.get_running_loop()
|
|
101
76
|
protocol_factory = Mock()
|
|
102
77
|
|
|
@@ -119,15 +94,6 @@ async def test_pyserial_error_remapping(tmp_path: pathlib.Path) -> None:
|
|
|
119
94
|
loop, protocol_factory, url=denied_port
|
|
120
95
|
)
|
|
121
96
|
|
|
122
|
-
# IsADirectoryError
|
|
123
|
-
a_folder = tmp_path / "a_folder"
|
|
124
|
-
a_folder.mkdir()
|
|
125
|
-
|
|
126
|
-
with pytest.raises(IsADirectoryError):
|
|
127
|
-
await zigpy.serial.create_serial_connection(
|
|
128
|
-
loop, protocol_factory, url=a_folder
|
|
129
|
-
)
|
|
130
|
-
|
|
131
97
|
# Locked
|
|
132
98
|
locked_port = tmp_path / "locked"
|
|
133
99
|
with locked_port.open("w") as f:
|
|
@@ -9,7 +9,6 @@ from contextvars import ContextVar
|
|
|
9
9
|
import dataclasses
|
|
10
10
|
from inspect import iscoroutinefunction
|
|
11
11
|
import logging
|
|
12
|
-
import sys
|
|
13
12
|
from typing import Any
|
|
14
13
|
|
|
15
14
|
_LOGGER = logging.getLogger(__package__)
|
|
@@ -28,9 +27,7 @@ def suppress_events() -> Generator[None, None, None]:
|
|
|
28
27
|
_suppress_events.reset(token)
|
|
29
28
|
|
|
30
29
|
|
|
31
|
-
@dataclasses.dataclass(
|
|
32
|
-
frozen=True, **({"slots": True} if sys.version_info >= (3, 10) else {})
|
|
33
|
-
)
|
|
30
|
+
@dataclasses.dataclass(frozen=True, slots=True)
|
|
34
31
|
class EventListener:
|
|
35
32
|
"""Listener for an event."""
|
|
36
33
|
|
|
@@ -61,6 +61,21 @@ class OtaImageWithMetadata(t.BaseDataclassMixin):
|
|
|
61
61
|
metadata: zigpy.ota.providers.BaseOtaImageMetadata
|
|
62
62
|
firmware: BaseOTAImage | None
|
|
63
63
|
|
|
64
|
+
def __repr__(self) -> str:
|
|
65
|
+
if self.firmware is not None:
|
|
66
|
+
firmware_repr = (
|
|
67
|
+
f"<{type(self.firmware).__name__}: "
|
|
68
|
+
f"{self.firmware.header.image_size} bytes>"
|
|
69
|
+
)
|
|
70
|
+
else:
|
|
71
|
+
firmware_repr = "None"
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
f"{type(self).__name__}("
|
|
75
|
+
f"metadata={self.metadata!r}, "
|
|
76
|
+
f"firmware={firmware_repr})"
|
|
77
|
+
)
|
|
78
|
+
|
|
64
79
|
@property
|
|
65
80
|
def version(self) -> int:
|
|
66
81
|
return self.metadata.file_version
|
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import asyncio
|
|
4
|
-
from
|
|
4
|
+
from collections.abc import Callable
|
|
5
|
+
import errno
|
|
5
6
|
import logging
|
|
6
7
|
import pathlib
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import serialx as pyserial
|
|
14
|
-
import serialx as pyserial_asyncio
|
|
15
|
-
except ImportError:
|
|
16
|
-
import serial as pyserial
|
|
17
|
-
import serial_asyncio_fast as pyserial_asyncio
|
|
8
|
+
from typing import Any, Literal, cast
|
|
9
|
+
|
|
10
|
+
from serialx import (
|
|
11
|
+
SerialTransport,
|
|
12
|
+
create_serial_connection as serialx_create_serial_connection,
|
|
13
|
+
)
|
|
18
14
|
|
|
19
15
|
from zigpy.typing import UNDEFINED, UndefinedType
|
|
20
16
|
|
|
21
17
|
LOGGER = logging.getLogger(__name__)
|
|
22
|
-
DEFAULT_SOCKET_PORT = 6638
|
|
23
|
-
SOCKET_CONNECT_TIMEOUT = 5
|
|
24
18
|
|
|
25
19
|
|
|
26
20
|
class SerialProtocol(asyncio.Protocol):
|
|
@@ -28,7 +22,7 @@ class SerialProtocol(asyncio.Protocol):
|
|
|
28
22
|
|
|
29
23
|
def __init__(self) -> None:
|
|
30
24
|
self._buffer = bytearray()
|
|
31
|
-
self._transport:
|
|
25
|
+
self._transport: SerialTransport | None = None
|
|
32
26
|
|
|
33
27
|
self._connected_event = asyncio.Event()
|
|
34
28
|
self._disconnected_event = asyncio.Event()
|
|
@@ -38,10 +32,10 @@ class SerialProtocol(asyncio.Protocol):
|
|
|
38
32
|
"""Wait for the protocol's transport to be connected."""
|
|
39
33
|
await self._connected_event.wait()
|
|
40
34
|
|
|
41
|
-
def connection_made(self, transport:
|
|
35
|
+
def connection_made(self, transport: asyncio.BaseTransport) -> None:
|
|
42
36
|
LOGGER.debug("Connection made: %s", transport)
|
|
43
37
|
|
|
44
|
-
self._transport = transport
|
|
38
|
+
self._transport = cast(SerialTransport, transport)
|
|
45
39
|
self._disconnected_event.clear()
|
|
46
40
|
self._connected_event.set()
|
|
47
41
|
|
|
@@ -70,20 +64,17 @@ class SerialProtocol(asyncio.Protocol):
|
|
|
70
64
|
|
|
71
65
|
|
|
72
66
|
async def create_serial_connection(
|
|
73
|
-
loop: asyncio.
|
|
74
|
-
protocol_factory:
|
|
67
|
+
loop: asyncio.AbstractEventLoop,
|
|
68
|
+
protocol_factory: Callable[[], asyncio.Protocol],
|
|
75
69
|
url: pathlib.Path | str,
|
|
76
70
|
*,
|
|
77
71
|
baudrate: int = 115200, # We default to 115200 instead of 9600
|
|
78
|
-
exclusive: bool | None = True,
|
|
79
72
|
xonxoff: bool | UndefinedType = UNDEFINED,
|
|
80
73
|
rtscts: bool | UndefinedType = UNDEFINED,
|
|
81
74
|
flow_control: Literal["hardware", "software"] | None | UndefinedType = UNDEFINED,
|
|
82
|
-
**kwargs:
|
|
75
|
+
**kwargs: Any,
|
|
83
76
|
) -> tuple[asyncio.Transport, asyncio.Protocol]:
|
|
84
|
-
"""Wrapper
|
|
85
|
-
transport and protocol when a `socket` connection URI is provided.
|
|
86
|
-
"""
|
|
77
|
+
"""Wrapper for serialx that provides simplified flow control kwargs."""
|
|
87
78
|
|
|
88
79
|
if flow_control is not UNDEFINED:
|
|
89
80
|
xonxoff = flow_control == "software"
|
|
@@ -104,38 +95,24 @@ async def create_serial_connection(
|
|
|
104
95
|
)
|
|
105
96
|
|
|
106
97
|
url = str(url)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
loop,
|
|
121
|
-
protocol_factory,
|
|
122
|
-
url=url,
|
|
123
|
-
baudrate=baudrate,
|
|
124
|
-
exclusive=exclusive,
|
|
125
|
-
xonxoff=xonxoff,
|
|
126
|
-
rtscts=rtscts,
|
|
127
|
-
**kwargs,
|
|
128
|
-
)
|
|
129
|
-
except pyserial.SerialException as exc:
|
|
130
|
-
# Unwrap unnecessarily wrapped PySerial exceptions
|
|
131
|
-
if exc.__context__ is not None:
|
|
132
|
-
raise exc.__context__ from None
|
|
133
|
-
|
|
134
|
-
raise
|
|
135
|
-
except BlockingIOError as exc:
|
|
98
|
+
|
|
99
|
+
try:
|
|
100
|
+
transport, protocol = await serialx_create_serial_connection(
|
|
101
|
+
loop,
|
|
102
|
+
protocol_factory,
|
|
103
|
+
url=url,
|
|
104
|
+
baudrate=baudrate,
|
|
105
|
+
xonxoff=xonxoff,
|
|
106
|
+
rtscts=rtscts,
|
|
107
|
+
**kwargs,
|
|
108
|
+
)
|
|
109
|
+
except OSError as exc:
|
|
110
|
+
if exc.errno == errno.EBUSY:
|
|
136
111
|
# Re-raise a more useful exception
|
|
137
112
|
raise PermissionError(
|
|
138
113
|
"The serial port is locked by another application"
|
|
139
114
|
) from exc
|
|
140
115
|
|
|
116
|
+
raise
|
|
117
|
+
|
|
141
118
|
return transport, protocol
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: zigpy
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.0
|
|
4
4
|
Summary: Library implementing a Zigbee stack
|
|
5
5
|
Author-email: Russell Cloran <rcloran@gmail.com>
|
|
6
6
|
License: GPL-3.0
|
|
@@ -16,7 +16,7 @@ Requires-Dist: crccheck
|
|
|
16
16
|
Requires-Dist: cryptography
|
|
17
17
|
Requires-Dist: voluptuous
|
|
18
18
|
Requires-Dist: jsonschema
|
|
19
|
-
Requires-Dist:
|
|
19
|
+
Requires-Dist: serialx>=1.4.0
|
|
20
20
|
Requires-Dist: typing_extensions
|
|
21
21
|
Requires-Dist: frozendict
|
|
22
22
|
Dynamic: license-file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|