aioccl 2024.1__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.
aioccl-2024.1/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2024 CCL Electronics Ltd
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
aioccl-2024.1/PKG-INFO ADDED
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.4
2
+ Name: aioccl
3
+ Version: 2024.1
4
+ Summary: A Python library for CCL API server
5
+ Home-page: https://github.com/fkiscd/aioccl
6
+ Download-URL: https://github.com/fkiscd/aioccl
7
+ Author: fkiscd
8
+ Author-email: fkiscd@gmail.com
9
+ License: Apache License, Version 2.0
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Natural Language :: English
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Topic :: Home Automation
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: aiohttp>3
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: description-content-type
25
+ Dynamic: download-url
26
+ Dynamic: home-page
27
+ Dynamic: license
28
+ Dynamic: license-file
29
+ Dynamic: requires-dist
30
+ Dynamic: summary
31
+
32
+ # aioCCL
33
+ A Python library for CCL API server
@@ -0,0 +1,2 @@
1
+ # aioCCL
2
+ A Python library for CCL API server
@@ -0,0 +1,5 @@
1
+ """aioCCL API wrapper."""
2
+
3
+ from .device import CCLDevice
4
+ from .sensor import CCLSensor, CCLSensorTypes
5
+ from .server import CCLServer
@@ -0,0 +1,194 @@
1
+ """CCL device mapping."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import logging
6
+ import time
7
+ from typing import Callable, TypedDict
8
+
9
+ from .sensor import CCLSensor, CCL_SENSORS
10
+
11
+ _LOGGER = logging.getLogger(__name__)
12
+
13
+ CCL_DEVICE_INFO_TYPES = ("serial_no", "mac_address", "model", "fw_ver")
14
+
15
+
16
+ class CCLDevice:
17
+ """Mapping for a CCL device."""
18
+
19
+ def __init__(self, passkey: str):
20
+ """Initialize a CCL device."""
21
+
22
+ class Info(TypedDict):
23
+ """Store device information."""
24
+ fw_ver: str | None
25
+ last_update_time: float | None
26
+ mac_address: str | None
27
+ model: str | None
28
+ passkey: str
29
+ serial_no: str | None
30
+
31
+ self._info: Info = {
32
+ "fw_ver": None,
33
+ "last_update_time": None,
34
+ "mac_address": None,
35
+ "model": None,
36
+ "passkey": passkey,
37
+ "serial_no": None,
38
+ }
39
+
40
+ self._binary_sensors: dict[str, CCLSensor] | None = {}
41
+ self._sensors: dict[str, CCLSensor] | None = {}
42
+ self._update_callbacks = {}
43
+
44
+ self._new_binary_sensor_callbacks = set()
45
+ self._new_sensors: list[CCLSensor] | None = []
46
+ self._new_sensor_callbacks = set()
47
+
48
+ @property
49
+ def passkey(self) -> str:
50
+ """Return the passkey."""
51
+ return self._info["passkey"]
52
+
53
+ @property
54
+ def device_id(self) -> str | None:
55
+ """Return the device ID."""
56
+ if self.mac_address is None:
57
+ return None
58
+ return self.mac_address.replace(":", "").lower()[-6:]
59
+
60
+ @property
61
+ def last_update_time(self) -> str | None:
62
+ """Return the last update time."""
63
+ return self._info["last_update_time"]
64
+
65
+ @property
66
+ def name(self) -> str | None:
67
+ """Return the display name."""
68
+ if self.device_id is not None:
69
+ return self.model + " - " + self.device_id
70
+ return self._info["model"]
71
+
72
+ @property
73
+ def mac_address(self) -> str | None:
74
+ """Return the MAC address."""
75
+ return self._info["mac_address"]
76
+
77
+ @property
78
+ def model(self) -> str | None:
79
+ """Return the model."""
80
+ return self._info["model"]
81
+
82
+ @property
83
+ def fw_ver(self) -> str | None:
84
+ """Return the firmware version."""
85
+ return self._info["fw_ver"]
86
+
87
+ @property
88
+ def binary_sensors(self) -> dict[str, CCLSensor] | None:
89
+ """Store binary sensor data under this device."""
90
+ return self._binary_sensors
91
+
92
+ @property
93
+ def sensors(self) -> dict[str, CCLSensor] | None:
94
+ """Store sensor data under this device."""
95
+ return self._sensors
96
+
97
+ def update_info(self, new_info: dict[str, None | str]) -> None:
98
+ """Add or update device info."""
99
+ for key, value in new_info.items():
100
+ if key in self._info:
101
+ self._info[key] = str(value)
102
+ self._info["last_update_time"] = time.monotonic()
103
+
104
+ def update_sensors(self, sensors: dict[str, None | str | int | float]) -> None:
105
+ """Add or update all sensor values."""
106
+ for key, value in sensors.items():
107
+ if CCL_SENSORS.get(key).binary:
108
+ if key not in self.binary_sensors:
109
+ self._binary_sensors[key] = CCLSensor(key)
110
+ self._new_sensors.append(self.binary_sensors[key])
111
+ self._binary_sensors[key].value = value
112
+ else:
113
+ if key not in self.sensors:
114
+ self._sensors[key] = CCLSensor(key)
115
+ self._new_sensors.append(self.sensors[key])
116
+ self._sensors[key].value = value
117
+
118
+ add_count = self._publish_new_sensors()
119
+ _LOGGER.debug(
120
+ "Added %s new sensors for device %s at %s.",
121
+ add_count,
122
+ self.device_id,
123
+ self.last_update_time,
124
+ )
125
+
126
+ update_count = self._publish_updates()
127
+ _LOGGER.debug(
128
+ "Updated %s sensors in total for device %s at %s.",
129
+ update_count,
130
+ self.device_id,
131
+ self.last_update_time,
132
+ )
133
+
134
+ def register_update_cb(self, sensor_key, callback: Callable[[], None]) -> None:
135
+ """Register callback, called when Sensor changes state."""
136
+ self._update_callbacks[sensor_key] = callback
137
+
138
+ def remove_update_cb(self, sensor_key, callback: Callable[[], None]) -> None:
139
+ """Remove previously registered callback."""
140
+ self._update_callbacks.pop(sensor_key, None)
141
+
142
+ def _publish_updates(self) -> int:
143
+ """Schedule call all registered callbacks."""
144
+ count = 0
145
+ for sensor_key, callback in self._update_callbacks.items():
146
+ try:
147
+ callback()
148
+ count += 1
149
+ except Exception as err: # pylint: disable=broad-exception-caught
150
+ _LOGGER.warning(
151
+ "Error while updating sensor %s for device %s: %s",
152
+ sensor_key,
153
+ self.device_id,
154
+ err,
155
+ )
156
+ return count
157
+
158
+ def register_new_binary_sensor_cb(self, callback: Callable[[], None]) -> None:
159
+ """Register callback, called when Sensor changes state."""
160
+ self._new_binary_sensor_callbacks.add(callback)
161
+
162
+ def remove_new_binary_sensor_cb(self, callback: Callable[[], None]) -> None:
163
+ """Remove previously registered callback."""
164
+ self._new_binary_sensor_callbacks.discard(callback)
165
+
166
+ def register_new_sensor_cb(self, callback: Callable[[], None]) -> None:
167
+ """Register callback, called when Sensor changes state."""
168
+ self._new_sensor_callbacks.add(callback)
169
+
170
+ def remove_new_sensor_cb(self, callback: Callable[[], None]) -> None:
171
+ """Remove previously registered callback."""
172
+ self._new_sensor_callbacks.discard(callback)
173
+
174
+ def _publish_new_sensors(self) -> None:
175
+ """Schedule call all registered callbacks."""
176
+ count = 0
177
+ for sensor in self._new_sensors[:]:
178
+ try:
179
+ if sensor.binary:
180
+ for callback in self._new_binary_sensor_callbacks:
181
+ callback(sensor)
182
+ else:
183
+ for callback in self._new_sensor_callbacks:
184
+ callback(sensor)
185
+ self._new_sensors.remove(sensor)
186
+ count += 1
187
+ except Exception as err: # pylint: disable=broad-exception-caught
188
+ _LOGGER.warning(
189
+ "Error while adding sensor %s for device %s: %s",
190
+ sensor.key,
191
+ self.device_id,
192
+ err,
193
+ )
194
+ return count
@@ -0,0 +1,528 @@
1
+ """CCL sensor mapping."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from dataclasses import dataclass
6
+ import enum
7
+
8
+
9
+ class CCLSensor:
10
+ """Class that represents a CCLSensor object in the aioCCL API."""
11
+
12
+ def __init__(self, key: str):
13
+ """Initialize a CCL sensor."""
14
+ self._value: None | str | int | float = None
15
+
16
+ if key in CCL_SENSORS:
17
+ self._key = key
18
+
19
+ @property
20
+ def key(self) -> str:
21
+ """Key ID of the sensor."""
22
+ return self._key
23
+
24
+ @property
25
+ def name(self) -> str:
26
+ """Display name of the sensor."""
27
+ return CCL_SENSORS[self._key].name
28
+
29
+ @property
30
+ def sensor_type(self) -> CCLSensorTypes:
31
+ """Type of the sensor."""
32
+ return CCL_SENSORS[self._key].sensor_type
33
+
34
+ @property
35
+ def compartment(self) -> None | str:
36
+ """Decide which compartment it belongs to."""
37
+ if CCL_SENSORS[self._key].compartment in CCLDeviceCompartment:
38
+ return CCL_SENSORS[self._key].compartment.value
39
+ return None
40
+
41
+ @property
42
+ def binary(self) -> bool:
43
+ """Decide if the sensor is binary."""
44
+ return CCL_SENSORS[self._key].binary
45
+
46
+ @property
47
+ def value(self) -> None | str | int | float:
48
+ """Return the intrinsic sensor value."""
49
+ if self.sensor_type.name in CCL_SENSOR_VALUES:
50
+ return CCL_SENSOR_VALUES[self.sensor_type.name].get(self._value)
51
+ if self.sensor_type == CCLSensorTypes.BATTERY_BINARY:
52
+ try:
53
+ return int(self._value) - 1
54
+ except ValueError:
55
+ pass
56
+ return self._value
57
+
58
+ @value.setter
59
+ def value(self, new_value):
60
+ self._value = new_value
61
+
62
+
63
+ @dataclass
64
+ class CCLSensorPreset:
65
+ """Attributes of a CCL sensor."""
66
+
67
+ name: str
68
+ sensor_type: str
69
+ compartment: CCLDeviceCompartment | None = None
70
+ binary: bool = False
71
+
72
+
73
+ class CCLSensorTypes(enum.Enum):
74
+ """List of CCL sensor types."""
75
+
76
+ PRESSURE = 1
77
+ TEMPERATURE = 2
78
+ HUMIDITY = 3
79
+ WIND_DIRECITON = 4
80
+ WIND_SPEED = 5
81
+ RAIN_RATE = 6
82
+ RAINFALL = 7
83
+ UVI = 8
84
+ RADIATION = 9
85
+ BATTERY_BINARY = 10
86
+ CONNECTION = 11
87
+ CH_SENSOR_TYPE = 12
88
+ CO = 13
89
+ CO2 = 14
90
+ VOLATILE = 15
91
+ VOC = 16
92
+ PM10 = 17
93
+ PM25 = 18
94
+ AQI = 19
95
+ LEAKAGE = 20
96
+ BATTERY = 21
97
+ LIGHTNING_DISTANCE = 22
98
+ LIGHTNING_DURATION = 23
99
+ LIGHTNING_FREQUENCY = 24
100
+ BATTERY_VOLTAGE = 25
101
+
102
+
103
+ class CCLDeviceCompartment(enum.Enum):
104
+ """Grouping of CCL sensors."""
105
+
106
+ MAIN = "Console & Sensor Array"
107
+ OTHER = "Other Sensors"
108
+ STATUS = "Status"
109
+
110
+
111
+ CCL_SENSOR_VALUES: dict[str, dict[str, str]] = {
112
+ "CH_SENSOR_TYPE": {
113
+ 2: "thermo-hygro",
114
+ 3: "pool",
115
+ 4: "soil",
116
+ },
117
+ "LEAKAGE": {
118
+ 0: "no_leak",
119
+ 1: "leaking",
120
+ },
121
+ }
122
+
123
+ CCL_SENSORS: dict[str, CCLSensorPreset] = {
124
+ # Main Sensors 12-34
125
+ "abar": CCLSensorPreset(
126
+ "Air Pressure (Absolute)", CCLSensorTypes.PRESSURE, CCLDeviceCompartment.MAIN
127
+ ),
128
+ "rbar": CCLSensorPreset(
129
+ "Air Pressure (Relative)", CCLSensorTypes.PRESSURE, CCLDeviceCompartment.MAIN
130
+ ),
131
+ "t1dew": CCLSensorPreset(
132
+ "Index: Dew Point", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN
133
+ ),
134
+ "t1feels": CCLSensorPreset(
135
+ "Index: Feels Like", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN
136
+ ),
137
+ "t1heat": CCLSensorPreset(
138
+ "Index: Heat Index", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN
139
+ ),
140
+ "t1wbgt": CCLSensorPreset(
141
+ "Index: WBGT", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN
142
+ ),
143
+ "t1chill": CCLSensorPreset(
144
+ "Index: Wind Chill", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN
145
+ ),
146
+ "inhum": CCLSensorPreset(
147
+ "Indoor Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.MAIN
148
+ ),
149
+ "intem": CCLSensorPreset(
150
+ "Indoor Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN
151
+ ),
152
+ "t1solrad": CCLSensorPreset(
153
+ "Light Intensity", CCLSensorTypes.RADIATION, CCLDeviceCompartment.MAIN
154
+ ),
155
+ "t1hum": CCLSensorPreset(
156
+ "Outdoor Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.MAIN
157
+ ),
158
+ "t1tem": CCLSensorPreset(
159
+ "Outdoor Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN
160
+ ),
161
+ "t1rainra": CCLSensorPreset(
162
+ "Rain Rate", CCLSensorTypes.RAIN_RATE, CCLDeviceCompartment.MAIN
163
+ ),
164
+ "t1rainhr": CCLSensorPreset(
165
+ "Rainfall: Hourly ", CCLSensorTypes.RAINFALL, CCLDeviceCompartment.MAIN
166
+ ),
167
+ "t1raindy": CCLSensorPreset(
168
+ "Rainfall: Daily", CCLSensorTypes.RAINFALL, CCLDeviceCompartment.MAIN
169
+ ),
170
+ "t1rainwy": CCLSensorPreset(
171
+ "Rainfall: Weekly", CCLSensorTypes.RAINFALL, CCLDeviceCompartment.MAIN
172
+ ),
173
+ "t1rainmth": CCLSensorPreset(
174
+ "Rainfall: Monthly", CCLSensorTypes.RAINFALL, CCLDeviceCompartment.MAIN
175
+ ),
176
+ "t1rainyr": CCLSensorPreset(
177
+ "Rainfall: Yearly", CCLSensorTypes.RAINFALL, CCLDeviceCompartment.MAIN
178
+ ),
179
+ "t1uvi": CCLSensorPreset("UV Index", CCLSensorTypes.UVI, CCLDeviceCompartment.MAIN),
180
+ "t1wdir": CCLSensorPreset(
181
+ "Wind Direction", CCLSensorTypes.WIND_DIRECITON, CCLDeviceCompartment.MAIN
182
+ ),
183
+ "t1wgust": CCLSensorPreset(
184
+ "Wind Gust", CCLSensorTypes.WIND_SPEED, CCLDeviceCompartment.MAIN
185
+ ),
186
+ "t1ws": CCLSensorPreset(
187
+ "Wind Speed", CCLSensorTypes.WIND_SPEED, CCLDeviceCompartment.MAIN
188
+ ),
189
+ "t1ws10mav": CCLSensorPreset(
190
+ "Wind Speed (10 mins AVG.)",
191
+ CCLSensorTypes.WIND_SPEED,
192
+ CCLDeviceCompartment.MAIN,
193
+ ),
194
+ # Additional Sensors 35-77
195
+ "t11co": CCLSensorPreset(
196
+ "Air Quality: CO", CCLSensorTypes.CO, CCLDeviceCompartment.OTHER
197
+ ),
198
+ "t10co2": CCLSensorPreset(
199
+ "Air Quality: CO\u2082", CCLSensorTypes.CO2, CCLDeviceCompartment.OTHER
200
+ ),
201
+ "t9hcho": CCLSensorPreset(
202
+ "Air Quality: HCHO", CCLSensorTypes.VOLATILE, CCLDeviceCompartment.OTHER
203
+ ),
204
+ "t8pm10": CCLSensorPreset(
205
+ "Air Quality: PM10", CCLSensorTypes.PM10, CCLDeviceCompartment.OTHER
206
+ ),
207
+ "t8pm10ai": CCLSensorPreset(
208
+ "Air Quality: PM10 AQI", CCLSensorTypes.AQI, CCLDeviceCompartment.OTHER
209
+ ),
210
+ "t8pm25": CCLSensorPreset(
211
+ "Air Quality: PM2.5", CCLSensorTypes.PM25, CCLDeviceCompartment.OTHER
212
+ ),
213
+ "t8pm25ai": CCLSensorPreset(
214
+ "Air Quality: PM2.5 AQI", CCLSensorTypes.AQI, CCLDeviceCompartment.OTHER
215
+ ),
216
+ "t9voclv": CCLSensorPreset(
217
+ "Air Quality: VOC Level", CCLSensorTypes.VOC, CCLDeviceCompartment.OTHER
218
+ ),
219
+ "t234c1tem": CCLSensorPreset(
220
+ "CH1 Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER
221
+ ),
222
+ "t234c1hum": CCLSensorPreset(
223
+ "CH1 Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER
224
+ ),
225
+ "t234c1tp": CCLSensorPreset(
226
+ "CH1 Type", CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER
227
+ ),
228
+ "t234c2tem": CCLSensorPreset(
229
+ "CH2 Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER
230
+ ),
231
+ "t234c2hum": CCLSensorPreset(
232
+ "CH2 Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER
233
+ ),
234
+ "t234c2tp": CCLSensorPreset(
235
+ "CH2 Type", CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER
236
+ ),
237
+ "t234c3tem": CCLSensorPreset(
238
+ "CH3 Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER
239
+ ),
240
+ "t234c3hum": CCLSensorPreset(
241
+ "CH3 Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER
242
+ ),
243
+ "t234c3tp": CCLSensorPreset(
244
+ "CH3 Type", CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER
245
+ ),
246
+ "t234c4tem": CCLSensorPreset(
247
+ "CH4 Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER
248
+ ),
249
+ "t234c4hum": CCLSensorPreset(
250
+ "CH4 Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER
251
+ ),
252
+ "t234c4tp": CCLSensorPreset(
253
+ "CH4 Type", CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER
254
+ ),
255
+ "t234c5tem": CCLSensorPreset(
256
+ "CH5 Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER
257
+ ),
258
+ "t234c5hum": CCLSensorPreset(
259
+ "CH5 Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER
260
+ ),
261
+ "t234c5tp": CCLSensorPreset(
262
+ "CH5 Type", CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER
263
+ ),
264
+ "t234c6tem": CCLSensorPreset(
265
+ "CH6 Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER
266
+ ),
267
+ "t234c6hum": CCLSensorPreset(
268
+ "CH6 Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER
269
+ ),
270
+ "t234c6tp": CCLSensorPreset(
271
+ "CH6 Type", CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER
272
+ ),
273
+ "t234c7tem": CCLSensorPreset(
274
+ "CH7 Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER
275
+ ),
276
+ "t234c7hum": CCLSensorPreset(
277
+ "CH7 Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER
278
+ ),
279
+ "t234c7tp": CCLSensorPreset(
280
+ "CH7 Type", CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER
281
+ ),
282
+ "t6c1wls": CCLSensorPreset(
283
+ "Leakage CH1", CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER
284
+ ),
285
+ "t6c2wls": CCLSensorPreset(
286
+ "Leakage CH2", CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER
287
+ ),
288
+ "t6c3wls": CCLSensorPreset(
289
+ "Leakage CH3", CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER
290
+ ),
291
+ "t6c4wls": CCLSensorPreset(
292
+ "Leakage CH4", CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER
293
+ ),
294
+ "t6c5wls": CCLSensorPreset(
295
+ "Leakage CH5", CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER
296
+ ),
297
+ "t6c6wls": CCLSensorPreset(
298
+ "Leakage CH6", CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER
299
+ ),
300
+ "t6c7wls": CCLSensorPreset(
301
+ "Leakage CH7", CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER
302
+ ),
303
+ "t5lskm": CCLSensorPreset(
304
+ "Lightning Distance",
305
+ CCLSensorTypes.LIGHTNING_DISTANCE,
306
+ CCLDeviceCompartment.OTHER,
307
+ ),
308
+ "t5lsf": CCLSensorPreset(
309
+ "Lightning: Past 60 mins Strikes",
310
+ CCLSensorTypes.LIGHTNING_FREQUENCY,
311
+ CCLDeviceCompartment.OTHER,
312
+ ),
313
+ "t5ls30mtc": CCLSensorPreset(
314
+ "Lightning: Strikes in 30 mins",
315
+ CCLSensorTypes.LIGHTNING_FREQUENCY,
316
+ CCLDeviceCompartment.OTHER,
317
+ ),
318
+ "t5ls5mtc": CCLSensorPreset(
319
+ "Lightning: Strikes in 5 mins",
320
+ CCLSensorTypes.LIGHTNING_FREQUENCY,
321
+ CCLDeviceCompartment.OTHER,
322
+ ),
323
+ "t5ls1dtc": CCLSensorPreset(
324
+ "Lightning: Strikes in day",
325
+ CCLSensorTypes.LIGHTNING_FREQUENCY,
326
+ CCLDeviceCompartment.OTHER,
327
+ ),
328
+ "t5ls1htc": CCLSensorPreset(
329
+ "Lightning: Strikes in hour",
330
+ CCLSensorTypes.LIGHTNING_FREQUENCY,
331
+ CCLDeviceCompartment.OTHER,
332
+ ),
333
+ # Status 78-119
334
+ "t234c1bat": CCLSensorPreset(
335
+ "Battery: CH1", CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True
336
+ ),
337
+ "t234c2bat": CCLSensorPreset(
338
+ "Battery: CH2", CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True
339
+ ),
340
+ "t234c3bat": CCLSensorPreset(
341
+ "Battery: CH3", CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True
342
+ ),
343
+ "t234c4bat": CCLSensorPreset(
344
+ "Battery: CH4", CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True
345
+ ),
346
+ "t234c5bat": CCLSensorPreset(
347
+ "Battery: CH5", CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True
348
+ ),
349
+ "t234c6bat": CCLSensorPreset(
350
+ "Battery: CH6", CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True
351
+ ),
352
+ "t234c7bat": CCLSensorPreset(
353
+ "Battery: CH7", CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True
354
+ ),
355
+ "t11bat": CCLSensorPreset(
356
+ "Battery Level: CO", CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS
357
+ ),
358
+ "t10bat": CCLSensorPreset(
359
+ "Battery Level: CO\u2082", CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS
360
+ ),
361
+ "inbat": CCLSensorPreset(
362
+ "Battery: Console",
363
+ CCLSensorTypes.BATTERY_BINARY,
364
+ CCLDeviceCompartment.STATUS,
365
+ True,
366
+ ),
367
+ "t9bat": CCLSensorPreset(
368
+ "Battery Level: HCHO/VOC", CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS
369
+ ),
370
+ "t6c1bat": CCLSensorPreset(
371
+ "Battery: Leakage CH1",
372
+ CCLSensorTypes.BATTERY_BINARY,
373
+ CCLDeviceCompartment.STATUS,
374
+ True,
375
+ ),
376
+ "t6c2bat": CCLSensorPreset(
377
+ "Battery: Leakage CH2",
378
+ CCLSensorTypes.BATTERY_BINARY,
379
+ CCLDeviceCompartment.STATUS,
380
+ True,
381
+ ),
382
+ "t6c3bat": CCLSensorPreset(
383
+ "Battery: Leakage CH3",
384
+ CCLSensorTypes.BATTERY_BINARY,
385
+ CCLDeviceCompartment.STATUS,
386
+ True,
387
+ ),
388
+ "t6c4bat": CCLSensorPreset(
389
+ "Battery: Leakage CH4",
390
+ CCLSensorTypes.BATTERY_BINARY,
391
+ CCLDeviceCompartment.STATUS,
392
+ True,
393
+ ),
394
+ "t6c5bat": CCLSensorPreset(
395
+ "Battery: Leakage CH5",
396
+ CCLSensorTypes.BATTERY_BINARY,
397
+ CCLDeviceCompartment.STATUS,
398
+ True,
399
+ ),
400
+ "t6c6bat": CCLSensorPreset(
401
+ "Battery: Leakage CH6",
402
+ CCLSensorTypes.BATTERY_BINARY,
403
+ CCLDeviceCompartment.STATUS,
404
+ True,
405
+ ),
406
+ "t6c7bat": CCLSensorPreset(
407
+ "Battery: Leakage CH7",
408
+ CCLSensorTypes.BATTERY_BINARY,
409
+ CCLDeviceCompartment.STATUS,
410
+ True,
411
+ ),
412
+ "t5lsbat": CCLSensorPreset(
413
+ "Battery: Lightning Sensor",
414
+ CCLSensorTypes.BATTERY_BINARY,
415
+ CCLDeviceCompartment.STATUS,
416
+ True,
417
+ ),
418
+ "t1bat": CCLSensorPreset(
419
+ "Battery: Sensor Array",
420
+ CCLSensorTypes.BATTERY_BINARY,
421
+ CCLDeviceCompartment.STATUS,
422
+ True,
423
+ ),
424
+ "t1batvt": CCLSensorPreset(
425
+ "Battery Voltage: Sensor Array",
426
+ CCLSensorTypes.BATTERY_VOLTAGE,
427
+ CCLDeviceCompartment.STATUS,
428
+ ),
429
+ "t8bat": CCLSensorPreset(
430
+ "Battery Level: PM2.5/10", CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS
431
+ ),
432
+ "t234c1cn": CCLSensorPreset(
433
+ "Connection: CH1", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
434
+ ),
435
+ "t234c2cn": CCLSensorPreset(
436
+ "Connection: CH2", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
437
+ ),
438
+ "t234c3cn": CCLSensorPreset(
439
+ "Connection: CH3", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
440
+ ),
441
+ "t234c4cn": CCLSensorPreset(
442
+ "Connection: CH4", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
443
+ ),
444
+ "t234c5cn": CCLSensorPreset(
445
+ "Connection: CH5", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
446
+ ),
447
+ "t234c6cn": CCLSensorPreset(
448
+ "Connection: CH6", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
449
+ ),
450
+ "t234c7cn": CCLSensorPreset(
451
+ "Connection: CH7", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
452
+ ),
453
+ "t6c1cn": CCLSensorPreset(
454
+ "Connection: Leakage CH1",
455
+ CCLSensorTypes.CONNECTION,
456
+ CCLDeviceCompartment.STATUS,
457
+ True,
458
+ ),
459
+ "t6c2cn": CCLSensorPreset(
460
+ "Connection: Leakage CH2",
461
+ CCLSensorTypes.CONNECTION,
462
+ CCLDeviceCompartment.STATUS,
463
+ True,
464
+ ),
465
+ "t6c3cn": CCLSensorPreset(
466
+ "Connection: Leakage CH3",
467
+ CCLSensorTypes.CONNECTION,
468
+ CCLDeviceCompartment.STATUS,
469
+ True,
470
+ ),
471
+ "t6c4cn": CCLSensorPreset(
472
+ "Connection: Leakage CH4",
473
+ CCLSensorTypes.CONNECTION,
474
+ CCLDeviceCompartment.STATUS,
475
+ True,
476
+ ),
477
+ "t6c5cn": CCLSensorPreset(
478
+ "Connection: Leakage CH5",
479
+ CCLSensorTypes.CONNECTION,
480
+ CCLDeviceCompartment.STATUS,
481
+ True,
482
+ ),
483
+ "t6c6cn": CCLSensorPreset(
484
+ "Connection: Leakage CH6",
485
+ CCLSensorTypes.CONNECTION,
486
+ CCLDeviceCompartment.STATUS,
487
+ True,
488
+ ),
489
+ "t6c7cn": CCLSensorPreset(
490
+ "Connection: Leakage CH7",
491
+ CCLSensorTypes.CONNECTION,
492
+ CCLDeviceCompartment.STATUS,
493
+ True,
494
+ ),
495
+ "t5lscn": CCLSensorPreset(
496
+ "Connection: Lightning Sensor",
497
+ CCLSensorTypes.CONNECTION,
498
+ CCLDeviceCompartment.STATUS,
499
+ True,
500
+ ),
501
+ "t11cn": CCLSensorPreset(
502
+ "Connection: CO", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
503
+ ),
504
+ "t10cn": CCLSensorPreset(
505
+ "Connection: CO\u2082",
506
+ CCLSensorTypes.CONNECTION,
507
+ CCLDeviceCompartment.STATUS,
508
+ True,
509
+ ),
510
+ "t9cn": CCLSensorPreset(
511
+ "Connection: HCHO/VOC",
512
+ CCLSensorTypes.CONNECTION,
513
+ CCLDeviceCompartment.STATUS,
514
+ True,
515
+ ),
516
+ "t1cn": CCLSensorPreset(
517
+ "Connection: Sensor Array",
518
+ CCLSensorTypes.CONNECTION,
519
+ CCLDeviceCompartment.STATUS,
520
+ True,
521
+ ),
522
+ "t8cn": CCLSensorPreset(
523
+ "Connection: PM2.5/10",
524
+ CCLSensorTypes.CONNECTION,
525
+ CCLDeviceCompartment.STATUS,
526
+ True,
527
+ ),
528
+ }
@@ -0,0 +1,98 @@
1
+ """CCL API server and handler."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import logging
6
+
7
+ from aiohttp import web
8
+
9
+ from .device import CCLDevice, CCL_DEVICE_INFO_TYPES
10
+ from .sensor import CCL_SENSORS
11
+
12
+ _LOGGER = logging.getLogger(__name__)
13
+
14
+
15
+ class CCLServer:
16
+ """Represent a CCL server manager."""
17
+
18
+ LISTEN_PORT = 42373
19
+
20
+ devices: dict[str, CCLDevice] = {}
21
+
22
+ @staticmethod
23
+ def register(device: CCLDevice) -> None:
24
+ """Register a device with a passkey."""
25
+ CCLServer.devices[device.passkey] = device
26
+ _LOGGER.debug("Device registered: %s", device.passkey)
27
+
28
+ @staticmethod
29
+ async def handler(request: web.BaseRequest | web.Request) -> web.Response:
30
+ """Handle POST requests for data updating."""
31
+ body: dict[str, None | str | int | float] = {}
32
+ device: CCLDevice = None
33
+ info: dict[str, None | str] = {}
34
+ passkey: str = ""
35
+ sensors: dict[str, None | str | int | float] = {}
36
+ status: None | int = None
37
+ text: None | str = None
38
+
39
+ _LOGGER.debug("Request received: %s", passkey)
40
+ try:
41
+ passkey = request.path[-8:]
42
+ for ref_passkey, ref_device in CCLServer.devices.items():
43
+ if passkey == ref_passkey:
44
+ device = ref_device
45
+ break
46
+ assert isinstance(device, CCLDevice), 404
47
+
48
+ assert request.content_type == "application/json", 400
49
+ assert 0 < request.content_length <= 5000, 400
50
+
51
+ body = await request.json()
52
+
53
+ except Exception as err: # pylint: disable=broad-exception-caught
54
+ status = err.args[0]
55
+ if status == 400:
56
+ text = "400 Bad Request"
57
+ elif status == 404:
58
+ text = "404 Not Found"
59
+ else:
60
+ status = 500
61
+ text = "500 Internal Server Error"
62
+ _LOGGER.debug("Request exception occured: %s", err)
63
+ return web.Response(status=status, text=text)
64
+
65
+ for key, value in body.items():
66
+ if key in CCL_DEVICE_INFO_TYPES:
67
+ info.setdefault(key, value)
68
+ elif key in CCL_SENSORS:
69
+ sensors.setdefault(key, value)
70
+
71
+ device.update_info(info)
72
+ device.update_sensors(sensors)
73
+ status = 200
74
+ text = "200 OK"
75
+ _LOGGER.debug("Request processed: %s", passkey)
76
+ return web.Response(status=status, text=text)
77
+
78
+ app = web.Application()
79
+ app.add_routes([web.get("/{passkey}", handler)])
80
+ runner = web.AppRunner(app)
81
+
82
+ @staticmethod
83
+ async def run() -> None:
84
+ """Try to run the API server."""
85
+ try:
86
+ _LOGGER.debug("Trying to start the API server.")
87
+ await CCLServer.runner.setup()
88
+ site = web.TCPSite(CCLServer.runner, port=CCLServer.LISTEN_PORT)
89
+ await site.start()
90
+ except Exception as err: # pylint: disable=broad-exception-caught
91
+ _LOGGER.warning("Failed to run the API server: %s", err)
92
+ else:
93
+ _LOGGER.debug("Successfully started the API server.")
94
+
95
+ @staticmethod
96
+ async def stop() -> None:
97
+ """Stop running the API server."""
98
+ await CCLServer.runner.cleanup()
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.4
2
+ Name: aioccl
3
+ Version: 2024.1
4
+ Summary: A Python library for CCL API server
5
+ Home-page: https://github.com/fkiscd/aioccl
6
+ Download-URL: https://github.com/fkiscd/aioccl
7
+ Author: fkiscd
8
+ Author-email: fkiscd@gmail.com
9
+ License: Apache License, Version 2.0
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Natural Language :: English
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Topic :: Home Automation
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: aiohttp>3
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: description-content-type
25
+ Dynamic: download-url
26
+ Dynamic: home-page
27
+ Dynamic: license
28
+ Dynamic: license-file
29
+ Dynamic: requires-dist
30
+ Dynamic: summary
31
+
32
+ # aioCCL
33
+ A Python library for CCL API server
@@ -0,0 +1,13 @@
1
+ LICENSE
2
+ README.md
3
+ setup.cfg
4
+ setup.py
5
+ aioccl/__init__.py
6
+ aioccl/device.py
7
+ aioccl/sensor.py
8
+ aioccl/server.py
9
+ aioccl.egg-info/PKG-INFO
10
+ aioccl.egg-info/SOURCES.txt
11
+ aioccl.egg-info/dependency_links.txt
12
+ aioccl.egg-info/requires.txt
13
+ aioccl.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ aiohttp>3
@@ -0,0 +1 @@
1
+ aioccl
@@ -0,0 +1,7 @@
1
+ [metadata]
2
+ description-file = README.md
3
+
4
+ [egg_info]
5
+ tag_build =
6
+ tag_date = 0
7
+
aioccl-2024.1/setup.py ADDED
@@ -0,0 +1,35 @@
1
+ """Setup module for aioCCL."""
2
+
3
+ from pathlib import Path
4
+ from setuptools import find_packages, setup
5
+
6
+ VERSION = "2024.1"
7
+
8
+ ROOT_DIR = Path(__file__).parent.resolve()
9
+
10
+ setup(
11
+ name = "aioccl",
12
+ packages=find_packages(exclude=["tests", "misc"]),
13
+ version=VERSION,
14
+ license="Apache License, Version 2.0",
15
+ description="A Python library for CCL API server",
16
+ long_description=(ROOT_DIR / "README.md").read_text(encoding="utf-8"),
17
+ long_description_content_type="text/markdown",
18
+ author="fkiscd",
19
+ author_email="fkiscd@gmail.com",
20
+ url="https://github.com/fkiscd/aioccl",
21
+ download_url="https://github.com/fkiscd/aioccl",
22
+ install_requires=[
23
+ "aiohttp>3"
24
+ ],
25
+ include_package_data=True,
26
+ classifiers=[
27
+ "Development Status :: 3 - Alpha",
28
+ "Intended Audience :: Developers",
29
+ "Natural Language :: English",
30
+ "License :: OSI Approved :: Apache Software License",
31
+ "Topic :: Home Automation",
32
+ "Programming Language :: Python :: 3",
33
+ "Programming Language :: Python :: 3.12",
34
+ ],
35
+ )