HAP-python 4.9.1__tar.gz → 5.0.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.
- hap_python-5.0.0/AUTHORS +6 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/HAP_python.egg-info/PKG-INFO +20 -15
- {HAP-python-4.9.1 → hap_python-5.0.0}/HAP_python.egg-info/SOURCES.txt +18 -2
- {HAP-python-4.9.1 → hap_python-5.0.0}/HAP_python.egg-info/requires.txt +3 -1
- hap_python-5.0.0/MANIFEST.in +1 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/PKG-INFO +20 -15
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/accessory.py +2 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/accessory_driver.py +11 -3
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/camera.py +390 -308
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/characteristic.py +1 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/const.py +4 -4
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/encoder.py +1 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/hap_crypto.py +4 -6
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/hap_handler.py +11 -5
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/hap_protocol.py +2 -1
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/hap_server.py +1 -1
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/iid_manager.py +1 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/loader.py +1 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/state.py +2 -1
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/tlv.py +2 -1
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/util.py +9 -3
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyproject.toml +54 -1
- {HAP-python-4.9.1 → hap_python-5.0.0}/setup.cfg +0 -3
- hap_python-5.0.0/tests/test_accessory.py +586 -0
- hap_python-5.0.0/tests/test_accessory_driver.py +1217 -0
- hap_python-5.0.0/tests/test_camera.py +145 -0
- hap_python-5.0.0/tests/test_characteristic.py +575 -0
- hap_python-5.0.0/tests/test_encoder.py +122 -0
- hap_python-5.0.0/tests/test_hap_crypto.py +32 -0
- hap_python-5.0.0/tests/test_hap_handler.py +1042 -0
- hap_python-5.0.0/tests/test_hap_protocol.py +798 -0
- hap_python-5.0.0/tests/test_hap_server.py +193 -0
- hap_python-5.0.0/tests/test_hsrp.py +65 -0
- hap_python-5.0.0/tests/test_iid_manager.py +59 -0
- hap_python-5.0.0/tests/test_loader.py +76 -0
- hap_python-5.0.0/tests/test_service.py +247 -0
- hap_python-5.0.0/tests/test_state.py +128 -0
- hap_python-5.0.0/tests/test_tlv.py +29 -0
- hap_python-5.0.0/tests/test_util.py +49 -0
- HAP-python-4.9.1/MANIFEST.in +0 -2
- HAP-python-4.9.1/setup.py +0 -68
- {HAP-python-4.9.1 → hap_python-5.0.0}/HAP_python.egg-info/dependency_links.txt +0 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/HAP_python.egg-info/top_level.txt +0 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/LICENSE +0 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/README.md +0 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/__init__.py +0 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/hap_event.py +0 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/hsrp.py +0 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/params.py +0 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/resources/characteristics.json +0 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/resources/services.json +0 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/resources/snapshot.jpg +0 -0
- {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/service.py +0 -0
hap_python-5.0.0/AUTHORS
ADDED
|
@@ -1,31 +1,38 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: HAP-python
|
|
3
|
-
Version:
|
|
3
|
+
Version: 5.0.0
|
|
4
4
|
Summary: HomeKit Accessory Protocol implementation in python
|
|
5
|
-
|
|
6
|
-
License: Apache
|
|
5
|
+
Author: Ivan Kalchev
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Source, https://github.com/ikalchev/HAP-python
|
|
7
8
|
Project-URL: Bug Reports, https://github.com/ikalchev/HAP-python/issues
|
|
8
9
|
Project-URL: Documentation, http://hap-python.readthedocs.io/en/latest/
|
|
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
|
|
14
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
13
|
Classifier: Natural Language :: English
|
|
16
14
|
Classifier: Operating System :: OS Independent
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.5
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
21
15
|
Classifier: Programming Language :: Python :: 3.9
|
|
22
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
20
|
Classifier: Topic :: Home Automation
|
|
24
21
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
-
Requires-Python: >=3.
|
|
22
|
+
Requires-Python: >=3.9
|
|
26
23
|
Description-Content-Type: text/markdown
|
|
27
|
-
Provides-Extra: QRCode
|
|
28
24
|
License-File: LICENSE
|
|
25
|
+
License-File: AUTHORS
|
|
26
|
+
Requires-Dist: async_timeout; python_version < "3.11"
|
|
27
|
+
Requires-Dist: cryptography
|
|
28
|
+
Requires-Dist: chacha20poly1305-reuseable
|
|
29
|
+
Requires-Dist: orjson>=3.7.2
|
|
30
|
+
Requires-Dist: zeroconf>=0.36.2
|
|
31
|
+
Requires-Dist: h11
|
|
32
|
+
Provides-Extra: qrcode
|
|
33
|
+
Requires-Dist: base36; extra == "qrcode"
|
|
34
|
+
Requires-Dist: pyqrcode; extra == "qrcode"
|
|
35
|
+
Dynamic: license-file
|
|
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
|
-
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
AUTHORS
|
|
1
2
|
LICENSE
|
|
2
3
|
MANIFEST.in
|
|
3
4
|
README.md
|
|
4
5
|
pyproject.toml
|
|
5
6
|
setup.cfg
|
|
6
|
-
setup.py
|
|
7
7
|
HAP_python.egg-info/PKG-INFO
|
|
8
8
|
HAP_python.egg-info/SOURCES.txt
|
|
9
9
|
HAP_python.egg-info/dependency_links.txt
|
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
recursive-include pyhap/resources *
|
|
@@ -1,31 +1,38 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: HAP-python
|
|
3
|
-
Version:
|
|
3
|
+
Version: 5.0.0
|
|
4
4
|
Summary: HomeKit Accessory Protocol implementation in python
|
|
5
|
-
|
|
6
|
-
License: Apache
|
|
5
|
+
Author: Ivan Kalchev
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Source, https://github.com/ikalchev/HAP-python
|
|
7
8
|
Project-URL: Bug Reports, https://github.com/ikalchev/HAP-python/issues
|
|
8
9
|
Project-URL: Documentation, http://hap-python.readthedocs.io/en/latest/
|
|
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
|
|
14
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
13
|
Classifier: Natural Language :: English
|
|
16
14
|
Classifier: Operating System :: OS Independent
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.5
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
21
15
|
Classifier: Programming Language :: Python :: 3.9
|
|
22
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
20
|
Classifier: Topic :: Home Automation
|
|
24
21
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
-
Requires-Python: >=3.
|
|
22
|
+
Requires-Python: >=3.9
|
|
26
23
|
Description-Content-Type: text/markdown
|
|
27
|
-
Provides-Extra: QRCode
|
|
28
24
|
License-File: LICENSE
|
|
25
|
+
License-File: AUTHORS
|
|
26
|
+
Requires-Dist: async_timeout; python_version < "3.11"
|
|
27
|
+
Requires-Dist: cryptography
|
|
28
|
+
Requires-Dist: chacha20poly1305-reuseable
|
|
29
|
+
Requires-Dist: orjson>=3.7.2
|
|
30
|
+
Requires-Dist: zeroconf>=0.36.2
|
|
31
|
+
Requires-Dist: h11
|
|
32
|
+
Provides-Extra: qrcode
|
|
33
|
+
Requires-Dist: base36; extra == "qrcode"
|
|
34
|
+
Requires-Dist: pyqrcode; extra == "qrcode"
|
|
35
|
+
Dynamic: license-file
|
|
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
|
-
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Module for the Accessory classes."""
|
|
2
|
+
|
|
2
3
|
import itertools
|
|
3
4
|
import logging
|
|
4
5
|
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional
|
|
@@ -207,6 +208,7 @@ class Accessory:
|
|
|
207
208
|
int(self.driver.state.pincode.replace(b"-", b""), 10) & 0x7FFFFFFF
|
|
208
209
|
) # pincode
|
|
209
210
|
|
|
211
|
+
# pylint: disable-next=possibly-used-before-assignment
|
|
210
212
|
encoded_payload = base36.dumps(payload).upper()
|
|
211
213
|
encoded_payload = encoded_payload.rjust(9, "0")
|
|
212
214
|
|
|
@@ -15,6 +15,7 @@ one Accessory in it). If so, a task is created to send the event to the subscrib
|
|
|
15
15
|
terminates the call chain and concludes the publishing process from the Characteristic,
|
|
16
16
|
the Characteristic does not block waiting for the actual send to happen.
|
|
17
17
|
"""
|
|
18
|
+
|
|
18
19
|
import asyncio
|
|
19
20
|
import base64
|
|
20
21
|
from collections import defaultdict
|
|
@@ -212,7 +213,7 @@ class AccessoryDriver:
|
|
|
212
213
|
advertised_address=None,
|
|
213
214
|
interface_choice=None,
|
|
214
215
|
async_zeroconf_instance=None,
|
|
215
|
-
zeroconf_server=None
|
|
216
|
+
zeroconf_server=None,
|
|
216
217
|
):
|
|
217
218
|
"""
|
|
218
219
|
Initialize a new AccessoryDriver object.
|
|
@@ -323,7 +324,7 @@ class AccessoryDriver:
|
|
|
323
324
|
and os.name != "nt"
|
|
324
325
|
):
|
|
325
326
|
logger.debug("Setting child watcher")
|
|
326
|
-
watcher = asyncio.SafeChildWatcher()
|
|
327
|
+
watcher = asyncio.SafeChildWatcher() # pylint: disable=deprecated-class
|
|
327
328
|
watcher.attach_loop(self.loop)
|
|
328
329
|
asyncio.set_child_watcher(watcher)
|
|
329
330
|
else:
|
|
@@ -642,16 +643,23 @@ class AccessoryDriver:
|
|
|
642
643
|
tmp_filename = None
|
|
643
644
|
try:
|
|
644
645
|
temp_dir = os.path.dirname(self.persist_file)
|
|
646
|
+
logger.debug("Creating temp persist file in '%s'", temp_dir)
|
|
645
647
|
with tempfile.NamedTemporaryFile(
|
|
646
648
|
mode="w", dir=temp_dir, delete=False
|
|
647
649
|
) as file_handle:
|
|
648
650
|
tmp_filename = file_handle.name
|
|
651
|
+
logger.debug(
|
|
652
|
+
"Created temp persist file '%s' named '%s'",
|
|
653
|
+
file_handle,
|
|
654
|
+
tmp_filename,
|
|
655
|
+
)
|
|
649
656
|
self.encoder.persist(file_handle, self.state)
|
|
650
657
|
if (
|
|
651
658
|
os.name == "nt"
|
|
652
659
|
): # Or `[WinError 5] Access Denied` will be raised on Windows
|
|
653
660
|
os.chmod(tmp_filename, 0o644)
|
|
654
|
-
os.
|
|
661
|
+
if os.path.exists(self.persist_file):
|
|
662
|
+
os.chmod(self.persist_file, 0o644)
|
|
655
663
|
os.replace(tmp_filename, self.persist_file)
|
|
656
664
|
except Exception: # pylint: disable=broad-except
|
|
657
665
|
logger.exception("Failed to persist accessory state")
|