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.
Files changed (53) hide show
  1. hap_python-5.0.0/AUTHORS +6 -0
  2. {HAP-python-4.9.1 → hap_python-5.0.0}/HAP_python.egg-info/PKG-INFO +20 -15
  3. {HAP-python-4.9.1 → hap_python-5.0.0}/HAP_python.egg-info/SOURCES.txt +18 -2
  4. {HAP-python-4.9.1 → hap_python-5.0.0}/HAP_python.egg-info/requires.txt +3 -1
  5. hap_python-5.0.0/MANIFEST.in +1 -0
  6. {HAP-python-4.9.1 → hap_python-5.0.0}/PKG-INFO +20 -15
  7. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/accessory.py +2 -0
  8. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/accessory_driver.py +11 -3
  9. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/camera.py +390 -308
  10. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/characteristic.py +1 -0
  11. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/const.py +4 -4
  12. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/encoder.py +1 -0
  13. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/hap_crypto.py +4 -6
  14. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/hap_handler.py +11 -5
  15. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/hap_protocol.py +2 -1
  16. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/hap_server.py +1 -1
  17. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/iid_manager.py +1 -0
  18. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/loader.py +1 -0
  19. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/state.py +2 -1
  20. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/tlv.py +2 -1
  21. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/util.py +9 -3
  22. {HAP-python-4.9.1 → hap_python-5.0.0}/pyproject.toml +54 -1
  23. {HAP-python-4.9.1 → hap_python-5.0.0}/setup.cfg +0 -3
  24. hap_python-5.0.0/tests/test_accessory.py +586 -0
  25. hap_python-5.0.0/tests/test_accessory_driver.py +1217 -0
  26. hap_python-5.0.0/tests/test_camera.py +145 -0
  27. hap_python-5.0.0/tests/test_characteristic.py +575 -0
  28. hap_python-5.0.0/tests/test_encoder.py +122 -0
  29. hap_python-5.0.0/tests/test_hap_crypto.py +32 -0
  30. hap_python-5.0.0/tests/test_hap_handler.py +1042 -0
  31. hap_python-5.0.0/tests/test_hap_protocol.py +798 -0
  32. hap_python-5.0.0/tests/test_hap_server.py +193 -0
  33. hap_python-5.0.0/tests/test_hsrp.py +65 -0
  34. hap_python-5.0.0/tests/test_iid_manager.py +59 -0
  35. hap_python-5.0.0/tests/test_loader.py +76 -0
  36. hap_python-5.0.0/tests/test_service.py +247 -0
  37. hap_python-5.0.0/tests/test_state.py +128 -0
  38. hap_python-5.0.0/tests/test_tlv.py +29 -0
  39. hap_python-5.0.0/tests/test_util.py +49 -0
  40. HAP-python-4.9.1/MANIFEST.in +0 -2
  41. HAP-python-4.9.1/setup.py +0 -68
  42. {HAP-python-4.9.1 → hap_python-5.0.0}/HAP_python.egg-info/dependency_links.txt +0 -0
  43. {HAP-python-4.9.1 → hap_python-5.0.0}/HAP_python.egg-info/top_level.txt +0 -0
  44. {HAP-python-4.9.1 → hap_python-5.0.0}/LICENSE +0 -0
  45. {HAP-python-4.9.1 → hap_python-5.0.0}/README.md +0 -0
  46. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/__init__.py +0 -0
  47. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/hap_event.py +0 -0
  48. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/hsrp.py +0 -0
  49. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/params.py +0 -0
  50. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/resources/characteristics.json +0 -0
  51. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/resources/services.json +0 -0
  52. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/resources/snapshot.jpg +0 -0
  53. {HAP-python-4.9.1 → hap_python-5.0.0}/pyhap/service.py +0 -0
@@ -0,0 +1,6 @@
1
+ cdce8p
2
+ jslay88
3
+ Ivan Kalchev <ikalchev> - Maintainer of the library
4
+ Lee Marlow <lmarlow>
5
+ Matthew Schinckel <schinckel>
6
+ Miroslav Kudrnac <mkudrnac>
@@ -1,31 +1,38 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: HAP-python
3
- Version: 4.9.1
3
+ Version: 5.0.0
4
4
  Summary: HomeKit Accessory Protocol implementation in python
5
- Home-page: https://github.com/ikalchev/HAP-python
6
- License: Apache License 2.0
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.7
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
  [![PyPI version](https://badge.fury.io/py/HAP-python.svg)](https://badge.fury.io/py/HAP-python) [![Build Status](https://github.com/ikalchev/HAP-python/workflows/CI/badge.svg)](https://github.com/ikalchev/HAP-python) [![codecov](https://codecov.io/gh/ikalchev/HAP-python/branch/master/graph/badge.svg)](https://codecov.io/gh/ikalchev/HAP-python) [![Python Versions](https://img.shields.io/pypi/pyversions/HAP-python.svg)](https://pypi.python.org/pypi/HAP-python/) [![Documentation Status](https://readthedocs.org/projects/hap-python/badge/?version=latest)](http://hap-python.readthedocs.io/en/latest/?badge=latest) [![Downloads](https://pepy.tech/badge/hap-python)](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
@@ -1,10 +1,12 @@
1
- async_timeout
2
1
  cryptography
3
2
  chacha20poly1305-reuseable
4
3
  orjson>=3.7.2
5
4
  zeroconf>=0.36.2
6
5
  h11
7
6
 
7
+ [:python_version < "3.11"]
8
+ async_timeout
9
+
8
10
  [QRCode]
9
11
  base36
10
12
  pyqrcode
@@ -0,0 +1 @@
1
+ recursive-include pyhap/resources *
@@ -1,31 +1,38 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: HAP-python
3
- Version: 4.9.1
3
+ Version: 5.0.0
4
4
  Summary: HomeKit Accessory Protocol implementation in python
5
- Home-page: https://github.com/ikalchev/HAP-python
6
- License: Apache License 2.0
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.7
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
  [![PyPI version](https://badge.fury.io/py/HAP-python.svg)](https://badge.fury.io/py/HAP-python) [![Build Status](https://github.com/ikalchev/HAP-python/workflows/CI/badge.svg)](https://github.com/ikalchev/HAP-python) [![codecov](https://codecov.io/gh/ikalchev/HAP-python/branch/master/graph/badge.svg)](https://codecov.io/gh/ikalchev/HAP-python) [![Python Versions](https://img.shields.io/pypi/pyversions/HAP-python.svg)](https://pypi.python.org/pypi/HAP-python/) [![Documentation Status](https://readthedocs.org/projects/hap-python/badge/?version=latest)](http://hap-python.readthedocs.io/en/latest/?badge=latest) [![Downloads](https://pepy.tech/badge/hap-python)](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.chmod(self.persist_file, 0o644)
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")