HAP-python 4.9.1__tar.gz → 4.9.2__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.
- {HAP-python-4.9.1 → hap_python-4.9.2}/HAP_python.egg-info/PKG-INFO +10 -5
- {HAP-python-4.9.1 → hap_python-4.9.2}/HAP_python.egg-info/SOURCES.txt +17 -1
- {HAP-python-4.9.1 → hap_python-4.9.2}/PKG-INFO +10 -5
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/accessory.py +1 -1
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/accessory_driver.py +5 -2
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/const.py +1 -1
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/hap_crypto.py +3 -6
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/hap_protocol.py +1 -1
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/hap_server.py +1 -1
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyproject.toml +1 -0
- hap_python-4.9.2/tests/test_accessory.py +588 -0
- hap_python-4.9.2/tests/test_accessory_driver.py +1235 -0
- hap_python-4.9.2/tests/test_camera.py +143 -0
- hap_python-4.9.2/tests/test_characteristic.py +574 -0
- hap_python-4.9.2/tests/test_encoder.py +121 -0
- hap_python-4.9.2/tests/test_hap_crypto.py +33 -0
- hap_python-4.9.2/tests/test_hap_handler.py +1042 -0
- hap_python-4.9.2/tests/test_hap_protocol.py +802 -0
- hap_python-4.9.2/tests/test_hap_server.py +198 -0
- hap_python-4.9.2/tests/test_hsrp.py +65 -0
- hap_python-4.9.2/tests/test_iid_manager.py +58 -0
- hap_python-4.9.2/tests/test_loader.py +75 -0
- hap_python-4.9.2/tests/test_service.py +241 -0
- hap_python-4.9.2/tests/test_state.py +119 -0
- hap_python-4.9.2/tests/test_tlv.py +29 -0
- hap_python-4.9.2/tests/test_util.py +48 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/HAP_python.egg-info/dependency_links.txt +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/HAP_python.egg-info/requires.txt +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/HAP_python.egg-info/top_level.txt +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/LICENSE +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/MANIFEST.in +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/README.md +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/__init__.py +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/camera.py +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/characteristic.py +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/encoder.py +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/hap_event.py +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/hap_handler.py +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/hsrp.py +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/iid_manager.py +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/loader.py +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/params.py +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/resources/characteristics.json +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/resources/services.json +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/resources/snapshot.jpg +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/service.py +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/state.py +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/tlv.py +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/pyhap/util.py +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/setup.cfg +0 -0
- {HAP-python-4.9.1 → hap_python-4.9.2}/setup.py +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: HAP-python
|
|
3
|
-
Version: 4.9.
|
|
3
|
+
Version: 4.9.2
|
|
4
4
|
Summary: HomeKit Accessory Protocol implementation in python
|
|
5
5
|
Home-page: https://github.com/ikalchev/HAP-python
|
|
6
6
|
License: Apache License 2.0
|
|
7
7
|
Project-URL: Bug Reports, https://github.com/ikalchev/HAP-python/issues
|
|
8
8
|
Project-URL: Documentation, http://hap-python.readthedocs.io/en/latest/
|
|
9
9
|
Project-URL: Source, https://github.com/ikalchev/HAP-python/tree/master
|
|
10
|
-
Platform: UNKNOWN
|
|
11
10
|
Classifier: Development Status :: 5 - Production/Stable
|
|
12
11
|
Classifier: Intended Audience :: Developers
|
|
13
12
|
Classifier: Intended Audience :: End Users/Desktop
|
|
@@ -24,8 +23,16 @@ Classifier: Topic :: Home Automation
|
|
|
24
23
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
24
|
Requires-Python: >=3.7
|
|
26
25
|
Description-Content-Type: text/markdown
|
|
27
|
-
Provides-Extra: QRCode
|
|
28
26
|
License-File: LICENSE
|
|
27
|
+
Requires-Dist: async_timeout
|
|
28
|
+
Requires-Dist: cryptography
|
|
29
|
+
Requires-Dist: chacha20poly1305-reuseable
|
|
30
|
+
Requires-Dist: orjson>=3.7.2
|
|
31
|
+
Requires-Dist: zeroconf>=0.36.2
|
|
32
|
+
Requires-Dist: h11
|
|
33
|
+
Provides-Extra: qrcode
|
|
34
|
+
Requires-Dist: base36; extra == "qrcode"
|
|
35
|
+
Requires-Dist: pyqrcode; extra == "qrcode"
|
|
29
36
|
|
|
30
37
|
[](https://badge.fury.io/py/HAP-python) [](https://github.com/ikalchev/HAP-python) [](https://codecov.io/gh/ikalchev/HAP-python) [](https://pypi.python.org/pypi/HAP-python/) [](http://hap-python.readthedocs.io/en/latest/?badge=latest) [](https://pepy.tech/project/hap-python)
|
|
31
38
|
# HAP-python
|
|
@@ -302,5 +309,3 @@ please report and I will try to fix them.
|
|
|
302
309
|
Suggestions are always welcome.
|
|
303
310
|
|
|
304
311
|
Have fun!
|
|
305
|
-
|
|
306
|
-
|
|
@@ -31,4 +31,20 @@ pyhap/tlv.py
|
|
|
31
31
|
pyhap/util.py
|
|
32
32
|
pyhap/resources/characteristics.json
|
|
33
33
|
pyhap/resources/services.json
|
|
34
|
-
pyhap/resources/snapshot.jpg
|
|
34
|
+
pyhap/resources/snapshot.jpg
|
|
35
|
+
tests/test_accessory.py
|
|
36
|
+
tests/test_accessory_driver.py
|
|
37
|
+
tests/test_camera.py
|
|
38
|
+
tests/test_characteristic.py
|
|
39
|
+
tests/test_encoder.py
|
|
40
|
+
tests/test_hap_crypto.py
|
|
41
|
+
tests/test_hap_handler.py
|
|
42
|
+
tests/test_hap_protocol.py
|
|
43
|
+
tests/test_hap_server.py
|
|
44
|
+
tests/test_hsrp.py
|
|
45
|
+
tests/test_iid_manager.py
|
|
46
|
+
tests/test_loader.py
|
|
47
|
+
tests/test_service.py
|
|
48
|
+
tests/test_state.py
|
|
49
|
+
tests/test_tlv.py
|
|
50
|
+
tests/test_util.py
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: HAP-python
|
|
3
|
-
Version: 4.9.
|
|
3
|
+
Version: 4.9.2
|
|
4
4
|
Summary: HomeKit Accessory Protocol implementation in python
|
|
5
5
|
Home-page: https://github.com/ikalchev/HAP-python
|
|
6
6
|
License: Apache License 2.0
|
|
7
7
|
Project-URL: Bug Reports, https://github.com/ikalchev/HAP-python/issues
|
|
8
8
|
Project-URL: Documentation, http://hap-python.readthedocs.io/en/latest/
|
|
9
9
|
Project-URL: Source, https://github.com/ikalchev/HAP-python/tree/master
|
|
10
|
-
Platform: UNKNOWN
|
|
11
10
|
Classifier: Development Status :: 5 - Production/Stable
|
|
12
11
|
Classifier: Intended Audience :: Developers
|
|
13
12
|
Classifier: Intended Audience :: End Users/Desktop
|
|
@@ -24,8 +23,16 @@ Classifier: Topic :: Home Automation
|
|
|
24
23
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
24
|
Requires-Python: >=3.7
|
|
26
25
|
Description-Content-Type: text/markdown
|
|
27
|
-
Provides-Extra: QRCode
|
|
28
26
|
License-File: LICENSE
|
|
27
|
+
Requires-Dist: async_timeout
|
|
28
|
+
Requires-Dist: cryptography
|
|
29
|
+
Requires-Dist: chacha20poly1305-reuseable
|
|
30
|
+
Requires-Dist: orjson>=3.7.2
|
|
31
|
+
Requires-Dist: zeroconf>=0.36.2
|
|
32
|
+
Requires-Dist: h11
|
|
33
|
+
Provides-Extra: qrcode
|
|
34
|
+
Requires-Dist: base36; extra == "qrcode"
|
|
35
|
+
Requires-Dist: pyqrcode; extra == "qrcode"
|
|
29
36
|
|
|
30
37
|
[](https://badge.fury.io/py/HAP-python) [](https://github.com/ikalchev/HAP-python) [](https://codecov.io/gh/ikalchev/HAP-python) [](https://pypi.python.org/pypi/HAP-python/) [](http://hap-python.readthedocs.io/en/latest/?badge=latest) [](https://pepy.tech/project/hap-python)
|
|
31
38
|
# HAP-python
|
|
@@ -302,5 +309,3 @@ please report and I will try to fix them.
|
|
|
302
309
|
Suggestions are always welcome.
|
|
303
310
|
|
|
304
311
|
Have fun!
|
|
305
|
-
|
|
306
|
-
|
|
@@ -207,7 +207,7 @@ class Accessory:
|
|
|
207
207
|
int(self.driver.state.pincode.replace(b"-", b""), 10) & 0x7FFFFFFF
|
|
208
208
|
) # pincode
|
|
209
209
|
|
|
210
|
-
encoded_payload = base36.dumps(payload).upper()
|
|
210
|
+
encoded_payload = base36.dumps(payload).upper() # pylint: disable=possibly-used-before-assignment
|
|
211
211
|
encoded_payload = encoded_payload.rjust(9, "0")
|
|
212
212
|
|
|
213
213
|
return "X-HM://" + encoded_payload + self.driver.state.setup_id
|
|
@@ -323,7 +323,7 @@ class AccessoryDriver:
|
|
|
323
323
|
and os.name != "nt"
|
|
324
324
|
):
|
|
325
325
|
logger.debug("Setting child watcher")
|
|
326
|
-
watcher = asyncio.SafeChildWatcher()
|
|
326
|
+
watcher = asyncio.SafeChildWatcher() # pylint: disable=deprecated-class
|
|
327
327
|
watcher.attach_loop(self.loop)
|
|
328
328
|
asyncio.set_child_watcher(watcher)
|
|
329
329
|
else:
|
|
@@ -642,16 +642,19 @@ class AccessoryDriver:
|
|
|
642
642
|
tmp_filename = None
|
|
643
643
|
try:
|
|
644
644
|
temp_dir = os.path.dirname(self.persist_file)
|
|
645
|
+
logger.debug("Creating temp persist file in '%s'", temp_dir)
|
|
645
646
|
with tempfile.NamedTemporaryFile(
|
|
646
647
|
mode="w", dir=temp_dir, delete=False
|
|
647
648
|
) as file_handle:
|
|
648
649
|
tmp_filename = file_handle.name
|
|
650
|
+
logger.debug("Created temp persist file '%s' named '%s'", file_handle, tmp_filename)
|
|
649
651
|
self.encoder.persist(file_handle, self.state)
|
|
650
652
|
if (
|
|
651
653
|
os.name == "nt"
|
|
652
654
|
): # Or `[WinError 5] Access Denied` will be raised on Windows
|
|
653
655
|
os.chmod(tmp_filename, 0o644)
|
|
654
|
-
os.
|
|
656
|
+
if os.path.exists(self.persist_file):
|
|
657
|
+
os.chmod(self.persist_file, 0o644)
|
|
655
658
|
os.replace(tmp_filename, self.persist_file)
|
|
656
659
|
except Exception: # pylint: disable=broad-except
|
|
657
660
|
logger.exception("Failed to persist accessory state")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""This module contains constants used by other modules."""
|
|
2
2
|
MAJOR_VERSION = 4
|
|
3
3
|
MINOR_VERSION = 9
|
|
4
|
-
PATCH_VERSION =
|
|
4
|
+
PATCH_VERSION = 2
|
|
5
5
|
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
|
|
6
6
|
__version__ = f"{__short_version__}.{PATCH_VERSION}"
|
|
7
7
|
REQUIRED_PYTHON_VER = (3, 7)
|
|
@@ -3,7 +3,7 @@ from functools import partial
|
|
|
3
3
|
import logging
|
|
4
4
|
import struct
|
|
5
5
|
from struct import Struct
|
|
6
|
-
from typing import List
|
|
6
|
+
from typing import Iterable, List
|
|
7
7
|
|
|
8
8
|
from chacha20poly1305_reuseable import ChaCha20Poly1305Reusable as ChaCha20Poly1305
|
|
9
9
|
from cryptography.hazmat.backends import default_backend
|
|
@@ -112,7 +112,7 @@ class HAPCrypto:
|
|
|
112
112
|
|
|
113
113
|
return result
|
|
114
114
|
|
|
115
|
-
def encrypt(self, data: bytes) -> bytes:
|
|
115
|
+
def encrypt(self, data: bytes) -> Iterable[bytes]:
|
|
116
116
|
"""Encrypt and send the return bytes."""
|
|
117
117
|
result: List[bytes] = []
|
|
118
118
|
offset = 0
|
|
@@ -127,7 +127,4 @@ class HAPCrypto:
|
|
|
127
127
|
offset += length
|
|
128
128
|
self._out_count += 1
|
|
129
129
|
|
|
130
|
-
|
|
131
|
-
# as this is much faster than generating an new immutable
|
|
132
|
-
# byte string each time.
|
|
133
|
-
return b"".join(result)
|
|
130
|
+
return result
|