pyimouapi 1.3.3__tar.gz → 1.3.5__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.
Files changed (52) hide show
  1. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/PKG-INFO +1 -1
  2. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/pyimouapi/__init__.py +1 -1
  3. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/pyimouapi/const.py +43 -20
  4. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/pyimouapi/device.py +778 -723
  5. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/pyimouapi/exceptions.py +2 -0
  6. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/pyimouapi/ha_device.py +479 -437
  7. pyimouapi-1.3.5/pyimouapi/openapi.py +290 -0
  8. pyimouapi-1.3.5/pyimouapi/py.typed +0 -0
  9. pyimouapi-1.3.5/pyimouapi/select_option.py +123 -0
  10. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/pyimouapi.egg-info/PKG-INFO +1 -1
  11. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/pyimouapi.egg-info/SOURCES.txt +19 -0
  12. pyimouapi-1.3.5/pyimouapi.egg-info/not-zip-safe +1 -0
  13. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/pyproject.toml +16 -1
  14. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/setup.py +3 -1
  15. pyimouapi-1.3.5/tests/test_accessory_device_id.py +73 -0
  16. pyimouapi-1.3.5/tests/test_auth_failure_propagates.py +142 -0
  17. pyimouapi-1.3.5/tests/test_bind_device.py +37 -0
  18. pyimouapi-1.3.5/tests/test_connection_pool.py +94 -0
  19. pyimouapi-1.3.5/tests/test_device_image.py +61 -0
  20. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/tests/test_device_summaries.py +29 -0
  21. pyimouapi-1.3.5/tests/test_entity_tables_golden.py +36 -0
  22. pyimouapi-1.3.5/tests/test_get_devices.py +170 -0
  23. pyimouapi-1.3.5/tests/test_motion_detect_excepts.py +91 -0
  24. pyimouapi-1.3.5/tests/test_openapi_http.py +490 -0
  25. pyimouapi-1.3.5/tests/test_packaging.py +37 -0
  26. pyimouapi-1.3.5/tests/test_product_id_guard.py +45 -0
  27. pyimouapi-1.3.5/tests/test_select_option.py +111 -0
  28. pyimouapi-1.3.5/tests/test_services_entities_concurrency.py +123 -0
  29. pyimouapi-1.3.5/tests/test_set_text_value.py +85 -0
  30. pyimouapi-1.3.5/tests/test_status_read_concurrency.py +156 -0
  31. pyimouapi-1.3.5/tests/test_switch_status_aggregation.py +110 -0
  32. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/tests/test_update_from_detail.py +6 -2
  33. pyimouapi-1.3.5/tests/test_write_optimistic_state.py +127 -0
  34. pyimouapi-1.3.3/pyimouapi/openapi.py +0 -165
  35. pyimouapi-1.3.3/tests/test_write_optimistic_state.py +0 -60
  36. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/LICENSE +0 -0
  37. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/README.md +0 -0
  38. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/pyimouapi/collection_point.py +0 -0
  39. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/pyimouapi/sensor.py +0 -0
  40. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/pyimouapi/siren.py +0 -0
  41. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/pyimouapi.egg-info/dependency_links.txt +0 -0
  42. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/pyimouapi.egg-info/requires.txt +0 -0
  43. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/pyimouapi.egg-info/top_level.txt +0 -0
  44. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/setup.cfg +0 -0
  45. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/tests/test_channel_id_and_api_guards.py +0 -0
  46. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/tests/test_collect_property_entities.py +0 -0
  47. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/tests/test_collection_point.py +0 -0
  48. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/tests/test_event_identifier_map.py +0 -0
  49. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/tests/test_lookup_property.py +0 -0
  50. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/tests/test_message_callback.py +0 -0
  51. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/tests/test_sensor_normalize.py +0 -0
  52. {pyimouapi-1.3.3 → pyimouapi-1.3.5}/tests/test_siren.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyimouapi
3
- Version: 1.3.3
3
+ Version: 1.3.5
4
4
  Summary: A package for imou open api
5
5
  Home-page: https://github.com/Imou-OpenPlatform/Py-Imou-Open-Api
6
6
  Author: Imou-OpenPlatform
@@ -1,4 +1,4 @@
1
- __version__ = "1.3.3"
1
+ __version__ = "1.3.5"
2
2
 
3
3
  from .device import ImouChannel, ImouDevice, ImouDeviceManager
4
4
  from .exceptions import (
@@ -1,3 +1,5 @@
1
+ from typing import Any
2
+
1
3
  # API Endpoints
2
4
  API_ENDPOINT_ACCESS_TOKEN = "/openapi/accessToken"
3
5
  API_ENDPOINT_LIST_DEVICE_DETAILS = "/openapi/listDeviceDetailsByPage"
@@ -10,6 +12,7 @@ API_ENDPOINT_GET_DEVICE_NIGHT_VISION_MODE = "/openapi/getNightVisionMode"
10
12
  API_ENDPOINT_SET_DEVICE_NIGHT_VISION_MODE = "/openapi/setNightVisionMode"
11
13
  API_ENDPOINT_DEVICE_STORAGE = "/openapi/deviceStorage"
12
14
  API_ENDPOINT_RESTART_DEVICE = "/openapi/restartDevice"
15
+ API_ENDPOINT_BIND_DEVICE = "/openapi/bindDevice"
13
16
  API_ENDPOINT_BIND_DEVICE_LIVE = "/openapi/bindDeviceLive"
14
17
  API_ENDPOINT_GET_DEVICE_ONLINE = "/openapi/deviceOnline"
15
18
  API_ENDPOINT_GET_DEVICE_LIVE_INFO = "/openapi/getLiveStreamInfo"
@@ -113,6 +116,7 @@ PARAM_MOTION_DETECT = "motion_detect"
113
116
  PARAM_STORAGE_USED = "storage_used"
114
117
  PARAM_RESTART_DEVICE = "restart_device"
115
118
  PARAM_NIGHT_VISION_MODE = "night_vision_mode"
119
+ PARAM_DEVICE_VOLUME = "device_volume"
116
120
  PARAM_COLLECTION_POINT = "collection_point"
117
121
  PARAM_COLLECTION_POINT_PROMPT = "select_collection_point"
118
122
  PARAM_SIREN_START = "siren_start"
@@ -154,7 +158,7 @@ PARAM_ABILITY = "ability"
154
158
  PARAM_FUNCTION_TYPE = "function_type"
155
159
 
156
160
  # Required capacity for various switch types
157
- SWITCH_TYPE_ABILITY = {
161
+ SWITCH_TYPE_ABILITY: dict[str, list[dict[str, Any]]] = {
158
162
  "motion_detect": [
159
163
  {
160
164
  "ability": "MobileDetect",
@@ -225,15 +229,21 @@ SWITCH_TYPE_ABILITY = {
225
229
  ],
226
230
  }
227
231
 
228
- SWITCH_TYPE_REF = {
232
+ SWITCH_TYPE_REF: dict[str, list[dict[str, Any]]] = {
229
233
  "motion_detect": [
230
234
  {
231
235
  "ref": "14800",
232
236
  "default": False,
237
+ "excepts": [
238
+ "FKX9UYL4",
239
+ ],
233
240
  },
234
241
  {
235
242
  "ref": "305000",
236
243
  "default": False,
244
+ "excepts": [
245
+ "FKX9UYL4",
246
+ ],
237
247
  },
238
248
  {
239
249
  "ref": "108800",
@@ -312,7 +322,7 @@ SWITCH_TYPE_REF = {
312
322
  ],
313
323
  }
314
324
  # Required capacity for various button types
315
- BUTTON_TYPE_ABILITY = {
325
+ BUTTON_TYPE_ABILITY: dict[str, list[str]] = {
316
326
  "restart_device": ["Reboot"],
317
327
  "siren_start": ["Siren"],
318
328
  "siren_stop": ["Siren"],
@@ -321,7 +331,7 @@ BUTTON_TYPE_ABILITY = {
321
331
  "ptz_left": ["PT", "PTZ"],
322
332
  "ptz_right": ["PT", "PTZ"],
323
333
  }
324
- BUTTON_TYPE_REF = {
334
+ BUTTON_TYPE_REF: dict[str, list[dict[str, Any]]] = {
325
335
  "restart_device": [
326
336
  {"ref": "2300"},
327
337
  {"ref": "21200"},
@@ -400,39 +410,50 @@ BUTTON_TYPE_REF = {
400
410
  ],
401
411
  }
402
412
  # Required capacity for various select types
403
- SELECT_TYPE_ABILITY = {
413
+ SELECT_TYPE_ABILITY: dict[str, list[str]] = {
404
414
  "night_vision_mode": ["NVM"],
405
415
  "collection_point": ["CollectionPoint"],
406
416
  }
407
- SELECT_TYPE_REF = {
417
+ SELECT_TYPE_REF: dict[str, list[dict[str, Any]]] = {
408
418
  "night_vision_mode": [
409
419
  {
410
420
  "ref": "17400",
411
- "default": "0",
412
- "options": ["0", "1", "2", "3"],
421
+ "default": "intelligent",
422
+ "options": ["intelligent", "fullcolor", "infrared", "off"],
413
423
  "value_type": "int",
414
424
  },
415
425
  {
416
426
  "ref": "139700",
417
- "default": "0",
418
- "options": ["0", "1", "2", "3", "4"],
427
+ "default": "intelligent",
428
+ "options": [
429
+ "intelligent",
430
+ "fullcolor",
431
+ "infrared",
432
+ "off",
433
+ "custom",
434
+ ],
435
+ "value_type": "int",
436
+ },
437
+ {
438
+ "ref": "112400",
439
+ "default": "infrared",
440
+ "options": ["infrared", "off"],
419
441
  "value_type": "int",
420
442
  },
421
- {"ref": "112400", "default": "2", "options": ["2", "3"], "value_type": "int"},
422
443
  ],
423
444
  "mode": [
424
445
  {
425
446
  "ref": "15200",
426
- "default": "0",
427
- "options": ["0", "1", "2"],
447
+ "default": "home",
448
+ "options": ["home", "away", "disarm"],
428
449
  "value_type": "int",
429
450
  }
430
451
  ],
431
452
  "device_volume": [
432
453
  {
433
454
  "ref": "15400",
434
- "default": "0",
435
- "options": ["99", "0", "1", "2"],
455
+ "default": "low",
456
+ "options": ["mute", "low", "medium", "high"],
436
457
  "value_type": "int",
437
458
  }
438
459
  ],
@@ -448,11 +469,11 @@ SELECT_TYPE_REF = {
448
469
  ],
449
470
  }
450
471
  # Required capacity for various sensor types
451
- SENSOR_TYPE_ABILITY = {
472
+ SENSOR_TYPE_ABILITY: dict[str, list[str]] = {
452
473
  "storage_used": ["LocalStorage", "LocalStorageEnable"],
453
474
  "battery": ["Electric"],
454
475
  }
455
- SENSOR_TYPE_REF = {
476
+ SENSOR_TYPE_REF: dict[str, list[dict[str, Any]]] = {
456
477
  "storage_used": [
457
478
  {
458
479
  "ref": "14600",
@@ -524,10 +545,12 @@ SENSOR_TYPE_REF = {
524
545
  ],
525
546
  }
526
547
 
527
- BINARY_SENSOR_TYPE_ABILITY = {}
528
- BINARY_SENSOR_TYPE_REF = {"door_contact_status": [{"ref": "16300", "default": False}]}
548
+ BINARY_SENSOR_TYPE_ABILITY: dict[str, list[str]] = {}
549
+ BINARY_SENSOR_TYPE_REF: dict[str, list[dict[str, Any]]] = {
550
+ "door_contact_status": [{"ref": "16300", "default": False}]
551
+ }
529
552
 
530
- TEXT_TYPE_REF = {
553
+ TEXT_TYPE_REF: dict[str, list[dict[str, Any]]] = {
531
554
  "count_down_switch": [
532
555
  {
533
556
  "ref": "28800",