Skip to content
Open
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
12 changes: 4 additions & 8 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@

name: Python package

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

jobs:
build:
Expand All @@ -16,12 +12,12 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
8 changes: 4 additions & 4 deletions aranet4/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import re
import struct
import math
from typing import List, NamedTuple
from typing import NamedTuple

from bleak import BleakClient
from bleak import BleakScanner
Expand Down Expand Up @@ -534,7 +534,7 @@ class Record:
version: str
records_on_device: int
filter: Filter
value: List[RecordItem] = field(default_factory=list)
value: list[RecordItem] = field(default_factory=list)


@dataclass
Expand Down Expand Up @@ -1085,7 +1085,7 @@ async def stop(self):
await self.scanner.stop()


async def _find_nearby(detect_callback: callable, duration: int) -> List[BLEDevice]:
async def _find_nearby(detect_callback: callable, duration: int) -> list[BLEDevice]:
scanner = Aranet4Scanner(detect_callback)
await scanner.start()
await asyncio.sleep(duration)
Expand All @@ -1095,7 +1095,7 @@ async def _find_nearby(detect_callback: callable, duration: int) -> List[BLEDevi
if "Aranet" in device.name]


def find_nearby(detect_callback: callable, duration: int = 5) -> List[BLEDevice]:
def find_nearby(detect_callback: callable, duration: int = 5) -> list[BLEDevice]:
"""
Scans for nearby Aranet4 devices.
Will call callback on every valid Aranet4 advertisement, including duplicates
Expand Down
2 changes: 1 addition & 1 deletion examples/influx/import.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def main(argv):
results = []

device_name = argv[1]
with open(file=argv[0], mode="r", encoding="utf-8") as file:
with open(file=argv[0], encoding="utf-8") as file:
lines = file.readlines()

for ln in lines:
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import setuptools

with open(file="README.md", mode="r", encoding="utf-8") as file:
with open(file="README.md", encoding="utf-8") as file:
long_description = file.read()

setuptools.setup(
Expand All @@ -11,6 +11,7 @@
long_description_content_type="text/markdown",
url="https://github.com/Anrijs/Aranet4-Python",
packages=setuptools.find_packages(),
python_requires=">=3.10",
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def build_data():
log_filter = client.Filter(1, 14, True, True, True, True, True, True, True, True)
records = client.Record("mock_device", "v1234", 14, log_filter)
with open(file=data_file, mode="r", encoding="utf-8") as csv_file:
with open(file=data_file, encoding="utf-8") as csv_file:
reader = csv.DictReader(csv_file)
for row in reader:
records.value.append(client.RecordItem(**row))
Expand Down