HAP-python 4.9.1__py3-none-any.whl → 4.9.2__py3-none-any.whl

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.
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: HAP-python
3
- Version: 4.9.1
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
@@ -28,8 +27,8 @@ License-File: LICENSE
28
27
  Requires-Dist: async-timeout
29
28
  Requires-Dist: cryptography
30
29
  Requires-Dist: chacha20poly1305-reuseable
31
- Requires-Dist: orjson (>=3.7.2)
32
- Requires-Dist: zeroconf (>=0.36.2)
30
+ Requires-Dist: orjson >=3.7.2
31
+ Requires-Dist: zeroconf >=0.36.2
33
32
  Requires-Dist: h11
34
33
  Provides-Extra: qrcode
35
34
  Requires-Dist: base36 ; extra == 'qrcode'
@@ -310,5 +309,3 @@ please report and I will try to fix them.
310
309
  Suggestions are always welcome.
311
310
 
312
311
  Have fun!
313
-
314
-
@@ -1,15 +1,15 @@
1
1
  pyhap/__init__.py,sha256=m6_RifBB16HaM9isxKRg-JCOg2ro6ZDkrcEDzWMj_J4,497
2
- pyhap/accessory.py,sha256=97yHEzYZQhCHrqb-s00F6YxV0F6E_v6kL3vJ422CN3U,14440
3
- pyhap/accessory_driver.py,sha256=nkSC69vMng3Usf5YU1xzqHrvm_snSfSd5nCDwvpTiMg,36979
2
+ pyhap/accessory.py,sha256=D9x03k0n0lDfChJKVrOj_9806tpLWsRiuJENWvEDZDg,14491
3
+ pyhap/accessory_driver.py,sha256=4-ZplO224ACAQgVFnL0VcWEU5Na7t7stH3uXKyRjT8k,37246
4
4
  pyhap/camera.py,sha256=lxViUQ4n0fELu3EGgWDYNrJo3cSetiOPQhNGQ_qZagk,34149
5
5
  pyhap/characteristic.py,sha256=zWGR5w88I2ypwnEvhSCDmx79KFNR__-rGOgDH7pLF30,15995
6
- pyhap/const.py,sha256=TX38wxV031CRO9fWQXQXs4C92ixst7NnPc8JzLeUGBE,2739
6
+ pyhap/const.py,sha256=A6FnwKhZE5WY0WgqhPNeVQc4OtnLfRU50_5fsdKyqNY,2739
7
7
  pyhap/encoder.py,sha256=1MbKsqRdLY6jaWbp0D7hg1wYxnBCdmNfc0LejPjsIOc,4928
8
- pyhap/hap_crypto.py,sha256=GBOHofLH8ahc7b1MqS7yQz387n_tMuP0VvF2haCYmww,4495
8
+ pyhap/hap_crypto.py,sha256=fCH7fyFVSiVn3Db4loBwPUIQIpIH6cbtarACbXl-OH8,4340
9
9
  pyhap/hap_event.py,sha256=iIF5rfzT-GlpYWFMLwc9FCSJ7E9m7GNm-nCjyKOyGpc,613
10
10
  pyhap/hap_handler.py,sha256=4Q0UXEK2fw_L9mUWpgMnKInAFRGeZFPzgETtpYY5xIE,31301
11
- pyhap/hap_protocol.py,sha256=r9sinAvItQAN66tXDu06tPRIBHjwNBLSKALVx2RS1nc,11720
12
- pyhap/hap_server.py,sha256=JMxp33dcS-InHkF13zb03_OyBeVs9bR5sNAKwSVKNzg,3485
11
+ pyhap/hap_protocol.py,sha256=IQLXUcoGFmtFgYIypwZOHyZujfH_eJSjSHyQwQMQX1Q,11725
12
+ pyhap/hap_server.py,sha256=UVrQxidMpofK7Efjt5PhikyvnGR5mPMDEZCoNIfVmjI,3485
13
13
  pyhap/hsrp.py,sha256=KkuuMnzb-yrMiD7_XFH9Ug1_Rz7iM1BvPYVHam_5uPE,3345
14
14
  pyhap/iid_manager.py,sha256=AvJcncUxuSwlGj3TA8JuUfbPPjwoROq88DvtxTEd_as,2408
15
15
  pyhap/loader.py,sha256=3J4NwvfrohjWy1vX7VTKq9Ynz_kyRXnRP8U-cEEdGCI,2371
@@ -21,9 +21,8 @@ pyhap/util.py,sha256=28hYreeAS6rEzAsQFDGVDtrOnKO-L-Slfe1uboB2KZ0,4586
21
21
  pyhap/resources/characteristics.json,sha256=TZIFyjKDcZTQ5BrmiEpRehLriWUkdZXtQjanpasdwkE,36308
22
22
  pyhap/resources/services.json,sha256=h3GEEhHljXbpjkO9jCtdgrryGjON0AWWtiUkyIEmk9U,14809
23
23
  pyhap/resources/snapshot.jpg,sha256=gEtbqbcZsBS5KIUGPzwpAWJtWCYSNYVFdBz3tDJNtF4,203005
24
- HAP_python-4.9.1.dist-info/AUTHORS,sha256=4HH52IALsP6sVCPC5ubq2JFZLkrNs5CB5C2sv5hIck8,146
25
- HAP_python-4.9.1.dist-info/LICENSE,sha256=LrTeF25wlyXctZssWXE96vBTnfNTOLqUwUOjM9bEgz4,12247
26
- HAP_python-4.9.1.dist-info/METADATA,sha256=EidvsLGVahYkPjXt7Pp43L8BANVPZwyUvyQ2SKZgp-8,13883
27
- HAP_python-4.9.1.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
28
- HAP_python-4.9.1.dist-info/top_level.txt,sha256=gyP7nasmNVouCMu7rblCl6SaFZoFJV7O-F2g9vFi2V0,6
29
- HAP_python-4.9.1.dist-info/RECORD,,
24
+ HAP_python-4.9.2.dist-info/LICENSE,sha256=LrTeF25wlyXctZssWXE96vBTnfNTOLqUwUOjM9bEgz4,12247
25
+ HAP_python-4.9.2.dist-info/METADATA,sha256=wqPourZHAdYc5TVcjoCxtX7jBzg-5l6kZQSWmG-mq_g,13859
26
+ HAP_python-4.9.2.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
27
+ HAP_python-4.9.2.dist-info/top_level.txt,sha256=gyP7nasmNVouCMu7rblCl6SaFZoFJV7O-F2g9vFi2V0,6
28
+ HAP_python-4.9.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.0)
2
+ Generator: setuptools (75.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
pyhap/accessory.py CHANGED
@@ -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
pyhap/accessory_driver.py CHANGED
@@ -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.chmod(self.persist_file, 0o644)
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")
pyhap/const.py CHANGED
@@ -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 = 1
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)
pyhap/hap_crypto.py CHANGED
@@ -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
- # Join the result once instead of concatenating each time
131
- # as this is much faster than generating an new immutable
132
- # byte string each time.
133
- return b"".join(result)
130
+ return result
pyhap/hap_protocol.py CHANGED
@@ -104,7 +104,7 @@ class HAPServerProtocol(asyncio.Protocol):
104
104
  self.handler.client_uuid,
105
105
  data,
106
106
  )
107
- self.transport.write(result)
107
+ self.transport.writelines(result)
108
108
  else:
109
109
  logger.debug(
110
110
  "%s (%s): Send unencrypted: %s",
pyhap/hap_server.py CHANGED
@@ -16,7 +16,7 @@ if TYPE_CHECKING:
16
16
 
17
17
  logger = logging.getLogger(__name__)
18
18
 
19
- IDLE_CONNECTION_CHECK_INTERVAL_SECONDS = 120
19
+ IDLE_CONNECTION_CHECK_INTERVAL_SECONDS = 300
20
20
 
21
21
 
22
22
  class HAPServer:
@@ -1,6 +0,0 @@
1
- cdce8p
2
- jslay88
3
- Ivan Kalchev <ikalchev> - Maintainer of the library
4
- Lee Marlow <lmarlow>
5
- Matthew Schinckel <schinckel>
6
- Miroslav Kudrnac <mkudrnac>