Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
227 commits
Select commit Hold shift + click to select a range
562f137
call property methods on keepalive/relogin in __init__ to make sure n…
rlippmann Oct 13, 2023
d614755
revert previous commit
rlippmann Oct 13, 2023
5de6a1d
change wait_for_update to return False if an update failed
rlippmann Oct 13, 2023
8f412ee
change optional property setters to int | None
rlippmann Oct 13, 2023
11210b1
back off relogin with multiple sync check fails
rlippmann Oct 13, 2023
214b352
re-factor async_query and async_fetch_version
rlippmann Oct 13, 2023
709cc4c
move _sync_check near _keepalive_task to make them easier to find
rlippmann Oct 13, 2023
a2223f7
refactor sync check task
rlippmann Oct 14, 2023
b2a66e5
refactor keepalive_task
rlippmann Oct 14, 2023
6e1811e
refactor _fetch_devices
rlippmann Oct 14, 2023
800e24f
refactor zones
rlippmann Oct 14, 2023
f9bd908
add docstrings, make a few things constants
rlippmann Oct 14, 2023
8e5a3be
partial revert 800e24f8d74e1adba3c95ce59c687b1e43d52bca
rlippmann Oct 14, 2023
4fd8384
change zones variables to snake case
rlippmann Oct 14, 2023
1cdf1b0
rework sync_check_task
rlippmann Oct 16, 2023
2c978b0
add gateway pytests
rlippmann Oct 16, 2023
0395876
add alarm panel tests
rlippmann Oct 16, 2023
734465e
fix extra whitespace in util.py
rlippmann Oct 16, 2023
5b3f563
fix extra whitespace in util.py
rlippmann Oct 16, 2023
68c93e9
add test_util.py
rlippmann Oct 16, 2023
97182c3
parse_pulse_datetime fixes
rlippmann Oct 17, 2023
5e91ec7
attempt to fix handle_response tests
rlippmann Oct 17, 2023
facd6cd
add detailed debug logging
rlippmann Oct 21, 2023
19fcb69
max_retries -> MAX_RETRIES
rlippmann Oct 21, 2023
6296137
log url instead of uri in async_query()
rlippmann Oct 21, 2023
f48c9c1
update black.yml to use checkoutv4
rlippmann Oct 21, 2023
e58da5d
add setup-python to black.yml
rlippmann Oct 21, 2023
782093d
add pre-commit github workflow
rlippmann Oct 21, 2023
0c44fa9
update pre-commit wf action to use checkout/python setup v4
rlippmann Oct 21, 2023
e673bee
pre-commit fixes
rlippmann Oct 21, 2023
08d11dd
pyupgrade --py-311plus changes
rlippmann Oct 21, 2023
0f7b39f
more ci fixes
rlippmann Oct 21, 2023
206da3e
change pyupgrade to --py310-plus
rlippmann Oct 21, 2023
7278ebb
put back union on RLock/DebugRlock
rlippmann Oct 21, 2023
40ae83a
change pyupgrade to --py39-plus to prevent rewriting unions
rlippmann Oct 21, 2023
a7272fc
move do_login/do_logout_query to pulse_connection
rlippmann Oct 21, 2023
f48b1af
move last_login_time to pulse_connection
rlippmann Oct 21, 2023
ecb94ca
fix missing bool functions in sync_check code
rlippmann Oct 22, 2023
e4b1b21
move retry_after to pulse_connection
rlippmann Oct 22, 2023
9d3df80
fix defaults on keepalive/relogin interval on pyadtpulse constructor
rlippmann Oct 22, 2023
99f1fbb
retry after handling
rlippmann Nov 3, 2023
57c6dbc
move authenticated_flag to pulse_connection, make updates exist never…
rlippmann Nov 3, 2023
8baacbb
add requires_authentication flag to async_query()
rlippmann Nov 3, 2023
d0c343b
move retry increment earlier in case of None response
rlippmann Nov 3, 2023
618cf47
add requires_authentication to query()
rlippmann Nov 3, 2023
958c425
remove relative imports
rlippmann Nov 3, 2023
6b423a0
set and clear authenticated flag on login/logout
rlippmann Nov 3, 2023
2607d10
re-work login/logout
rlippmann Nov 3, 2023
99c8635
fix logging for authentication flag in async_query()
rlippmann Nov 3, 2023
ea7b9cd
make sync_task and keepalive_task inner functions
rlippmann Nov 3, 2023
a27d710
add detailed debug logging to pulse_connection
rlippmann Nov 3, 2023
7c17592
make private methods public
rlippmann Nov 3, 2023
a409727
fix parse_pulse_datetime
rlippmann Nov 3, 2023
b48bacb
fix _compute_login_backoff
rlippmann Nov 4, 2023
b724a87
rework _do_relogin_with_backoff
rlippmann Nov 4, 2023
86f9f72
move _check_service_host to pulse_connection
rlippmann Nov 4, 2023
91e3e10
add pulse_connection tests
rlippmann Nov 4, 2023
97d6e39
move check_service_host to pulse_connection
rlippmann Nov 6, 2023
6f65601
test fixes
rlippmann Nov 6, 2023
68c4beb
revert relative imports
rlippmann Nov 6, 2023
6fd70cd
move username/password/fingerprint validation to pulse_connection
rlippmann Nov 6, 2023
4f1fbf9
site code enhanements
rlippmann Nov 6, 2023
587648a
revert site code enhancements
rlippmann Nov 6, 2023
0633506
fetch_devices refactoring
rlippmann Nov 6, 2023
b4d15b9
add test_site
rlippmann Nov 7, 2023
0359cfe
add response is None check
rlippmann Nov 7, 2023
392602b
add test_pyadtpulse
rlippmann Nov 7, 2023
c4d4ecf
rework async_query to return tuple, remove close_response()
rlippmann Nov 7, 2023
00b5ab7
move build system to poetry
rlippmann Nov 7, 2023
9191fd3
bump version to 1.1.4b0
rlippmann Nov 7, 2023
301e7c4
move test_pyadtpulse.py to tests
rlippmann Nov 7, 2023
1df6497
change default http headers to new values
rlippmann Nov 7, 2023
493b5b0
add data parameter to query/async_query
rlippmann Nov 7, 2023
114a873
rework http code
rlippmann Nov 8, 2023
989ac52
pass detailed_debug_logging in example-client
rlippmann Nov 8, 2023
4a32cc3
copy response_path before closing response in async_fetch_version
rlippmann Nov 8, 2023
dfa7cee
add session.close() to finally in async_query
rlippmann Nov 8, 2023
92a6842
urlencode http login parameters
rlippmann Nov 8, 2023
2c339c9
move check for invalid login types to pulse_connection
rlippmann Nov 8, 2023
10ba7b1
rework async_login again
rlippmann Nov 8, 2023
47739bb
add refurb to development dependencies
rlippmann Nov 8, 2023
f45de2e
put back async_do_login_query inner functions
rlippmann Nov 8, 2023
6cf93ea
add network id to login parameters if not none
rlippmann Nov 8, 2023
d80db03
remove close session in async_query
rlippmann Nov 8, 2023
a7c35dc
more async_do_login_query rework
rlippmann Nov 8, 2023
ace8b8e
more async_query related rework
rlippmann Nov 8, 2023
3e6a570
add sec-fetch headers
rlippmann Nov 8, 2023
d7a2c09
more http headers
rlippmann Nov 8, 2023
26cb2d8
even more http header rework
rlippmann Nov 8, 2023
ad5091e
more header updates
rlippmann Nov 8, 2023
6651a1d
add connection failure reason
rlippmann Nov 9, 2023
7b444f0
more http rework
rlippmann Nov 9, 2023
0e4cf6f
bump to 1.1.4b1
rlippmann Nov 9, 2023
4f4198f
downgrade aiohttp to 3.8.4
rlippmann Nov 9, 2023
eece151
move examples to example subdirectory
rlippmann Nov 9, 2023
be9b2d9
add doc, examples, changelog to pyproject.toml
rlippmann Nov 9, 2023
4cac93f
bump version to b2
rlippmann Nov 9, 2023
1232988
move example-client back to root directory
rlippmann Nov 9, 2023
2e8d59b
break pulse_connection into smaller subclasses
rlippmann Nov 10, 2023
c4011c7
debug lock fixes to site
rlippmann Nov 10, 2023
e680e38
bump version to 1.1.4b3
rlippmann Nov 10, 2023
1f47577
break pyadtpulse object into smaller classes
rlippmann Nov 10, 2023
d52e758
add bs4 dependency
rlippmann Nov 10, 2023
28d1750
don't use aiohttp 3.8.6
rlippmann Nov 10, 2023
b84cdfd
add typeguard
rlippmann Nov 10, 2023
a56418c
pulse_connection_info tests and fixes
rlippmann Nov 10, 2023
3c5197b
pulse_query_manager tests
rlippmann Nov 11, 2023
9873603
more class changes
rlippmann Nov 12, 2023
2a10717
pre-commit fixes
rlippmann Nov 12, 2023
f94b982
remove tests for now
rlippmann Nov 12, 2023
6bc98d5
bump version to b4
rlippmann Nov 12, 2023
1f224b1
add typeguard to requirements.txt
rlippmann Nov 12, 2023
e48fe1e
testing infrastructure
rlippmann Nov 15, 2023
19bc728
more testing infrastructure
rlippmann Nov 16, 2023
d1cdfb7
more testing infrastructure
rlippmann Nov 18, 2023
35374de
add backoff object
rlippmann Nov 20, 2023
fcfb37d
add login_in_progress flag
rlippmann Nov 20, 2023
7ef2035
fix sync object
rlippmann Nov 20, 2023
e006457
add check_async for __init__
rlippmann Nov 20, 2023
82d2951
add client_error and server_error to ConnectionFailureReason
rlippmann Nov 20, 2023
75e06f6
backoff tests and fixes
rlippmann Nov 21, 2023
93635c3
fix login_in_progress flag
rlippmann Dec 9, 2023
12cb283
rework backoff
rlippmann Dec 9, 2023
a96e204
reset connection failure on success
rlippmann Dec 10, 2023
5059894
move query backoff to async_query
rlippmann Dec 10, 2023
e47f802
pre-commit hook fixes
rlippmann Dec 10, 2023
a477ebe
rework async_query again
rlippmann Dec 12, 2023
9151940
add html change for zones introduced in pulse v27
rlippmann Dec 14, 2023
99f0be0
pqm exception tests
rlippmann Dec 14, 2023
48bbc54
update pre-commit hooks and refurb fixes
rlippmann Dec 14, 2023
561a8d2
exception testing and fixes to pqm
rlippmann Dec 15, 2023
fde6598
more pqm tests and fixes
rlippmann Dec 16, 2023
e3e46c0
break site properties out from site
rlippmann Dec 16, 2023
744b63b
initial pc tests
rlippmann Dec 16, 2023
f0dcb55
remove DEFAULT_API_VERSION
rlippmann Dec 16, 2023
378222d
add pqm test version fail
rlippmann Dec 16, 2023
f1d895a
add check of api version string
rlippmann Dec 16, 2023
2382232
more pc tests and fixes
rlippmann Dec 17, 2023
af642d9
updates for pulse v27
rlippmann Dec 17, 2023
7c546e6
pc tests and fixes
rlippmann Dec 17, 2023
f0954e2
fix various auth failures in pc
rlippmann Dec 17, 2023
0738051
restrict update_zones_from soup to orb div in html
rlippmann Dec 19, 2023
8ca9279
pc tests and fixes
rlippmann Dec 19, 2023
c243b91
pa test fixes
rlippmann Dec 19, 2023
cf2b55b
rollback div html check
rlippmann Dec 19, 2023
d18cfb6
fix zone parsing in site
rlippmann Dec 20, 2023
e40a4bf
change connectionfailurereason to exceptions
rlippmann Dec 20, 2023
98452b6
fixes for new exception handling
rlippmann Dec 20, 2023
4b5dad3
update tests for exceptions
rlippmann Dec 20, 2023
7c841a0
fix sync updates_exist
rlippmann Dec 20, 2023
c77e79a
remove websession parameter, add clear_session to pcp and call it on …
rlippmann Dec 20, 2023
ad8b06a
allocate clientsession on demand
rlippmann Dec 20, 2023
0406002
_handle_network_errors fix
rlippmann Dec 21, 2023
fe5626d
add PulseNotLoggedInError exception
rlippmann Dec 22, 2023
adb09c6
add check_login_errors and have sync check call it
rlippmann Dec 22, 2023
d41a7ff
fix last event parsing to strip leading and trailing spaces before da…
rlippmann Dec 22, 2023
05285a5
more test fixes and regular fixes
rlippmann Dec 23, 2023
277021f
add superclasses for exceptions
rlippmann Dec 24, 2023
46cb3a1
fix relogin interval in keepalive task
rlippmann Dec 24, 2023
c3498a8
move authentication wait to just before the session.request in async_…
rlippmann Dec 24, 2023
2e2b4e0
add detailed debug logging to backoffs
rlippmann Dec 24, 2023
ae22734
changed some pqm warnings to debug, and fetch_version debugs to warnings
rlippmann Dec 24, 2023
cca5035
don't log backoff reset if backoff count was 0
rlippmann Dec 24, 2023
917a297
add asyncio.Timeout exception handling to pqm
rlippmann Dec 24, 2023
2665e68
pqm exception type tests and fixes
rlippmann Dec 24, 2023
ea279cf
add __str__ and __repr__ to exceptions
rlippmann Dec 24, 2023
8d9d019
exception tests and fixes
rlippmann Dec 24, 2023
28b4ed6
add test_site_properties
rlippmann Dec 24, 2023
299b8bb
zones tests and fixes
rlippmann Dec 24, 2023
589b2fd
pcp tests and fixes
rlippmann Dec 24, 2023
4374650
add test_pulse_connection_status
rlippmann Dec 24, 2023
9ec46b2
add test_gateway and fixes
rlippmann Dec 24, 2023
69ff9f7
add codium pqm tests
rlippmann Dec 24, 2023
508b781
add coverage to poetry test group
rlippmann Dec 24, 2023
a906b3f
add pytest-coverage
rlippmann Dec 24, 2023
3eea5e2
add coverage
rlippmann Dec 24, 2023
e52eb13
add more coverage
rlippmann Dec 25, 2023
55ca650
add pytest-xdist, make coverage not default
rlippmann Dec 25, 2023
b23a552
add test_pap
rlippmann Dec 25, 2023
104ce38
add codium paa tests
rlippmann Dec 25, 2023
0f4e06b
move authenticated flag clear before query in asyc_do_login_query
rlippmann Dec 26, 2023
a4f7ac3
clean up detailed debug logging
rlippmann Dec 26, 2023
2e6db6d
pulse async tests and fixes
rlippmann Dec 26, 2023
e848ba5
add quick_logout to pc
rlippmann Dec 26, 2023
afe302e
reword detailed_debug_logging again
rlippmann Dec 26, 2023
a8d95a0
more tests and fixes
rlippmann Jan 10, 2024
8cc74ba
remove backoffs from login exceptions
rlippmann Jan 11, 2024
14fb881
more tests and fixes
rlippmann Jan 15, 2024
6539b89
even more tests and fixes
rlippmann Jan 15, 2024
cf15544
fix loop_login, change exception handling in wait_for_update
rlippmann Jan 20, 2024
f730b59
add gateway offline data files
rlippmann Jan 20, 2024
9d35559
add gateway offline handling
rlippmann Jan 20, 2024
0f6ec10
bump version to 1.2.0b1
rlippmann Jan 20, 2024
ef29bc3
revert bs optimization in update_zone_from_soup
rlippmann Jan 20, 2024
2bf4da1
always update alarm sat
rlippmann Jan 21, 2024
c31fb27
remove unused _login_exception in pulse properties
rlippmann Jan 21, 2024
08d9a6d
add passthrough of keepalive and relogin_interval
rlippmann Jan 21, 2024
011dd23
bump version to 1.2.0b2
rlippmann Jan 21, 2024
61eb9ec
bump aiohttp version to 3.9.1
rlippmann Jan 22, 2024
3a97cc1
add gateway offline tests
rlippmann Jan 22, 2024
8928363
bump aioresponses to 0.7.6 for aiohttp 3.9.1
rlippmann Jan 22, 2024
2339aff
gateway offline tests and fixes
rlippmann Jan 23, 2024
4ee20e3
don't use query backoff if we have a connection backoff
rlippmann Jan 27, 2024
0495f4f
MAX_RETRIES -> MAX_REQUERY_RETRIES
rlippmann Jan 27, 2024
493ba0b
more tests and fixes
rlippmann Jan 28, 2024
170cf88
black changes
rlippmann Jan 28, 2024
70fc0b4
more black fixes
rlippmann Jan 28, 2024
63c117c
more black fixes
rlippmann Jan 28, 2024
d02b131
more black fixes
rlippmann Jan 28, 2024
77a86b1
more robust exception handling in example-client
rlippmann Jan 29, 2024
a7c85db
add deprecation warning to sync api
rlippmann Jan 29, 2024
3723fda
fix have_updates in sync_check
rlippmann Jan 29, 2024
1fc4c37
don't print info if have exception in example_client
rlippmann Jan 29, 2024
73c31df
don't do gateway backoff if we have an update
rlippmann Jan 29, 2024
366b2cc
fix sync check requery
rlippmann Jan 29, 2024
9c37b96
revert clear_session()
rlippmann Jan 29, 2024
e81d0d7
fix some logging statements
rlippmann Jan 30, 2024
e5393da
bump version to 1.2.0b3
rlippmann Jan 30, 2024
d66a9f1
black fix
rlippmann Jan 30, 2024
d3f536d
more log fixes
rlippmann Jan 30, 2024
8adb8fb
update changelog
rlippmann Jan 31, 2024
bd38fcd
have gateway reset its backoff when it goes back online
rlippmann Feb 1, 2024
583fa20
fix gateway backoff in sync task
rlippmann Feb 1, 2024
2db7a7f
bump version to 1.2.0b4
rlippmann Feb 1, 2024
3387ec5
bump version to 1.2.0
rlippmann Feb 2, 2024
764d981
add 1.1.4 and 1.1.5 changelog
rlippmann Feb 2, 2024
c6e591d
Merge branch 'master' into 1.2.0
rlippmann Feb 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: psf/black@stable
14 changes: 14 additions & 0 deletions .github/workflows/name: pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
[push, pull_request]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: pre-commit/action@v3.0.0
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ __pycache__
.mypy_cache
*.swp
.vscode/settings.json
.coverage
19 changes: 10 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/psf/black
rev: 23.9.1
rev: 23.12.0
hooks:
- id: black
args: [--config=pyproject.toml]
- repo: https://github.com/hadialqattan/pycln
rev: v2.2.2
rev: v2.4.0
hooks:
- id: pycln
args: [--config=pyproject.toml]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
files: "\\.(py)$"
args: [--settings-path=pyproject.toml]
- repo: https://github.com/dosisod/refurb
rev: v1.21.0
rev: v1.25.0
hooks:
- id: refurb
- repo: https://github.com/asottile/pyupgrade
rev: v3.13.0
hooks:
- id: pyupgrade
9 changes: 9 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Debug Tests",
"type": "python",
"request": "launch",
"program": "${file}",
"purpose": ["debug-test"],
"console": "integratedTerminal",
"justMyCode": false
},
{
"name": "Python: Current File",
"type": "python",
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"python.analysis.typeCheckingMode": "basic",
"python.terminal.activateEnvironment": true
"python.terminal.activateEnvironment": true,
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
35 changes: 35 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
// .vscode/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Run pytest with coverage",
"type": "shell",
"command": "pytest",
"args": [
"--cov=pyadtpulse",
"--cov-report=html",
"${workspaceFolder}/tests"
],
"group": {
"kind": "test",
"isDefault": false
}
},
{
"label": "Run pytest without coverage",
"type": "shell",
"command": "pytest",
"args": [
"${workspaceFolder}/tests"
],
"group": {
"kind": "test",
"isDefault": true
}
}
]
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 1.2.0 (2024-01-30)

* add exceptions and exception handling
* make code more robust for error handling
* refactor code into smaller objects
* add testing framework
* add poetry

## 1.1.5 (2023-12-22)

* fix more zone html parsing due to changes in Pulse v27
Expand Down
Loading