uiprotect 0.3.7__tar.gz → 0.3.9__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.
Potentially problematic release.
This version of uiprotect might be problematic. Click here for more details.
- {uiprotect-0.3.7 → uiprotect-0.3.9}/PKG-INFO +15 -13
- {uiprotect-0.3.7 → uiprotect-0.3.9}/README.md +14 -12
- {uiprotect-0.3.7 → uiprotect-0.3.9}/pyproject.toml +1 -1
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/data/devices.py +2 -29
- {uiprotect-0.3.7 → uiprotect-0.3.9}/LICENSE +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/__init__.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/__main__.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/api.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/cli/__init__.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/cli/backup.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/cli/base.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/cli/cameras.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/cli/chimes.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/cli/doorlocks.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/cli/events.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/cli/lights.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/cli/liveviews.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/cli/nvr.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/cli/sensors.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/cli/viewers.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/data/__init__.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/data/base.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/data/bootstrap.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/data/convert.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/data/nvr.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/data/types.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/data/user.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/data/websocket.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/exceptions.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/py.typed +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/release_cache.json +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/stream.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/test_util/__init__.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/test_util/anonymize.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/utils.py +0 -0
- {uiprotect-0.3.7 → uiprotect-0.3.9}/src/uiprotect/websocket.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: uiprotect
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.9
|
|
4
4
|
Summary: Python API for Unifi Protect (Unofficial)
|
|
5
5
|
Home-page: https://github.com/uilibs/uiprotect
|
|
6
6
|
License: MIT
|
|
@@ -78,7 +78,7 @@ Description-Content-Type: text/markdown
|
|
|
78
78
|
|
|
79
79
|
---
|
|
80
80
|
|
|
81
|
-
Python API for
|
|
81
|
+
Python API for UniFi Protect (Unofficial)
|
|
82
82
|
|
|
83
83
|
## Looking for maintainers
|
|
84
84
|
|
|
@@ -126,7 +126,7 @@ Smart Detections (person, vehicle, animal, face), a feature that previously coul
|
|
|
126
126
|
|
|
127
127
|
Enabling Remote Access may grant other users access to your console [due to the fact Ubiquiti can reconfigure access controls at any time](https://community.ui.com/questions/Bug-Fix-Cloud-Access-Misconfiguration/fe8d4479-e187-4471-bf95-b2799183ceb7).
|
|
128
128
|
|
|
129
|
-
If you are not okay with the feature being locked behind Remote Access
|
|
129
|
+
If you are not okay with the feature being locked behind Remote Access, [let Ubiquiti know](https://community.ui.com/questions/Cannot-enable-Smart-Detections/e3d50641-5c00-4607-9723-453cda557e35).
|
|
130
130
|
|
|
131
131
|
## Documentation
|
|
132
132
|
|
|
@@ -140,7 +140,7 @@ If you want to install `uiprotect` natively, the below are the requirements:
|
|
|
140
140
|
- Latest version of library is generally only tested against the two latest minor version. This is either two latest stable versions (such as 1.21.x and 2.0.x) or the latest EA version and stable version (such as 2.2.x EA and 2.1.x).
|
|
141
141
|
- [Python](https://www.python.org/) 3.10+
|
|
142
142
|
- POSIX compatible system
|
|
143
|
-
- Library is only tested on Linux, specifically the latest Debian version available for the official Python Docker images, but there is no reason the library should not work on any Linux distro or
|
|
143
|
+
- Library is only tested on Linux, specifically the latest Debian version available for the official Python Docker images, but there is no reason the library should not work on any Linux distro or macOS.
|
|
144
144
|
- [ffmpeg](https://ffmpeg.org/)
|
|
145
145
|
- ffmpeg is primarily only for streaming audio to Protect cameras, this can be considered a soft requirement
|
|
146
146
|
|
|
@@ -158,7 +158,7 @@ Windows is **not supported**. If you need to use `uiprotect` on Windows, use Doc
|
|
|
158
158
|
pip install uiprotect
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
-
### From
|
|
161
|
+
### From GitHub
|
|
162
162
|
|
|
163
163
|
```bash
|
|
164
164
|
pip install git+https://github.com/uilibs/uiprotect.git#egg=uiprotect
|
|
@@ -166,7 +166,7 @@ pip install git+https://github.com/uilibs/uiprotect.git#egg=uiprotect
|
|
|
166
166
|
|
|
167
167
|
### Using Docker Container
|
|
168
168
|
|
|
169
|
-
A Docker container is also provided so you do not need to install/manage Python as well. You can add the following to your `.bashrc` or similar.
|
|
169
|
+
A Docker container is also provided, so you do not need to install/manage Python as well. You can add the following to your `.bashrc` or similar.
|
|
170
170
|
|
|
171
171
|
```bash
|
|
172
172
|
function uiprotect() {
|
|
@@ -181,11 +181,11 @@ function uiprotect() {
|
|
|
181
181
|
}
|
|
182
182
|
```
|
|
183
183
|
|
|
184
|
-
Some notes about the Docker version since it is running inside
|
|
184
|
+
Some notes about the Docker version since it is running inside a container:
|
|
185
185
|
|
|
186
186
|
- You can update at any time using the command `docker pull ghcr.io/uilibs/uiprotect:latest`
|
|
187
187
|
- Your local current working directory (`$PWD`) will automatically be mounted to `/data` inside of the container. For commands that output files, this is the _only_ path you can write to and have the file persist.
|
|
188
|
-
- The container supports `linux/amd64` and `linux/arm64` natively. This means it will also work well on
|
|
188
|
+
- The container supports `linux/amd64` and `linux/arm64` natively. This means it will also work well on macOS or Windows using Docker Desktop.
|
|
189
189
|
- `TZ` should be the [Olson timezone name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for the timezone your UniFi Protect instance is in.
|
|
190
190
|
- For more details on `TZ` and other environment variables, check the [command line docs](https://uilibs.github.io/uiprotect/latest/cli/)
|
|
191
191
|
|
|
@@ -193,8 +193,8 @@ Some notes about the Docker version since it is running inside of a container:
|
|
|
193
193
|
|
|
194
194
|
### CLI
|
|
195
195
|
|
|
196
|
-
|
|
197
|
-
Ubiquiti SSO accounts are not supported and actively discouraged from being used. There is no option to use MFA. You are expected to use local access user. `uiprotect` is not designed to allow you to use your owner account to access the console or to be used over the public
|
|
196
|
+
> [!WARNING]
|
|
197
|
+
> Ubiquiti SSO accounts are not supported and actively discouraged from being used. There is no option to use MFA. You are expected to use local access user. `uiprotect` is not designed to allow you to use your owner account to access the console or to be used over the public internet as both pose a security risk.
|
|
198
198
|
|
|
199
199
|
```bash
|
|
200
200
|
export UFP_USERNAME=YOUR_USERNAME_HERE
|
|
@@ -242,13 +242,15 @@ Generally any feature missing from the library is planned to be done eventually
|
|
|
242
242
|
|
|
243
243
|
### UniFi OS Features
|
|
244
244
|
|
|
245
|
-
Anything that is strictly a UniFi OS feature. If it ever done, it will be in a separate library that interacts with this one. Examples include:
|
|
245
|
+
Anything that is strictly a UniFi OS feature. If it is ever done, it will be in a separate library that interacts with this one. Examples include:
|
|
246
246
|
|
|
247
247
|
- Managing RAID and disks
|
|
248
248
|
- Creating and managing users
|
|
249
249
|
|
|
250
|
-
|
|
250
|
+
### Remote Access / Ubiquiti Cloud Features
|
|
251
|
+
|
|
252
|
+
Some features that require an Ubiquiti Account or "Remote Access" to be enabled are currently not implemented. Examples include:
|
|
251
253
|
|
|
252
254
|
- Stream sharing
|
|
253
|
-
-
|
|
255
|
+
- Face detection
|
|
254
256
|
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
41
|
-
Python API for
|
|
41
|
+
Python API for UniFi Protect (Unofficial)
|
|
42
42
|
|
|
43
43
|
## Looking for maintainers
|
|
44
44
|
|
|
@@ -86,7 +86,7 @@ Smart Detections (person, vehicle, animal, face), a feature that previously coul
|
|
|
86
86
|
|
|
87
87
|
Enabling Remote Access may grant other users access to your console [due to the fact Ubiquiti can reconfigure access controls at any time](https://community.ui.com/questions/Bug-Fix-Cloud-Access-Misconfiguration/fe8d4479-e187-4471-bf95-b2799183ceb7).
|
|
88
88
|
|
|
89
|
-
If you are not okay with the feature being locked behind Remote Access
|
|
89
|
+
If you are not okay with the feature being locked behind Remote Access, [let Ubiquiti know](https://community.ui.com/questions/Cannot-enable-Smart-Detections/e3d50641-5c00-4607-9723-453cda557e35).
|
|
90
90
|
|
|
91
91
|
## Documentation
|
|
92
92
|
|
|
@@ -100,7 +100,7 @@ If you want to install `uiprotect` natively, the below are the requirements:
|
|
|
100
100
|
- Latest version of library is generally only tested against the two latest minor version. This is either two latest stable versions (such as 1.21.x and 2.0.x) or the latest EA version and stable version (such as 2.2.x EA and 2.1.x).
|
|
101
101
|
- [Python](https://www.python.org/) 3.10+
|
|
102
102
|
- POSIX compatible system
|
|
103
|
-
- Library is only tested on Linux, specifically the latest Debian version available for the official Python Docker images, but there is no reason the library should not work on any Linux distro or
|
|
103
|
+
- Library is only tested on Linux, specifically the latest Debian version available for the official Python Docker images, but there is no reason the library should not work on any Linux distro or macOS.
|
|
104
104
|
- [ffmpeg](https://ffmpeg.org/)
|
|
105
105
|
- ffmpeg is primarily only for streaming audio to Protect cameras, this can be considered a soft requirement
|
|
106
106
|
|
|
@@ -118,7 +118,7 @@ Windows is **not supported**. If you need to use `uiprotect` on Windows, use Doc
|
|
|
118
118
|
pip install uiprotect
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
### From
|
|
121
|
+
### From GitHub
|
|
122
122
|
|
|
123
123
|
```bash
|
|
124
124
|
pip install git+https://github.com/uilibs/uiprotect.git#egg=uiprotect
|
|
@@ -126,7 +126,7 @@ pip install git+https://github.com/uilibs/uiprotect.git#egg=uiprotect
|
|
|
126
126
|
|
|
127
127
|
### Using Docker Container
|
|
128
128
|
|
|
129
|
-
A Docker container is also provided so you do not need to install/manage Python as well. You can add the following to your `.bashrc` or similar.
|
|
129
|
+
A Docker container is also provided, so you do not need to install/manage Python as well. You can add the following to your `.bashrc` or similar.
|
|
130
130
|
|
|
131
131
|
```bash
|
|
132
132
|
function uiprotect() {
|
|
@@ -141,11 +141,11 @@ function uiprotect() {
|
|
|
141
141
|
}
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
-
Some notes about the Docker version since it is running inside
|
|
144
|
+
Some notes about the Docker version since it is running inside a container:
|
|
145
145
|
|
|
146
146
|
- You can update at any time using the command `docker pull ghcr.io/uilibs/uiprotect:latest`
|
|
147
147
|
- Your local current working directory (`$PWD`) will automatically be mounted to `/data` inside of the container. For commands that output files, this is the _only_ path you can write to and have the file persist.
|
|
148
|
-
- The container supports `linux/amd64` and `linux/arm64` natively. This means it will also work well on
|
|
148
|
+
- The container supports `linux/amd64` and `linux/arm64` natively. This means it will also work well on macOS or Windows using Docker Desktop.
|
|
149
149
|
- `TZ` should be the [Olson timezone name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for the timezone your UniFi Protect instance is in.
|
|
150
150
|
- For more details on `TZ` and other environment variables, check the [command line docs](https://uilibs.github.io/uiprotect/latest/cli/)
|
|
151
151
|
|
|
@@ -153,8 +153,8 @@ Some notes about the Docker version since it is running inside of a container:
|
|
|
153
153
|
|
|
154
154
|
### CLI
|
|
155
155
|
|
|
156
|
-
|
|
157
|
-
Ubiquiti SSO accounts are not supported and actively discouraged from being used. There is no option to use MFA. You are expected to use local access user. `uiprotect` is not designed to allow you to use your owner account to access the console or to be used over the public
|
|
156
|
+
> [!WARNING]
|
|
157
|
+
> Ubiquiti SSO accounts are not supported and actively discouraged from being used. There is no option to use MFA. You are expected to use local access user. `uiprotect` is not designed to allow you to use your owner account to access the console or to be used over the public internet as both pose a security risk.
|
|
158
158
|
|
|
159
159
|
```bash
|
|
160
160
|
export UFP_USERNAME=YOUR_USERNAME_HERE
|
|
@@ -202,12 +202,14 @@ Generally any feature missing from the library is planned to be done eventually
|
|
|
202
202
|
|
|
203
203
|
### UniFi OS Features
|
|
204
204
|
|
|
205
|
-
Anything that is strictly a UniFi OS feature. If it ever done, it will be in a separate library that interacts with this one. Examples include:
|
|
205
|
+
Anything that is strictly a UniFi OS feature. If it is ever done, it will be in a separate library that interacts with this one. Examples include:
|
|
206
206
|
|
|
207
207
|
- Managing RAID and disks
|
|
208
208
|
- Creating and managing users
|
|
209
209
|
|
|
210
|
-
|
|
210
|
+
### Remote Access / Ubiquiti Cloud Features
|
|
211
|
+
|
|
212
|
+
Some features that require an Ubiquiti Account or "Remote Access" to be enabled are currently not implemented. Examples include:
|
|
211
213
|
|
|
212
214
|
- Stream sharing
|
|
213
|
-
-
|
|
215
|
+
- Face detection
|
|
@@ -1203,11 +1203,6 @@ class Camera(ProtectMotionDeviceModel):
|
|
|
1203
1203
|
|
|
1204
1204
|
return self.recording_settings.mode is not RecordingMode.NEVER
|
|
1205
1205
|
|
|
1206
|
-
@property
|
|
1207
|
-
def can_manage_recording_setting(self) -> bool:
|
|
1208
|
-
"""Can this camera manage its own recording settings?"""
|
|
1209
|
-
return not self.use_global
|
|
1210
|
-
|
|
1211
1206
|
@property
|
|
1212
1207
|
def is_smart_detections_allowed(self) -> bool:
|
|
1213
1208
|
"""Is smart detections allowed for this camera?"""
|
|
@@ -1216,11 +1211,6 @@ class Camera(ProtectMotionDeviceModel):
|
|
|
1216
1211
|
and self.api.bootstrap.nvr.is_smart_detections_enabled
|
|
1217
1212
|
)
|
|
1218
1213
|
|
|
1219
|
-
@property
|
|
1220
|
-
def can_manage_smart_detections(self) -> bool:
|
|
1221
|
-
"""Can this camera manage its own recording settings?"""
|
|
1222
|
-
return (not self.use_global) and self.is_smart_detections_allowed
|
|
1223
|
-
|
|
1224
1214
|
@property
|
|
1225
1215
|
def is_license_plate_detections_allowed(self) -> bool:
|
|
1226
1216
|
"""Is license plate detections allowed for this camera?"""
|
|
@@ -1229,11 +1219,6 @@ class Camera(ProtectMotionDeviceModel):
|
|
|
1229
1219
|
and self.api.bootstrap.nvr.is_license_plate_detections_enabled
|
|
1230
1220
|
)
|
|
1231
1221
|
|
|
1232
|
-
@property
|
|
1233
|
-
def can_manage_license_plate_detections(self) -> bool:
|
|
1234
|
-
"""Can this camera manage its own license plate settings?"""
|
|
1235
|
-
return (not self.use_global) and self.is_license_plate_detections_allowed
|
|
1236
|
-
|
|
1237
1222
|
@property
|
|
1238
1223
|
def is_face_detections_allowed(self) -> bool:
|
|
1239
1224
|
"""Is face detections allowed for this camera?"""
|
|
@@ -1242,11 +1227,6 @@ class Camera(ProtectMotionDeviceModel):
|
|
|
1242
1227
|
and self.api.bootstrap.nvr.is_face_detections_enabled
|
|
1243
1228
|
)
|
|
1244
1229
|
|
|
1245
|
-
@property
|
|
1246
|
-
def can_manage_face_detections(self) -> bool:
|
|
1247
|
-
"""Can this camera manage its own face detection settings?"""
|
|
1248
|
-
return (not self.use_global) and self.is_face_detections_allowed
|
|
1249
|
-
|
|
1250
1230
|
@property
|
|
1251
1231
|
def active_recording_settings(self) -> RecordingSettings:
|
|
1252
1232
|
"""Get active recording settings."""
|
|
@@ -1289,7 +1269,6 @@ class Camera(ProtectMotionDeviceModel):
|
|
|
1289
1269
|
return (
|
|
1290
1270
|
self.is_recording_enabled
|
|
1291
1271
|
and self.active_recording_settings.enable_motion_detection is not False
|
|
1292
|
-
and self.can_manage_recording_setting
|
|
1293
1272
|
)
|
|
1294
1273
|
|
|
1295
1274
|
@property
|
|
@@ -1324,9 +1303,7 @@ class Camera(ProtectMotionDeviceModel):
|
|
|
1324
1303
|
|
|
1325
1304
|
def _is_smart_enabled(self, smart_type: SmartDetectObjectType) -> bool:
|
|
1326
1305
|
return (
|
|
1327
|
-
self.is_recording_enabled
|
|
1328
|
-
and smart_type in self.active_smart_detect_types
|
|
1329
|
-
and self.can_manage_smart_detections
|
|
1306
|
+
self.is_recording_enabled and smart_type in self.active_smart_detect_types
|
|
1330
1307
|
)
|
|
1331
1308
|
|
|
1332
1309
|
def _is_smart_detected(self, smart_type: SmartDetectObjectType) -> bool:
|
|
@@ -1441,10 +1418,7 @@ class Camera(ProtectMotionDeviceModel):
|
|
|
1441
1418
|
Is License Plate Detection available and enabled (camera will produce face license
|
|
1442
1419
|
plate detection events)?
|
|
1443
1420
|
"""
|
|
1444
|
-
return (
|
|
1445
|
-
self._is_smart_enabled(SmartDetectObjectType.LICENSE_PLATE)
|
|
1446
|
-
and self.is_license_plate_detections_allowed
|
|
1447
|
-
)
|
|
1421
|
+
return self._is_smart_enabled(SmartDetectObjectType.LICENSE_PLATE)
|
|
1448
1422
|
|
|
1449
1423
|
@property
|
|
1450
1424
|
def last_license_plate_detect_event(self) -> Event | None:
|
|
@@ -1554,7 +1528,6 @@ class Camera(ProtectMotionDeviceModel):
|
|
|
1554
1528
|
audio_type is not None
|
|
1555
1529
|
and self.is_recording_enabled
|
|
1556
1530
|
and audio_type in self.active_audio_detect_types
|
|
1557
|
-
and self.can_manage_smart_detections
|
|
1558
1531
|
)
|
|
1559
1532
|
|
|
1560
1533
|
def _is_audio_detected(self, smart_type: SmartDetectObjectType) -> bool:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|