lifx-async 4.7.5__py3-none-any.whl → 4.8.1__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.
@@ -16,7 +16,7 @@ from urllib.request import urlopen
16
16
  from lifx.const import PRODUCTS_URL
17
17
 
18
18
 
19
- def download_products() -> dict[str, Any] | list[dict[str, Any]]:
19
+ def download_products() -> dict[str, Any] | list[dict[str, Any]] | None:
20
20
  """Download and parse products.json from LIFX GitHub repository.
21
21
 
22
22
  Returns:
@@ -27,11 +27,13 @@ def download_products() -> dict[str, Any] | list[dict[str, Any]]:
27
27
  json.JSONDecodeError: If parsing fails
28
28
  """
29
29
  parsed_url = urlparse(PRODUCTS_URL)
30
- if parsed_url.scheme == "https" and parsed_url.netloc.startswith(
31
- "raw.githubusercontent.com"
30
+ if (
31
+ parsed_url.scheme == "https"
32
+ and parsed_url.netloc == "raw.githubusercontent.com"
33
+ and parsed_url.path.startswith("/LIFX/")
32
34
  ):
33
- print(f"Downloading products.json from {PRODUCTS_URL}...")
34
- with urlopen(PRODUCTS_URL) as response: # nosec B310
35
+ print(f"Downloading products.json from {parsed_url.geturl()}...")
36
+ with urlopen(parsed_url.geturl()) as response: # nosec B310
35
37
  products_data = response.read()
36
38
 
37
39
  print("Parsing products specification...")
@@ -1397,7 +1397,7 @@ from lifx.protocol.base import Packet
1397
1397
  return code
1398
1398
 
1399
1399
 
1400
- def download_protocol() -> dict[str, Any]:
1400
+ def download_protocol() -> dict[str, Any] | None:
1401
1401
  """Download and parse protocol.yml from LIFX GitHub repository.
1402
1402
 
1403
1403
  Returns:
@@ -1408,11 +1408,13 @@ def download_protocol() -> dict[str, Any]:
1408
1408
  yaml.YAMLError: If parsing fails
1409
1409
  """
1410
1410
  parsed_url = urlparse(PROTOCOL_URL)
1411
- if parsed_url.scheme == "https" and parsed_url.netloc.startswith(
1412
- "raw.githubusercontent.com"
1411
+ if (
1412
+ parsed_url.scheme == "https"
1413
+ and parsed_url.netloc == "raw.githubusercontent.com"
1414
+ and parsed_url.path.startswith("/LIFX/")
1413
1415
  ):
1414
- print(f"Downloading protocol.yml from {PROTOCOL_URL}...")
1415
- with urlopen(PROTOCOL_URL) as response: # nosec B310
1416
+ print(f"Downloading protocol.yml from {parsed_url.geturl()}...")
1417
+ with urlopen(parsed_url.geturl()) as response: # nosec B310
1416
1418
  protocol_data = response.read()
1417
1419
 
1418
1420
  print("Parsing protocol specification...")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lifx-async
3
- Version: 4.7.5
3
+ Version: 4.8.1
4
4
  Summary: A modern, type-safe, async Python library for controlling LIFX lights
5
5
  Author-email: Avi Miller <me@dje.li>
6
6
  Maintainer-email: Avi Miller <me@dje.li>
@@ -1,7 +1,7 @@
1
- lifx/__init__.py,sha256=aiMLKLhmcXADJyeISNHIZ_Nuc6jEhPG8-I_R3peWpwo,2610
2
- lifx/api.py,sha256=XV2CJLi3N9UpbZuqVE56K-MEsSaqOte9WhcBbhkmHQM,33962
1
+ lifx/__init__.py,sha256=DKHG1vFJvPw_LpMkQgZN85gyOSD8dnceq6LnEGgR9vs,2810
2
+ lifx/api.py,sha256=xHUM6NDgv8V8tLpDtpnPVJNGcVU5y_8da9wI3pnm06Y,35903
3
3
  lifx/color.py,sha256=wcmeeiBmOAjunInERNd6rslKvBEpV4vfjwwiZ8v7H8A,17877
4
- lifx/const.py,sha256=cf_O_3TqJjIBXF1tI35PkJ1JOhmy4tRt14PSa63pilA,3471
4
+ lifx/const.py,sha256=5LEh4h0-bEJlOfpG8fgyht0LkAEV9jkkpuCiuatBhEI,3840
5
5
  lifx/exceptions.py,sha256=pikAMppLn7gXyjiQVWM_tSvXKNh-g366nG_UWyqpHhc,815
6
6
  lifx/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  lifx/devices/__init__.py,sha256=4b5QtO0EFWxIqN2lUYgM8uLjWyHI5hUcReiF9QCjCGw,1061
@@ -25,13 +25,18 @@ lifx/network/connection.py,sha256=aerPiYWf096lq8oBiS7JfE4k-P18GS50mNEC4TYa2g8,38
25
25
  lifx/network/discovery.py,sha256=syFfkDYWo0AEoBdEBjWqBm4K7UJwZW5x2K0FBMiA2I0,24186
26
26
  lifx/network/message.py,sha256=jCLC9v0tbBi54g5CaHLFM_nP1Izu8kJmo2tt23HHBbA,2600
27
27
  lifx/network/transport.py,sha256=8QS0YV32rdP0EDiPEwuvZXbplRWL08pmjKybd87mkZ0,11070
28
+ lifx/network/mdns/__init__.py,sha256=LlZgsFe6q5_SIXvXqtuZ_O9tJbcJZ-nsFkD2_wD8_TM,1412
29
+ lifx/network/mdns/discovery.py,sha256=EZ2zlJmy96rMDmu5J-68ystXJ2gYa18zTYP3iqmTGgU,13200
30
+ lifx/network/mdns/dns.py,sha256=OsvNSxLepIG3Nhw-kkQF3JrBYI-ikod5SHD2HO5_yGE,9363
31
+ lifx/network/mdns/transport.py,sha256=k8gVZCvU-gksV2dV-jm2YG-_kuKWx0whtP3Va0EjCd8,10242
32
+ lifx/network/mdns/types.py,sha256=9fhH5iuMQxLkFPhmFTf2-kOcUNoWEu7LrN15Qr9tFE0,990
28
33
  lifx/products/__init__.py,sha256=pf2O-fzt6nOrQd-wmzhiog91tMiGa-dDbaSNtU2ZQfE,764
29
- lifx/products/generator.py,sha256=5bDFfrJ8ocwuhEr4dZB4LpVcqOqC3KxJSDiphPMu8CI,15660
34
+ lifx/products/generator.py,sha256=DsTCJcEVPmn9sfXSbXYdFZjqMfIbodnIQL46DRASs0g,15731
30
35
  lifx/products/quirks.py,sha256=B8Kb4pxaXmovMbjgXRfPPWre5JEvJrn8d6PAWK_FT1U,2544
31
36
  lifx/products/registry.py,sha256=ILIJlQxcxJUzRH-LGU_bnHjV-TxDEucKovuJcWvG4q8,43831
32
37
  lifx/protocol/__init__.py,sha256=-wjC-wBcb7fxi5I-mJr2Ad8K2YRflJFdLLdobfD-W1Q,56
33
38
  lifx/protocol/base.py,sha256=x4cKT5sbaEmILbmPH3y5Lwk6gj3h9Xv_JvTX91cPQwM,12354
34
- lifx/protocol/generator.py,sha256=bmLjr8xNClD-kfo9_z4CTDIiP1OkmPcNsD2Mkz41NhA,60619
39
+ lifx/protocol/generator.py,sha256=RWu4zC-b_JhonLM5fbAufQyKxEI2myLyCnt7tu3POMI,60690
35
40
  lifx/protocol/header.py,sha256=HaYQ5wEjAMgefO3dIxKb0w4VG4fLcfLj-fnHVwfp1ao,7174
36
41
  lifx/protocol/models.py,sha256=eOvOSAWbglR1SYWcC_YpicewtsdbVlQ6E2lfcC4NQrk,8172
37
42
  lifx/protocol/packets.py,sha256=ENp3irGITdV5rGah3eUzgsXqihI95upAPh7AdTsP7sk,43303
@@ -42,7 +47,7 @@ lifx/theme/canvas.py,sha256=4h7lgN8iu_OdchObGDgbxTqQLCb-FRKC-M-YCWef_i4,8048
42
47
  lifx/theme/generators.py,sha256=nq3Yvntq_h-eFHbmmow3LcAdA_hEbRRaP5mv9Bydrjk,6435
43
48
  lifx/theme/library.py,sha256=tKlKZNqJp8lRGDnilWyDm_Qr1vCRGGwuvWVS82anNpQ,21326
44
49
  lifx/theme/theme.py,sha256=qMEx_8E41C0Cc6f083XHiAXEglTv4YlXW0UFsG1rQKg,5521
45
- lifx_async-4.7.5.dist-info/METADATA,sha256=1SN5XqtWLHrF_JtLHyWGNSCCeoajcu32g0MWFC48VIM,2609
46
- lifx_async-4.7.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
47
- lifx_async-4.7.5.dist-info/licenses/LICENSE,sha256=eBz48GRA3gSiWn3rYZAz2Ewp35snnhV9cSqkVBq7g3k,1832
48
- lifx_async-4.7.5.dist-info/RECORD,,
50
+ lifx_async-4.8.1.dist-info/METADATA,sha256=Euz_zOCJMdS0w1GJ4D1nBKJJMdEMEdNFzTqB3mcZOAM,2609
51
+ lifx_async-4.8.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
52
+ lifx_async-4.8.1.dist-info/licenses/LICENSE,sha256=eBz48GRA3gSiWn3rYZAz2Ewp35snnhV9cSqkVBq7g3k,1832
53
+ lifx_async-4.8.1.dist-info/RECORD,,