Skip to content

Commit

Permalink
Merge pull request #38 from rlippmann/master
Browse files Browse the repository at this point in the history
1.2.0-1.2.9
  • Loading branch information
rsnodgrass authored Apr 22, 2024
2 parents bac9d3c + 75794f1 commit 9222c48
Show file tree
Hide file tree
Showing 75 changed files with 23,291 additions and 1,662 deletions.
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/[email protected]
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
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ repos:
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: 24.3.0
hooks:
Expand Down Expand Up @@ -32,3 +37,4 @@ repos:
rev: 'v0.3.4'
hooks:
- id: ruff

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
}
}
]
}
61 changes: 61 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,64 @@
## 1.2.9 (2024-04-21)

* ignore query string in check_login_errors(). This should fix a bug where the task was logged out
but not correctly being identified
* remove unnecessary warning in alarm status check
* add arm night
* refactor update_alarm_from_etree()
* bump to newer user agent
* skip sync check if it will back off
* fix linter issue in _initialize_sites

## 1.2.8 (2024-03-07)

* add more detail to "invalid sync check" error logging
* don't exit sync check task on service temporarily unavailable or invalid login
* don't use empty site id for logins

## 1.2.7 (2024-02-23)

* catch site is None on logout to prevent "have you logged in" errors
* speed improvements via aiohttp-zlib-ng

## 1.2.6 (2024-02-23)

Performance improvements including:

* switch from BeautifulSoup to lxml for faster parsing
* optimize zone parsing to only update zones which have changed
* change wait_for_update() to pass the changed zones/alarm state to caller

## 1.2.5 (2024-02-10)

* don't raise not logged in exception when sync check task logs out
* change full logout interval to approximately every 6 hours

## 1.2.4 (2024-02-08)

* change yarl dependencies

## 1.2.3 (2024-02-08)

* change aiohttp dependencies

## 1.2.2 (2024-02-07)

* add yarl as dependency

## 1.2.1 (2024-02-07)

* add timing loggin for zone/site updates
* do full logout once per day
* have keepalive task wait for sync check task to sleep before logging out

## 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
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,12 @@ ADT Pulse requires 2 factor authentication to log into their site. When you perf

Internally, ADT uses some Javascript code to create a browser fingerprint. This (very long) string is used to check that the browser has been saved upon subsequent logins. It is the "fingerprint" parameter required to be passed in to the PyADTPulse object constructor.

### Note:
### Notes:

The browser fingerprint will change with a browser/OS upgrade. While it is not strictly necessary to create a separate username/password for logging in through pyadtpulse, it is recommended to do so.

**<ins>Warning:</ins> If another connection is made to the Pulse portal with the same fingerprint, the first connection will be logged out. For this reason it is recommended to use a browser/machine you would not normally use to log into the Pulse web site to generate the fingerprint.**

The browser fingerprint will change with a browser/OS upgrade. For this reason, it is recommended to create a separate username in ADT Pulse just for monitoring.

There are 2 ways to determine this fingerprint:

Expand Down
Loading

0 comments on commit 9222c48

Please sign in to comment.