Commit Graph

156 Commits

Author SHA1 Message Date
Sebastian Goscik
2c43149c99 ruff formatting 2024-10-26 22:12:50 +01:00
jimmydoh
1bb8496b30 Adding support for SMART_DETECT_LINE events 2024-10-26 22:12:50 +01:00
Sebastian Goscik
80ad55d0d0 Simplified websocket reconnection logic
This is now handled automatically by uiprotect internally. We do not need to worry about this, greatly simplifying the logic here to just logging messages
2024-10-26 21:27:19 +01:00
jimmydoh
0b2c46888c Replace check_ws with subcription to websocket state 2024-10-26 21:27:19 +01:00
Jonathan Laliberte
0026eaa2ca #171 - Use exponential backoff when logging into Unifi API (#172) 2024-10-10 20:55:00 +00:00
Sebastian Goscik
78be4808d9 mypy fixes 2024-08-10 00:17:55 +01:00
Sebastian Goscik
a7ccef7f1d ruff check 2024-08-09 23:45:21 +01:00
Sebastian Goscik
bbd70f49bf ruff format 2024-08-09 23:43:03 +01:00
Lloyd Pickering
ccf2cde272 Switch to using UIProtect library (#160)
* Updated poetry dependencies to remove optional flags on dev/test

* file fixups from running poetry run tox

* Updated to Python 3.10

* Switched to UI Protect library

* Updated changelog

* Fix docker permissions

- Make scripts executable by everyone
- Correct XDG variable name to fix incorrect config path being used

* Revert "Updated poetry dependencies to remove optional flags on dev/test" and regenerated lock file
This reverts commit 432d0d3df7.

---------

Co-authored-by: Sebastian Goscik <sebastian.goscik@live.co.uk>
2024-08-09 22:16:19 +00:00
Sebastian Goscik
a8328fd09e Bump version: 0.10.7 → 0.11.0 2024-06-08 01:31:58 +01:00
Sebastian Goscik
aa1335e73b Fix typos and add experimental downloader to README 2024-06-08 01:29:06 +01:00
Sebastian Goscik
30ea7de5c2 Add experimental downloader
This uses a new API to download events like the way the web ui does, where it first asks for a video to be prepared (on the unifi protect host) and then downloads it. This might be potentially more stable than the existing downloader.
2024-06-06 00:41:42 +01:00
Sebastian Goscik
e65d8dde6c Bump version: 0.10.6 → 0.10.7 2024-03-23 00:18:57 +00:00
Sebastian Goscik
1194e957a5 Bump version: 0.10.5 → 0.10.6 2024-03-22 22:50:20 +00:00
Sebastian Goscik
d3b40b443a Bump version: 0.10.4 → 0.10.5 2024-02-24 16:19:22 +00:00
Sebastian Goscik
c69a3e365a Bump version: 0.10.3 → 0.10.4 2024-01-26 19:49:36 +00:00
Sebastian Goscik
5f7fad72d5 Bump version: 0.10.2 → 0.10.3 2023-12-07 19:59:13 +00:00
Sebastian Goscik
00aec23805 Bump version: 0.10.1 → 0.10.2 2023-11-21 00:20:46 +00:00
Sebastian Goscik
6b116ab93b Fixed issue where duplicate events were being downloaded
Previously unifi would only end one update which contained the end time stamp
so it was sufficient to check if it existed in the new event data.
However, now it is possible to get update events after the end timestamp
has been set. With this change we now look for when the event change
data contains the end time stamp. So long as unifi does not change its
mind about when an event ends, this should solve the issue.
2023-11-21 00:18:36 +00:00
Sebastian Goscik
70526b2f49 Make default file path format use event start time 2023-11-21 00:08:24 +00:00
Sebastian Goscik
5069d28f0d Bump version: 0.10.0 → 0.10.1 2023-11-01 21:34:01 +00:00
Sebastian Goscik
701fd9b0a8 Fix event enum string conversion to value 2023-11-01 21:32:19 +00:00
Sebastian Goscik
5fa202005b Bump version: 0.9.5 → 0.10.0 2023-11-01 00:16:17 +00:00
Sebastian Goscik
9410051ab9 Add feature to skip events longer than a maximum length 2023-11-01 00:11:49 +00:00
Sebastian Goscik
d5a74f475a failed rcat no longer writes to database 2023-10-31 23:37:52 +00:00
Sebastian Goscik
dc8473cc3d Fix bug with event chunking during initial ignore of events 2023-10-31 17:47:59 +00:00
Sebastian Goscik
60901e9a84 Fix crash caused by no events occurring in retention interval 2023-10-31 17:35:30 +00:00
Sebastian Goscik
8dc0f8a212 Bump version: 0.9.4 → 0.9.5 2023-10-07 22:52:45 +01:00
Sebastian Goscik
acc405a1f8 Chunk event query to prevent crashing unifi protect 2023-10-07 22:50:04 +01:00
cyberpower678
171796e5c3 Update unifi_protect_backup_core.py (#100)
Fix typo in connection attempts.  The application only attempts to connect once instead of 10 times.
2023-09-08 16:27:09 +01:00
Sebastian Goscik
cbc497909d linting 2023-07-29 12:07:31 +01:00
Sebastian Goscik
66b3344e29 Add download rate limiter 2023-07-29 12:07:31 +01:00
Sebastian Goscik
89cab64679 Add validation of retention/purge interval 2023-07-29 12:06:54 +01:00
Sebastian Goscik
f2f1c49ae9 Bump version: 0.9.3 → 0.9.4 2023-07-29 11:32:32 +01:00
Sebastian Goscik
8786f2ceb0 Fixed time period parsing
Also updated link to rclone docs to be more direct to the format docs
2023-07-29 11:32:32 +01:00
Sebastian Goscik
1f2a48f95e Bump version: 0.9.2 → 0.9.3 2023-07-08 16:56:23 +01:00
Sebastian Goscik
c4e9a42c1a Block all calls to protect client when the connection is
dropped and we are awaiting a reconnect
2023-07-08 16:30:09 +01:00
Sebastian Goscik
6c719c0162 Cache camera names
so an active protect connection is not need to perform actions like
uploads which don't rely on protect.
2023-07-08 15:32:47 +01:00
Sebastian Goscik
498f72a09b Bump version: 0.9.1 → 0.9.2 2023-05-24 00:45:00 +01:00
Sebastian Goscik
f89388327f Fix missing event checker not ignoring unwanted cameras 2023-05-22 23:22:41 +01:00
Sebastian Goscik
0a7eb92a36 Bump version: 0.9.0 → 0.9.1 2023-04-29 09:51:33 +01:00
Sebastian Goscik
63fdea402d Linting fixes 2023-04-29 09:49:27 +01:00
Sebastian Goscik
f4c3c68f0d Fixed download failure counting
previously it would only count as a failure if the download "succeeded" but was None
2023-04-29 09:48:46 +01:00
Igor Wolbers
e5112de35c Add extra param to purge (#86)
* Added optional argument string to pass directly to the `rclone delete` command used to purge video files. This will allow for immediate deletion of files on destinations where the file might otherwise go to a recycle bin by default.

---------

Co-authored-by: Igor Wolbers <igor@sparcobv.onmicrosoft.com>
Co-authored-by: Sebastian Goscik <sebastian.goscik@live.co.uk>
2023-04-29 08:19:41 +00:00
Sebastian Goscik
6b1066d31e Log when an error occurs trying to add a notifier 2023-04-02 23:15:47 +01:00
Sebastian Goscik
9def99ff97 linter fixes 2023-03-24 15:06:10 +00:00
Sebastian Goscik
b46c9485c8 Bump version: 0.8.8 → 0.9.0 2023-03-24 12:22:32 +00:00
Sebastian Goscik
cec323f803 Make download failure assertion more specific 2023-03-24 12:18:09 +00:00
Sebastian Goscik
89fe672693 Add ability to ignore events that keep failing 2023-03-24 12:17:44 +00:00
Sebastian Goscik
c55f50153f isort 2023-03-24 11:17:17 +00:00