Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 0 additions & 17 deletions .envrc

This file was deleted.

12 changes: 6 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: weekly
time: "13:00"
open-pull-requests-limit: 10
- package-ecosystem: uv
directory: "/"
schedule:
interval: weekly
time: "13:00"
open-pull-requests-limit: 10
8 changes: 4 additions & 4 deletions .github/workflows/bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
name: Bandit
on:
push:
branches: [ "master" ]
branches: ["master"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
branches: ["master"]
schedule:
- cron: '22 19 * * 3'
- cron: "22 19 * * 3"

jobs:
bandit:
Expand All @@ -29,7 +29,7 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Bandit Scan
uses: shundor/python-bandit-scan@9cc5aa4a006482b8a7f91134412df6772dbda22c
with: # optional arguments
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,22 @@ permissions:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"

- name: Build package
run: |
uv build

- name: Build and publish to PyPi
uses: JRubics/poetry-publish@v2.1
with:
pypi_token: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish to PyPi
run: |
uv publish
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
37 changes: 10 additions & 27 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,25 @@ name: Test Multiple Python Versions

on:
push:
branches: [ "master" ]
branches: ["master"]
pull_request:
branches: [ "master" ]
branches: ["master"]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
- uses: actions/checkout@v4

# Should be using Ruff
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Setup uv
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}

- name: Test with pytest
run: |
pytest
- name: Test with pytest
run: |
uv run --frozen pytest
39 changes: 0 additions & 39 deletions .github/workflows/python-publish.yml

This file was deleted.

14 changes: 3 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
---
# pre-commit autoupdate
# pre-commit run --all-files

fail_fast: true

repos:
Expand All @@ -13,16 +10,11 @@ repos:
- id: requirements-txt-fixer

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.2
rev: v0.12.3
hooks:
- id: ruff
args: [ --fix ] # run linter
- id: ruff-format # run formatter

- repo: https://github.com/dosisod/refurb
rev: v2.1.0
hooks:
- id: refurb
args: [--fix] # run linter
- id: ruff-format # run formatter

- repo: https://github.com/asottile/pyupgrade
rev: v3.20.0
Expand Down
69 changes: 69 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# PyADTPulse Development Guide

Welcome! This guide explains how to set up a local development environment for contributing to pyadtpulse.

---

## 📦 Requirements

Before you start, ensure you have installed:

- Any supported version of Python3
- The newest version of Git
- A code editor (e.g., VSCode)

---

## 🧪 Setting Up the Development Environment with `uv`

This project uses [`uv`](https://github.com/astral-sh/uv), a fast Python package manager, to manage dependencies.

### 🔧 Installation (one-time setup)

If you don't have `uv` installed yet see the uv [installation guide](https://docs.astral.sh/uv/getting-started/installation/)

---

### 📦 Setup Python Environment

**Note:** These steps will:

- Create the `.venv` virtual environment directory (even if it already exists)
- Install all dependencies from uv.lock into the `.venv`
- Update .git/hooks/pre-commit to use pre-commit installed in your .venv

From the root of the project, run:

- `uv sync`
- `uv run pre-commit install`

### Update vscode to use your .venv

- `ctrl + shift + p (Command Pallet)`
- `Python: Select Interpreter`
- Select the environment to use. should be: `./.venv/bin/python`

---

### Running Scripts

With uv, we don't need to activate the .venv to interact with it.

- new dependancies can be added using `uv add package_name`
- The .venv will be used automatically when running python scripts or packages using:
- `uv run ./script.py` or `uv run pytest tests` for example

### Updating python versions

.python-version is used by uv to install the correct version of python in the .venv
the requires-python field in pyproject.toml is used by uv to determine functioning versions of dependancies.

if the python version needs to be updated, the exact version to use should be updated in .python-version, and the pyproject.toml should be reviewed to ensure its criteria works with the .python-version

for example: if the pyproject.toml has requires-python == "3.13.3" and .python-version = 3.13.4, there will be issues.


### Distribute New Python Package to PyPi

uv build
uv publish --token {{pypi_secret}}
6 changes: 0 additions & 6 deletions PROJECT.md

This file was deleted.

14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ sensors, door sensors, etc) as well as arming and disarming individual sites.
NOTE: Since this interacts with the unofficial ADT Pulse AJAX web service, the
behavior is subject to change by ADT without notice.

## Developer Note

NOTE: This package use [pre-commit](https://pre-commit.com/) hooks for maintaining code quality.
Please install pre-commit and enable it for your local git copy before committing.
## Making Contributions
Want to contribute? See the [Development](./DEVELOPMENT.md) documentation for setup instructions.

## WARNING

Expand All @@ -31,7 +29,7 @@ Do not reauthenticate to the ADT service frequently as ADT's service is not desi
## Installation

```
pip3 install pyadtpulse
pip install pyadtpulse
```

## Usage
Expand Down Expand Up @@ -107,15 +105,15 @@ The browser fingerprint will change with a browser/OS upgrade. While it is not

There are 2 ways to determine this fingerprint:

1. Visit [this link](https://rawcdn.githack.com/rlippmann/pyadtpulse/b3a0e7097e22446623d170f0a971726fbedb6a2d/doc/browser_fingerprint.html) using the same browser you used to authenticate with ADT Pulse. This should determine the correct browser fingerprint
1. Visit [this link](https://rawcdn.githack.com/homeassistant-projects/pyadtpulse/5fe719d2bea2b6e68aec0588c4d92f363223424d/doc/browser_fingerprint.html) using the same browser you used to authenticate with ADT Pulse. This should determine the correct browser fingerprint

2. Follow the instructions [here](https://github.com/mrjackyliang/homebridge-adt-pulse#configure-2-factor-authentication)

## See Also

- [ADT Pulse Portal](https://portal.adtpulse.com/)
- [Home Assistant ADT Pulse integration](https://github.com/rsnodgrass/hass-adtpulse/)
- [adt-pulse-mqtt](https://github.com/haruny/adt-pulse-mqtt) – MQTT integration with ADT Pulse alarm panels
- [Home Assistant ADT Pulse integration](https://github.com/homeassistant-projects/hass-adtpulse)
- [adt-pulse-mqtt](https://github.com/adt-pulse-mqtt/adt-pulse-mqtt) – MQTT integration with ADT Pulse alarm panels

## Future Enhancements

Expand Down
Empty file removed poetry.lock
Empty file.
5 changes: 0 additions & 5 deletions pylintrc

This file was deleted.

Loading
Loading