Skip to content

Commit 05bca34

Browse files
Merge branch 'ahayworth:master' into master
2 parents 74d58e8 + 2298cef commit 05bca34

File tree

12 files changed

+2010
-1411
lines changed

12 files changed

+2010
-1411
lines changed

.github/workflows/ci.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,29 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python-version: [3.7, 3.8, 3.9, "3.10"]
12+
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
1313
include:
14-
- python-version: 3.7
15-
toxenv: py37
16-
- python-version: 3.8
17-
toxenv: py38
1814
- python-version: 3.9
1915
toxenv: py39
2016
- python-version: "3.10"
2117
toxenv: py310
18+
- python-version: "3.11"
19+
toxenv: py311
20+
- python-version: "3.12"
21+
toxenv: py312
22+
- python-version: "3.13"
23+
toxenv: py313
2224
steps:
2325
- name: Checkout
24-
uses: actions/checkout@v2
26+
uses: actions/checkout@v5
2527
- name: Set up python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v1
28+
uses: actions/setup-python@v6
2729
with:
2830
python-version: ${{ matrix.python-version }}
2931
- name: Set up poetry
30-
uses: Gr1N/setup-poetry@v7
32+
uses: Gr1N/setup-poetry@v9
3133
- name: Cache dependencies
32-
uses: actions/cache@v1
34+
uses: actions/cache@v4
3335
with:
3436
path: ~/.cache/pypoetry/virtualenvs
3537
key: ${{ runner.os }}-v2-poetry-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
@@ -43,10 +45,10 @@ jobs:
4345
- name: Linters
4446
run: |
4547
poetry run tox -e lint
46-
if: matrix.python-version == '3.8'
48+
if: matrix.python-version == '3.9'
4749
- name: Coverage
4850
run: |
4951
poetry run tox -e coverage
5052
env:
5153
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
52-
if: matrix.python-version == '3.8'
54+
if: matrix.python-version == '3.9'

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[MESSAGES CONTROL]
2-
disable=bad-continuation,too-few-public-methods,too-many-instance-attributes
2+
disable=too-few-public-methods,too-many-instance-attributes

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
[![codecov](https://codecov.io/gh/ahayworth/python_awair/branch/master/graph/badge.svg)](https://codecov.io/gh/ahayworth/python_awair)
66
[![Documentation Status](https://readthedocs.org/projects/python-awair/badge/?version=latest)](https://python-awair.readthedocs.io/en/latest/?badge=latest)
77

8-
This is an async library which accesses portions of the [Awair](https://getawair.com) REST API. It exists primarily
9-
to support the Home Assistant integration, but is considered active and supported by its author. PRs welcome!
8+
This is an async library which accesses portions of the [Awair](https://getawair.com) REST API, and it exists primarily
9+
to support the Home Assistant integration for Awair devices.
1010

1111
Features:
1212
- Object-oriented approach to querying and handling data
@@ -20,6 +20,15 @@ Not yet supported:
2020

2121
Dive into our [documentation](https://python-awair.readthedocs.io/en/latest) to get started!
2222

23+
# Status
24+
25+
This project could be considered in "maintenance mode". It meets the needs of the Home Assistant integration,
26+
and there are no current plans to add new features. Large PRs adding significant new features or drastically
27+
changing the library are unlikely to be accepted without prior discussion (please open an issue first).
28+
29+
However, bug fixes and updates to support python and/or Home Assistant compatibility are welcomed and accepted!
30+
I intend to keep passively maintaining the library, and please open an issue if there is an unaddressed need.
31+
2332
# Development
2433

2534
- We manage dependencies and builds via [poetry](https://python-poetry.org)

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Sphinx configuration for python_awair."""
2+
23
# pylint: skip-file
34
import os
45
import sys

poetry.lock

Lines changed: 1949 additions & 1363 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,47 +18,46 @@ classifiers = [
1818
]
1919

2020
[tool.poetry.dependencies]
21-
python = "^3.7"
22-
aiohttp = "^3.6.1"
21+
python = ">=3.9"
22+
aiohttp = ">=3.6.1"
2323
voluptuous = ">=0.11.7"
2424

25-
[tool.poetry.dev-dependencies]
26-
black = "^19.10b0"
27-
codecov = "^2.0.22"
28-
coverage = "^5.0.4"
29-
flake8 = "^3.7.9"
30-
flake8-docstrings = "^1.5.0"
31-
isort = "^4.3.21"
25+
[tool.poetry.group.dev.dependencies]
26+
black = ">=19.10b0"
27+
codecov = ">=2.1"
28+
coverage = ">=5.0.4"
29+
flake8 = ">=3.7.9"
30+
flake8-docstrings = ">=1.5.0"
31+
isort = ">=4.3.21"
3232
mypy = ">=0.770"
33-
pydocstyle = "^5.0.2"
34-
pylint = "^2.4.4"
35-
pyls-mypy = { git = "https://github.com/tomv564/pyls-mypy" }
33+
pydocstyle = ">=5.0.2"
34+
pylint = ">=2.4.4"
3635
pytest = ">=5.2"
37-
pytest-aiohttp = "^0.3.0"
36+
pytest-aiohttp = ">=0.3.0"
3837
pytest-cov = ">=2.8.1"
39-
python-language-server = "^0.31.9"
40-
sphinx = "^3.0.1"
41-
sphinx-readable-theme = "^1.3.0"
42-
tox = "^3.14.6"
43-
vcrpy = "^4.0.2"
38+
python-language-server = ">=0.31.9"
39+
sphinx = ">=3.0.1"
40+
sphinx-readable-theme = ">=1.3.0"
41+
tox = ">=4"
42+
vcrpy = ">=4.0.2"
4443

45-
[tool.poetry.urls]
46-
"Say Thanks" = "https://saythanks.io/to/ahayworth@gmail.com"
44+
[tool.pytest.ini_options]
45+
asyncio_mode = "auto"
4746

4847
[tool.tox]
4948
legacy_tox_ini = """
5049
[tox]
51-
envlist = py37, py38, py39, py310
50+
envlist = py39, py310, py311, py312, py313
5251
isolated_build = True
5352
skipsdist = True
5453
skip_missing_interpreters = True
5554
5655
[testenv]
57-
whitelist_externals = poetry
56+
allowlist_externals = poetry
5857
commands = poetry run pytest {posargs}
5958
6059
[testenv:lint]
61-
whitelist_externals = poetry
60+
allowlist_externals = poetry
6261
commands =
6362
poetry run black . --check
6463
poetry run isort --check python_awair/ tests/
@@ -67,10 +66,10 @@ commands =
6766
poetry run mypy python_awair/ tests/
6867
6968
[testenv:coverage]
70-
whitelist_externals =
69+
allowlist_externals =
7170
poetry
7271
codecov
73-
passenv = CI CODECOV* GITHUB_ACTION GITHUB_REF GITHUB_REPOSITORY GITHUB_HEAD_REF GITHUB_SHA GITHUB_RUN_ID
72+
passenv = CI,CODECOV*,GITHUB_ACTION,GITHUB_REF,GITHUB_REPOSITORY,GITHUB_HEAD_REF,GITHUB_SHA,GITHUB_RUN_ID
7473
commands =
7574
poetry run pytest --cov=python_awair {posargs}
7675
codecov

python_awair/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Mostly query constants."""
2+
23
BASE_URL = "https://developer-apis.awair.is/v1"
34
USER_URL = f"{BASE_URL}/users/self"
45
DEVICE_URL = f"{USER_URL}/devices"

python_awair/devices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ class AwairLocalDevice(AwairBaseDevice):
436436
device_addr: str
437437
"""The DNS or IP address of the device."""
438438

439-
fw_version: str
439+
fw_version: Optional[str]
440440
"""The firmware version currently running on the device."""
441441

442442
def __init__(

python_awair/indices.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Indices dict with attribute access."""
2+
23
from python_awair.attrdict import AttrDict
34

45

python_awair/user.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""An Awair user."""
22

3-
43
from datetime import date
54
from typing import Any, Dict, List, Optional
65

@@ -116,7 +115,7 @@ def __init__(self, client: AwairClient, attributes: Dict[str, Any]) -> None:
116115
dob_month = attributes.get("dobMonth", None)
117116
dob_year = attributes.get("dobYear", None)
118117

119-
if all([dob_day, dob_month, dob_year]):
118+
if dob_day and dob_month and dob_year:
120119
self.dob = date(day=dob_day, month=dob_month, year=dob_year)
121120
else:
122121
self.dob = None

0 commit comments

Comments
 (0)