aioccl 2025.4__py3-none-any.whl → 2025.4.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.
aioccl/server.py CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from http import HTTPStatus
5
6
  import logging
6
7
 
7
8
  from aiohttp import web
@@ -43,22 +44,22 @@ class CCLServer:
43
44
  if passkey == ref_passkey:
44
45
  device = ref_device
45
46
  break
46
- assert isinstance(device, CCLDevice), 404
47
+ assert isinstance(device, CCLDevice), HTTPStatus.NOT_FOUND
47
48
 
48
- assert request.content_type == "application/json", 400
49
- assert 0 < request.content_length <= 5000, 400
49
+ assert request.content_type == "application/json", HTTPStatus.BAD_REQUEST
50
+ assert 0 < request.content_length <= 5000, HTTPStatus.BAD_REQUEST
50
51
 
51
52
  body = await request.json()
52
53
 
53
54
  except Exception as err: # pylint: disable=broad-exception-caught
54
55
  status = err.args[0]
55
- if status == 400:
56
- text = "400 Bad Request"
57
- elif status == 404:
58
- text = "404 Not Found"
56
+ if status == HTTPStatus.BAD_REQUEST:
57
+ text = "400 Bad Request."
58
+ elif status == HTTPStatus.NOT_FOUND:
59
+ text = "404 Not Found."
59
60
  else:
60
- status = 500
61
- text = "500 Internal Server Error"
61
+ status = HTTPStatus.INTERNAL_SERVER_ERROR
62
+ text = "500 Internal Server Error."
62
63
  _LOGGER.debug("Request exception occured: %s", err)
63
64
  return web.Response(status=status, text=text)
64
65
 
@@ -70,7 +71,7 @@ class CCLServer:
70
71
 
71
72
  device.update_info(info)
72
73
  device.process_data(data)
73
- status = 200
74
+ status = HTTPStatus.OK
74
75
  text = "200 OK"
75
76
  _LOGGER.debug("Request processed: %s", passkey)
76
77
  return web.Response(status=status, text=text)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aioccl
3
- Version: 2025.4
3
+ Version: 2025.4.1
4
4
  Summary: A Python library for CCL API server
5
5
  Home-page: https://github.com/CCL-Electronics-Ltd/aioccl
6
6
  Download-URL: https://github.com/CCL-Electronics-Ltd/aioccl
@@ -0,0 +1,9 @@
1
+ aioccl/__init__.py,sha256=XnegKtbvHvUTwVuuWNLb4LB9ZuGGar0xrZYOqk7scyg,133
2
+ aioccl/device.py,sha256=7UUEcg__1Q-gug8E5nuTAP_TWVeyoeuZSvNNUjIwJ1g,5691
3
+ aioccl/sensor.py,sha256=-yWdgBzOzLPHP2GBqvhVVGbIlt17y_3OSHibhB_DsQ8,16905
4
+ aioccl/server.py,sha256=niD0h2i6rS1qr4vCmepwEBhVIylvVGt7_WbBO0-Z1Rs,3377
5
+ aioccl-2025.4.1.dist-info/licenses/LICENSE,sha256=PBRsTHchx7o0TQ2R2ktEAfFmn1iNHTxcOP_xaeuSAuo,11349
6
+ aioccl-2025.4.1.dist-info/METADATA,sha256=ji9-K-ycxbCAYi6wlmFwdkk30DUMKKQ7mc280er0vtA,991
7
+ aioccl-2025.4.1.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
8
+ aioccl-2025.4.1.dist-info/top_level.txt,sha256=-xIJfyfXTaW_EH7XCIHyxjSSSwjLmawa2qhsrHZH1vA,7
9
+ aioccl-2025.4.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.1)
2
+ Generator: setuptools (79.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,9 +0,0 @@
1
- aioccl/__init__.py,sha256=XnegKtbvHvUTwVuuWNLb4LB9ZuGGar0xrZYOqk7scyg,133
2
- aioccl/device.py,sha256=7UUEcg__1Q-gug8E5nuTAP_TWVeyoeuZSvNNUjIwJ1g,5691
3
- aioccl/sensor.py,sha256=-yWdgBzOzLPHP2GBqvhVVGbIlt17y_3OSHibhB_DsQ8,16905
4
- aioccl/server.py,sha256=RvWH6hqlQDq82u_8oO69SA0qeCDWGdVoi0wb5uYKQrs,3216
5
- aioccl-2025.4.dist-info/licenses/LICENSE,sha256=PBRsTHchx7o0TQ2R2ktEAfFmn1iNHTxcOP_xaeuSAuo,11349
6
- aioccl-2025.4.dist-info/METADATA,sha256=e5mkGmPL4RnVj1XCNqXRW8NOybwroWVyhlezyIe6yCY,989
7
- aioccl-2025.4.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
8
- aioccl-2025.4.dist-info/top_level.txt,sha256=-xIJfyfXTaW_EH7XCIHyxjSSSwjLmawa2qhsrHZH1vA,7
9
- aioccl-2025.4.dist-info/RECORD,,