aioccl 2025.6.8__tar.gz → 2025.7__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aioccl
3
- Version: 2025.6.8
3
+ Version: 2025.7
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
@@ -7,7 +7,7 @@ import time
7
7
  from typing import Callable, TypedDict
8
8
 
9
9
  from .exception import CCLDataUpdateException
10
- from .sensor import CCLSensor, CCL_SENSORS
10
+ from .sensor import CCLSensor
11
11
 
12
12
  _LOGGER = logging.getLogger(__name__)
13
13
 
@@ -83,8 +83,7 @@ class CCLDevice:
83
83
  def fw_ver(self) -> str | None:
84
84
  """Return the firmware version."""
85
85
  return self._info["fw_ver"]
86
-
87
- @property
86
+
88
87
  def get_sensors(self) -> dict[str, CCLSensor]:
89
88
  """Get all types of sensor data under this device."""
90
89
  if self._info["last_update_time"] is None:
@@ -92,6 +91,15 @@ class CCLDevice:
92
91
  if len(self._sensors) == 0 or time.monotonic() - self._info["last_update_time"] > 600:
93
92
  raise CCLDataUpdateException("Device is offline or not ready")
94
93
  return self._sensors
94
+
95
+ def set_update_callback(self, callback: Callable[[], None]) -> None:
96
+ """Set the callback function to update sensor data."""
97
+ self._update_callback = callback
98
+
99
+ def set_new_sensor_callback(self, callback: Callable[[], None]) -> None:
100
+ """Set the callback function to add a new sensor."""
101
+ self._new_sensor_callback = callback
102
+
95
103
 
96
104
  def update_info(self, new_info: dict[str, None | str]) -> None:
97
105
  """Add or update device info."""
@@ -128,10 +136,6 @@ class CCLDevice:
128
136
  self._sensors[key].value = value
129
137
  self.push_updates()
130
138
 
131
- def set_update_callback(self, callback: Callable[[], None]) -> None:
132
- """Set the callback function to update sensor data."""
133
- self._update_callback = callback
134
-
135
139
  def _publish_updates(self) -> None:
136
140
  """Call the function to update sensor data."""
137
141
  try:
@@ -143,10 +147,6 @@ class CCLDevice:
143
147
  err,
144
148
  )
145
149
 
146
- def set_new_sensor_callback(self, callback: Callable[[], None]) -> None:
147
- """Set the callback function to add a new sensor."""
148
- self._new_sensor_callback = callback
149
-
150
150
  def _publish_new_sensors(self) -> int:
151
151
  """Schedule all registered callbacks to add new sensors."""
152
152
  success_count = 0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aioccl
3
- Version: 2025.6.8
3
+ Version: 2025.7
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
@@ -3,7 +3,7 @@
3
3
  from pathlib import Path
4
4
  from setuptools import find_packages, setup
5
5
 
6
- VERSION = "2025.6.8"
6
+ VERSION = "2025.7"
7
7
 
8
8
  ROOT_DIR = Path(__file__).parent.resolve()
9
9
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes