HAP-python 4.9.2__tar.gz → 5.1.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 (63) hide show
  1. hap_python-5.1.0/AUTHORS +6 -0
  2. {hap_python-4.9.2 → hap_python-5.1.0}/HAP_python.egg-info/PKG-INFO +14 -13
  3. {hap_python-4.9.2 → hap_python-5.1.0}/HAP_python.egg-info/SOURCES.txt +9 -1
  4. {hap_python-4.9.2 → hap_python-5.1.0}/HAP_python.egg-info/requires.txt +6 -1
  5. hap_python-5.1.0/MANIFEST.in +1 -0
  6. {hap_python-4.9.2 → hap_python-5.1.0}/PKG-INFO +14 -13
  7. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/accessory.py +3 -1
  8. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/accessory_driver.py +16 -4
  9. hap_python-5.1.0/pyhap/camera.py +1290 -0
  10. hap_python-5.1.0/pyhap/camera_talkback.py +189 -0
  11. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/characteristic.py +52 -3
  12. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/const.py +4 -4
  13. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/encoder.py +1 -0
  14. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/hap_crypto.py +1 -0
  15. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/hap_handler.py +11 -5
  16. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/hap_protocol.py +6 -0
  17. hap_python-5.1.0/pyhap/hds.py +185 -0
  18. hap_python-5.1.0/pyhap/hds_protocol.py +307 -0
  19. hap_python-5.1.0/pyhap/hds_recording.py +263 -0
  20. hap_python-5.1.0/pyhap/hds_server.py +309 -0
  21. hap_python-5.1.0/pyhap/hksv_recording.py +364 -0
  22. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/iid_manager.py +1 -0
  23. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/loader.py +1 -0
  24. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/resources/characteristics.json +141 -2
  25. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/resources/services.json +51 -0
  26. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/state.py +2 -1
  27. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/tlv.py +2 -1
  28. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/util.py +9 -3
  29. {hap_python-4.9.2 → hap_python-5.1.0}/pyproject.toml +55 -1
  30. {hap_python-4.9.2 → hap_python-5.1.0}/setup.cfg +0 -3
  31. {hap_python-4.9.2 → hap_python-5.1.0}/tests/test_accessory.py +12 -16
  32. {hap_python-4.9.2 → hap_python-5.1.0}/tests/test_accessory_driver.py +97 -70
  33. hap_python-5.1.0/tests/test_camera.py +307 -0
  34. {hap_python-4.9.2 → hap_python-5.1.0}/tests/test_characteristic.py +1 -0
  35. {hap_python-4.9.2 → hap_python-5.1.0}/tests/test_encoder.py +1 -0
  36. {hap_python-4.9.2 → hap_python-5.1.0}/tests/test_hap_crypto.py +0 -1
  37. {hap_python-4.9.2 → hap_python-5.1.0}/tests/test_hap_handler.py +15 -15
  38. {hap_python-4.9.2 → hap_python-5.1.0}/tests/test_hap_protocol.py +20 -24
  39. {hap_python-4.9.2 → hap_python-5.1.0}/tests/test_hap_server.py +8 -13
  40. hap_python-5.1.0/tests/test_hds_recording.py +449 -0
  41. hap_python-5.1.0/tests/test_hksv_recording.py +280 -0
  42. {hap_python-4.9.2 → hap_python-5.1.0}/tests/test_iid_manager.py +1 -0
  43. {hap_python-4.9.2 → hap_python-5.1.0}/tests/test_loader.py +1 -0
  44. {hap_python-4.9.2 → hap_python-5.1.0}/tests/test_service.py +18 -12
  45. {hap_python-4.9.2 → hap_python-5.1.0}/tests/test_state.py +23 -14
  46. {hap_python-4.9.2 → hap_python-5.1.0}/tests/test_util.py +1 -0
  47. hap_python-4.9.2/MANIFEST.in +0 -2
  48. hap_python-4.9.2/pyhap/camera.py +0 -898
  49. hap_python-4.9.2/setup.py +0 -68
  50. hap_python-4.9.2/tests/test_camera.py +0 -143
  51. {hap_python-4.9.2 → hap_python-5.1.0}/HAP_python.egg-info/dependency_links.txt +0 -0
  52. {hap_python-4.9.2 → hap_python-5.1.0}/HAP_python.egg-info/top_level.txt +0 -0
  53. {hap_python-4.9.2 → hap_python-5.1.0}/LICENSE +0 -0
  54. {hap_python-4.9.2 → hap_python-5.1.0}/README.md +0 -0
  55. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/__init__.py +0 -0
  56. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/hap_event.py +0 -0
  57. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/hap_server.py +0 -0
  58. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/hsrp.py +0 -0
  59. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/params.py +0 -0
  60. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/resources/snapshot.jpg +0 -0
  61. {hap_python-4.9.2 → hap_python-5.1.0}/pyhap/service.py +0 -0
  62. {hap_python-4.9.2 → hap_python-5.1.0}/tests/test_hsrp.py +0 -0
  63. {hap_python-4.9.2 → hap_python-5.1.0}/tests/test_tlv.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,30 +1,28 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: HAP-python
3
- Version: 4.9.2
3
+ Version: 5.1.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
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: Intended Audience :: End Users/Desktop
13
- Classifier: License :: OSI Approved :: Apache Software License
14
13
  Classifier: Natural Language :: English
15
14
  Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python :: 3.5
17
- Classifier: Programming Language :: Python :: 3.6
18
- Classifier: Programming Language :: Python :: 3.7
19
- Classifier: Programming Language :: Python :: 3.8
20
- Classifier: Programming Language :: Python :: 3.9
21
15
  Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
22
19
  Classifier: Topic :: Home Automation
23
20
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
- Requires-Python: >=3.7
21
+ Requires-Python: >=3.10
25
22
  Description-Content-Type: text/markdown
26
23
  License-File: LICENSE
27
- Requires-Dist: async_timeout
24
+ License-File: AUTHORS
25
+ Requires-Dist: async_timeout; python_version < "3.11"
28
26
  Requires-Dist: cryptography
29
27
  Requires-Dist: chacha20poly1305-reuseable
30
28
  Requires-Dist: orjson>=3.7.2
@@ -33,6 +31,9 @@ Requires-Dist: h11
33
31
  Provides-Extra: qrcode
34
32
  Requires-Dist: base36; extra == "qrcode"
35
33
  Requires-Dist: pyqrcode; extra == "qrcode"
34
+ Provides-Extra: talkback
35
+ Requires-Dist: pylibsrtp; extra == "talkback"
36
+ Dynamic: license-file
36
37
 
37
38
  [![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)
38
39
  # HAP-python
@@ -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
@@ -13,6 +13,7 @@ pyhap/__init__.py
13
13
  pyhap/accessory.py
14
14
  pyhap/accessory_driver.py
15
15
  pyhap/camera.py
16
+ pyhap/camera_talkback.py
16
17
  pyhap/characteristic.py
17
18
  pyhap/const.py
18
19
  pyhap/encoder.py
@@ -21,6 +22,11 @@ pyhap/hap_event.py
21
22
  pyhap/hap_handler.py
22
23
  pyhap/hap_protocol.py
23
24
  pyhap/hap_server.py
25
+ pyhap/hds.py
26
+ pyhap/hds_protocol.py
27
+ pyhap/hds_recording.py
28
+ pyhap/hds_server.py
29
+ pyhap/hksv_recording.py
24
30
  pyhap/hsrp.py
25
31
  pyhap/iid_manager.py
26
32
  pyhap/loader.py
@@ -41,6 +47,8 @@ tests/test_hap_crypto.py
41
47
  tests/test_hap_handler.py
42
48
  tests/test_hap_protocol.py
43
49
  tests/test_hap_server.py
50
+ tests/test_hds_recording.py
51
+ tests/test_hksv_recording.py
44
52
  tests/test_hsrp.py
45
53
  tests/test_iid_manager.py
46
54
  tests/test_loader.py
@@ -1,10 +1,15 @@
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
13
+
14
+ [Talkback]
15
+ pylibsrtp
@@ -0,0 +1 @@
1
+ recursive-include pyhap/resources *
@@ -1,30 +1,28 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: HAP-python
3
- Version: 4.9.2
3
+ Version: 5.1.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
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: Intended Audience :: End Users/Desktop
13
- Classifier: License :: OSI Approved :: Apache Software License
14
13
  Classifier: Natural Language :: English
15
14
  Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python :: 3.5
17
- Classifier: Programming Language :: Python :: 3.6
18
- Classifier: Programming Language :: Python :: 3.7
19
- Classifier: Programming Language :: Python :: 3.8
20
- Classifier: Programming Language :: Python :: 3.9
21
15
  Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
22
19
  Classifier: Topic :: Home Automation
23
20
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
- Requires-Python: >=3.7
21
+ Requires-Python: >=3.10
25
22
  Description-Content-Type: text/markdown
26
23
  License-File: LICENSE
27
- Requires-Dist: async_timeout
24
+ License-File: AUTHORS
25
+ Requires-Dist: async_timeout; python_version < "3.11"
28
26
  Requires-Dist: cryptography
29
27
  Requires-Dist: chacha20poly1305-reuseable
30
28
  Requires-Dist: orjson>=3.7.2
@@ -33,6 +31,9 @@ Requires-Dist: h11
33
31
  Provides-Extra: qrcode
34
32
  Requires-Dist: base36; extra == "qrcode"
35
33
  Requires-Dist: pyqrcode; extra == "qrcode"
34
+ Provides-Extra: talkback
35
+ Requires-Dist: pylibsrtp; extra == "talkback"
36
+ Dynamic: license-file
36
37
 
37
38
  [![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)
38
39
  # HAP-python
@@ -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,7 +208,8 @@ class Accessory:
207
208
  int(self.driver.state.pincode.replace(b"-", b""), 10) & 0x7FFFFFFF
208
209
  ) # pincode
209
210
 
210
- encoded_payload = base36.dumps(payload).upper() # pylint: disable=possibly-used-before-assignment
211
+ # pylint: disable-next=possibly-used-before-assignment
212
+ encoded_payload = base36.dumps(payload).upper()
211
213
  encoded_payload = encoded_payload.rjust(9, "0")
212
214
 
213
215
  return "X-HM://" + encoded_payload + self.driver.state.setup_id
@@ -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.
@@ -291,6 +292,9 @@ class AccessoryDriver:
291
292
  self.persist_file = os.path.expanduser(persist_file)
292
293
  self.encoder = encoder or AccessoryEncoder()
293
294
  self.topics = {} # topic: set of (address, port) of subscribed clients
295
+ # Per-session HAP shared keys, keyed by client (address, port). Needed
296
+ # by transports derived from the session, e.g. HomeKit Data Stream.
297
+ self.session_shared_keys: Dict[Tuple[str, int], bytes] = {}
294
298
  self.loader = loader or Loader()
295
299
  self.aio_stop_event = None
296
300
  self.stop_event = threading.Event()
@@ -321,9 +325,12 @@ class AccessoryDriver:
321
325
  if (
322
326
  threading.current_thread() is threading.main_thread()
323
327
  and os.name != "nt"
328
+ # The child watcher API was removed in Python 3.14; there the
329
+ # default event loop reaps subprocesses without one.
330
+ and hasattr(asyncio, "SafeChildWatcher")
324
331
  ):
325
332
  logger.debug("Setting child watcher")
326
- watcher = asyncio.SafeChildWatcher() # pylint: disable=deprecated-class
333
+ watcher = asyncio.SafeChildWatcher() # pylint: disable=deprecated-class
327
334
  watcher.attach_loop(self.loop)
328
335
  asyncio.set_child_watcher(watcher)
329
336
  else:
@@ -536,6 +543,7 @@ class AccessoryDriver:
536
543
  for topic in client_topics:
537
544
  self.async_subscribe_client_topic(client, topic, subscribe=False)
538
545
  self.prepared_writes.pop(client, None)
546
+ self.session_shared_keys.pop(client, None)
539
547
 
540
548
  def publish(self, data, sender_client_addr=None, immediate=False):
541
549
  """Publishes an event to the client.
@@ -647,7 +655,11 @@ class AccessoryDriver:
647
655
  mode="w", dir=temp_dir, delete=False
648
656
  ) as file_handle:
649
657
  tmp_filename = file_handle.name
650
- logger.debug("Created temp persist file '%s' named '%s'", file_handle, tmp_filename)
658
+ logger.debug(
659
+ "Created temp persist file '%s' named '%s'",
660
+ file_handle,
661
+ tmp_filename,
662
+ )
651
663
  self.encoder.persist(file_handle, self.state)
652
664
  if (
653
665
  os.name == "nt"
@@ -824,7 +836,7 @@ class AccessoryDriver:
824
836
  try:
825
837
  if aid == STANDALONE_AID:
826
838
  char = self.accessory.iid_manager.get_obj(iid)
827
- available = True
839
+ available = self.accessory.available
828
840
  else:
829
841
  acc = self.accessory.accessories.get(aid)
830
842
  if acc is None: