ul-data-logger-api-sdk 3.2.0__tar.gz → 3.3.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: ul-data-logger-api-sdk
3
- Version: 3.2.0
3
+ Version: 3.3.1
4
4
  Summary: Data logger API sdk
5
5
  Author: Unic-lab
6
6
  License-Expression: MIT
@@ -17,6 +17,7 @@ from data_logger_api_sdk.types.api_base_stations import (
17
17
  ApiBaseStationDevicesResponse,
18
18
  ApiBaseStationLogsStatForIntervalsResponse,
19
19
  ApiBaseStationLogsStatResponse,
20
+ ApiBaseStationLogDetailResponse,
20
21
  ApiBaseStationLogResponse,
21
22
  ApiBaseStationLogsListResult,
22
23
  ApiBaseStationsListResult,
@@ -194,13 +195,21 @@ class DataLoggerApiSdk:
194
195
  self,
195
196
  base_station_id: UUID,
196
197
  log_stat_days: int = 0,
198
+ exclude_log_types: List[str] | None = None,
197
199
  ) -> ApiBaseStationDetailResponse:
198
- """GET /base-stations/<uuid> — карточка базовой станции Data Logger."""
200
+ """GET /base-stations/<uuid> — карточка базовой станции Data Logger.
201
+
202
+ exclude_log_types исключает типы из logs_stat (например, ['heartbit']);
203
+ без него счётчики включают служебные heartbeat-логи.
204
+ """
205
+ query: Dict[str, Any] = {"log_stat_days": log_stat_days}
206
+ if exclude_log_types:
207
+ query["exclude_log_types"] = exclude_log_types
199
208
  return self._request_payload_once(
200
209
  ApiMethod.GET,
201
210
  f"/base-stations/{base_station_id}",
202
211
  ApiBaseStationDetailResponse,
203
- {"log_stat_days": log_stat_days},
212
+ query,
204
213
  )
205
214
 
206
215
  def get_base_station_logs(
@@ -235,6 +244,18 @@ class DataLoggerApiSdk:
235
244
  )
236
245
  return ApiBaseStationLogsListResult(items=items, total_count=total_count)
237
246
 
247
+ def get_base_station_log(
248
+ self,
249
+ base_station_id: UUID,
250
+ log_id: UUID,
251
+ ) -> ApiBaseStationLogDetailResponse:
252
+ """GET /base-stations/<uuid>/logs/<uuid> — конкретный лог БС с сырым JSON пакета."""
253
+ return self._request_payload_once(
254
+ ApiMethod.GET,
255
+ f"/base-stations/{base_station_id}/logs/{log_id}",
256
+ ApiBaseStationLogDetailResponse,
257
+ )
258
+
238
259
  def get_base_station_system_logs(
239
260
  self,
240
261
  base_station_id: UUID,
@@ -261,13 +282,20 @@ class DataLoggerApiSdk:
261
282
  self,
262
283
  base_station_id: UUID,
263
284
  day: date,
285
+ exclude_log_types: List[str] | None = None,
264
286
  ) -> ApiBaseStationLogsStatResponse:
265
- """GET /base-stations/<uuid>/logs-stat — статистика логов базовой станции за сутки."""
287
+ """GET /base-stations/<uuid>/logs-stat — статистика логов базовой станции за сутки.
288
+
289
+ exclude_log_types исключает типы из поминутных счётчиков (['heartbit'] прячет heartbeat).
290
+ """
291
+ query: Dict[str, Any] = {"day": day.isoformat()}
292
+ if exclude_log_types:
293
+ query["exclude_log_types"] = exclude_log_types
266
294
  return self._request_payload_once(
267
295
  ApiMethod.GET,
268
296
  f"/base-stations/{base_station_id}/logs-stat",
269
297
  ApiBaseStationLogsStatResponse,
270
- {"day": day.isoformat()},
298
+ query,
271
299
  )
272
300
 
273
301
  def get_base_station_device_logs_stat(
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "ul-data-logger-api-sdk"
7
- version = "3.2.0"
7
+ version = "3.3.1"
8
8
  description = "Data logger API sdk"
9
9
  license = "MIT"
10
10
  requires-python = ">=3.14"
@@ -84,6 +84,12 @@ class ApiBaseStationLogResponse(JsonApiResponsePayload):
84
84
  external_document_id: UUID4 | None = None
85
85
 
86
86
 
87
+ class ApiBaseStationLogDetailResponse(ApiBaseStationLogResponse):
88
+ """Ответ GET /base-stations/<uuid>/logs/<uuid> — лог с сырым JSON пакета (ApiBsLogDetailResponse в DL)."""
89
+
90
+ data: Dict[str, Any] | None = None
91
+
92
+
87
93
  class ApiBaseStationSystemLogResponse(JsonApiResponsePayload):
88
94
  """Элемент ответа GET /base-stations/<uuid>/system-logs (ApiBsSystemLogsResponse)."""
89
95