Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
2efd5f3
move login query to _do_login_query, update parameters
rlippmann May 13, 2023
ccaa57b
handle retry-after for http codes 429/503
rlippmann May 13, 2023
87db177
add periodic re-login by keepalive task
rlippmann May 13, 2023
daa75dd
add periodic re-login by keepalive task
rlippmann May 13, 2023
b6edde6
add _do_logout_query
rlippmann May 18, 2023
6dc2dff
remove _sync_timestamp
rlippmann May 18, 2023
d1132d1
add relogin_interval property
rlippmann May 18, 2023
f6f4cbb
add re-login interval property
rlippmann May 18, 2023
162c5eb
logging updates
rlippmann May 18, 2023
7a26b5f
remove force_login from async_query
rlippmann May 18, 2023
98caaed
make relogin_interval minutes
rlippmann May 18, 2023
ed33a62
use self._last_timeout_reset for relogin
rlippmann May 18, 2023
767ef62
add extra_params, timeout to async_query debug log msg
rlippmann May 18, 2023
fa35c3a
use _do_logout_query in keepalive task
rlippmann May 18, 2023
c5a05c2
add alarm panel and gateway dataclasses
rlippmann May 19, 2023
8ba542a
remove extra return
rlippmann May 19, 2023
7dab776
Remove circular dependency
rlippmann May 25, 2023
3dae80f
pre-commit fixes
rlippmann May 25, 2023
510012d
more pre-commit fixes
rlippmann May 25, 2023
b6d9be6
even more pre-commit hooks
rlippmann May 25, 2023
8feac2a
remove multiple sites
rlippmann May 25, 2023
f30f1a3
remove create_task_cb
rlippmann May 25, 2023
5d0ecba
remove api version from adtpulseconnection constructor
rlippmann May 25, 2023
6e90d3f
add slots to pulse connection
rlippmann May 25, 2023
36ecd48
add property exceptions to where site == None
rlippmann May 25, 2023
96dc63f
raise exception on _update_sites if no sites exist
rlippmann Jun 8, 2023
ce13ba1
move alarm methods to alarm dataclass
rlippmann Jun 8, 2023
bab1615
rework gateway and alarm panel
rlippmann Jul 14, 2023
45b3a03
rename _adt_service to _pulse_connection in site.py
rlippmann Jul 14, 2023
3f9609e
add _get_device_attributes to site.py
rlippmann Jul 14, 2023
4d8acf3
have alarm panel set gateway status on site creation
rlippmann Jul 14, 2023
1f16773
fix circular reference
rlippmann Jul 14, 2023
43469af
cleanup moved methods
rlippmann Jul 14, 2023
fc6cd79
Fix zone attribute parse
rlippmann Jul 14, 2023
24f6e9b
more fixes to site._fetch_zones
rlippmann Jul 14, 2023
9a50114
change site_fetch_zones to return bool
rlippmann Jul 14, 2023
1378e20
create zones via concurrent tasks
rlippmann Jul 14, 2023
5e31e76
change gateway optional arguments, remove _is_online
rlippmann Jul 15, 2023
c468ff9
add gateway attributes update
rlippmann Aug 28, 2023
caf647a
add parse_pulse_datetime()
rlippmann Aug 28, 2023
9340c30
add parse_pulse_datetime()
rlippmann Aug 28, 2023
0b9edf3
add set_alarm_attributes
rlippmann Aug 29, 2023
3903e4e
slugify device attributes
rlippmann Sep 1, 2023
54927bd
Add gateway and alarm panel attributes
rlippmann Sep 1, 2023
9982b54
rename _fetch_zones to _fetch_devices
rlippmann Sep 1, 2023
ac696dc
rename _fetch_zones to _fetch_devices
rlippmann Sep 1, 2023
4090f61
move update_zone_attributes to zones.py
rlippmann Sep 1, 2023
26e5ffa
add const ADT_GATEWAY_STRING
rlippmann Sep 1, 2023
495baf2
update gateway info during keepalive task
rlippmann Sep 1, 2023
136ed66
move LOG from const.py
rlippmann Sep 5, 2023
8462ed2
add more detail to query exception logging
rlippmann Sep 5, 2023
606f0ce
fix alarm panel attribute update
rlippmann Sep 5, 2023
c23d3a1
fix gateway update in sync task
rlippmann Sep 5, 2023
b0896e4
remove incorrect no site exist message
rlippmann Sep 5, 2023
31fc74e
fix sync token check logic
rlippmann Sep 5, 2023
0fd80f0
fix line too long
rlippmann Sep 5, 2023
2b8a93a
avoid call to device.jsp for camera/keyfob, etc
rlippmann Sep 5, 2023
2fcf1c9
remove key from site.update_zone_attributes
rlippmann Sep 5, 2023
b89fb76
skip call to device.jsp for zones if possible
rlippmann Sep 5, 2023
71bf9e0
add debug logging to set_alarm_attributes
rlippmann Sep 5, 2023
b1dc037
use argparse for example-client
rlippmann Sep 5, 2023
d1af36e
use pprint
rlippmann Sep 5, 2023
32c323c
change relogin and timeout intervals to minutes
rlippmann Sep 10, 2023
380a61a
add STATE_ONLINE to const
rlippmann Sep 10, 2023
ee95d1a
add last_update property to alarm_panel
rlippmann Sep 10, 2023
03f2e22
rework _do_login_query
rlippmann Sep 10, 2023
12cb54d
add keepalive_interval property
rlippmann Sep 10, 2023
042378c
validate service_host
rlippmann Sep 10, 2023
075fb16
add new properties to example-client
rlippmann Sep 11, 2023
3c00c1e
add poll_interval to example-client
rlippmann Sep 11, 2023
c0621fd
add missing test_alarm default to example-client
rlippmann Sep 11, 2023
2dc00fb
add missing new parameters to examples
rlippmann Sep 11, 2023
fa1a78e
fix dictionary change in size while parsing json in example-client
rlippmann Sep 11, 2023
ae2d3d4
allow ints for floats in json in example-client
rlippmann Sep 11, 2023
37e5a0e
pass pyadtpulse._poll_interval to gateway
rlippmann Sep 11, 2023
0faa43f
change float timestamps to int (we don't need that much precision)
rlippmann Sep 12, 2023
696d8e5
oops
rlippmann Sep 12, 2023
4a63d13
change _query exception to use args instead of __str__
rlippmann Sep 18, 2023
556382c
remove unnecessary type: ignore
rlippmann Sep 18, 2023
e99483f
move static methods to top of class defintion
rlippmann Sep 18, 2023
180151f
doc updates
rlippmann Sep 18, 2023
3a781e2
add virtualenv locally with .gitignore
rlippmann Sep 18, 2023
3b4e353
change optional poll, relogin, keepalive interval handling on __init_…
rlippmann Sep 28, 2023
1af0139
add debug log for setting keepalive, relogin intervals
rlippmann Sep 28, 2023
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ build
__pycache__
.mypy_cache
*.swp

.vscode/settings.json
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ repos:
hooks:
- id: pycln
args: [--config=pyproject.toml]
#- repo: https://github.com/pycqa/isort
# rev: 5.12.0
# hooks:
# - id: isort
# files: "\\.(py)$"
# args: [--settings-path=pyproject.toml]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
files: "\\.(py)$"
args: [--settings-path=pyproject.toml]
- repo: https://github.com/dosisod/refurb
rev: v1.15.0
hooks:
Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"module": "example-client",
"justMyCode": true,
"args": [
"/home/rlippmann/pulse.json"
"~/pulse.json"
]
}
]
}
}
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"python.analysis.typeCheckingMode": "basic"
}
"python.analysis.typeCheckingMode": "basic",
"python.terminal.activateEnvironment": true
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 1.1 (2023-09-20)

* bug fixes
* relogin support
* device dataclasses

## 1.0 (2023-03-28)

* async support
* background refresh
* bug fixes

## 0.1.0 (2019-12-16)

* added ability to override the ADT API host (example: Canada endpoint portal-ca.adtpulse.com)
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ for site in adt.sites:
await site.async_arm_away(force=True)
```

The pyadtpulse object runs background tasks and refreshes its data automatically.

Certain parameters can be set to control how often certain actions are run.

Namely:

```python
adt.poll_interval = 0.75 # check for updates every 0.75 seconds
adt.relogin_interval = 60 # relogin every 60 minutes
adt.keepalive_interval = 10 # run keepalive (prevent logout) every 10 minutes
```

See [example-client.py](example-client.py) for a working example.

## Browser Fingerprinting
Expand Down
6 changes: 5 additions & 1 deletion example-client.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@
"debug_locks": false,
"adtpulse_user": "me@myisp.com",
"adtpulse_password": "supersecretpassword",
"adtpulse_fingerprint": "areallyreallyreallyreallyreallylongstring"
"adtpulse_fingerprint": "areallyreallyreallyreallyreallylongstring",
"service_host": "https://portal.adtpulse.com",
"relogin_interval": 60,
"keepalive_interval": 10,
"poll_interval": 0.9
}
Loading