Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
cc9647f
added tests for http class
wmalgadey Dec 19, 2024
8a63301
Merge pull request #100 from FilBr/master
wmalgadey Dec 19, 2024
1d86fa6
removed obsolete method to create the request class
wmalgadey Dec 19, 2024
68b8521
add types
wmalgadey Dec 19, 2024
41e0b33
add test for hops tado class
wmalgadey Dec 19, 2024
6239dfb
bumped version to 0.18.4
wmalgadey Dec 19, 2024
cdc32cd
small refactorings
wmalgadey Dec 19, 2024
a318202
added tests for tado x heating
wmalgadey Dec 19, 2024
4e18402
fixed tado x hvac mode and connection state
wmalgadey Dec 19, 2024
cc91edb
made some changes to tadox devices
wmalgadey Dec 19, 2024
9083ea9
added tariff and genie api
wmalgadey Dec 19, 2024
c860f97
added better tests to http class
wmalgadey Dec 19, 2024
077e119
fixed error
wmalgadey Dec 19, 2024
9b6967f
fixed devices call
wmalgadey Dec 19, 2024
8c5cf4d
added test to termination condition
wmalgadey Dec 20, 2024
8750982
test to output code coverage in PR and action summary
wmalgadey Dec 20, 2024
10b8ff2
changed workflow settings
wmalgadey Dec 20, 2024
4969329
renamed workflows for better transparency
wmalgadey Dec 20, 2024
a5254bd
changed job names
wmalgadey Dec 20, 2024
e86f8c5
renamed worflows
wmalgadey Dec 20, 2024
b543811
add artifact back to lint and test workflow
wmalgadey Dec 20, 2024
d60ba28
changed test report artifact name
wmalgadey Dec 20, 2024
f5fd83f
Merge pull request #101 from wmalgadey/show-code-coverage
wmalgadey Dec 20, 2024
321be9d
adding the minder api from PR !64
wmalgadey Dec 20, 2024
069d422
Merge pull request #107 from wmalgadey/minder-api-support
wmalgadey Dec 20, 2024
ac455ed
bumped version to 0.18.5
wmalgadey Dec 20, 2024
1102bf1
do not break compatibility yet! (#114)
wmalgadey Dec 21, 2024
f42e504
add simple contribution guide (#109)
wmalgadey Dec 21, 2024
5a9e5d3
added pre commit features (#110)
wmalgadey Dec 21, 2024
91121d2
fixed status badges
wmalgadey Dec 21, 2024
e5dd148
changed status badge for release
wmalgadey Dec 21, 2024
ffb36d1
autofixed pre-commit changes
wmalgadey Dec 21, 2024
d9588fe
changed pre-commit settings for line-length
wmalgadey Dec 25, 2024
9403e60
changed permission settings to report test results
wmalgadey Dec 25, 2024
a31d9e9
Add Devcontainer (#119)
erwindouna Dec 25, 2024
058ccd5
whitespace removed
wmalgadey Dec 25, 2024
5a12dba
fixed all pre commit errors (#121)
wmalgadey Dec 25, 2024
904f92a
Refactoring by adding a decorator to hops_tado.py (#122)
wmalgadey Dec 25, 2024
0be233d
Tidy pre-commit config + setup CI (#130)
inverse Dec 28, 2024
858733f
Adding minor improvements (#125)
erwindouna Dec 28, 2024
f938ee3
Small fixes (#133)
wmalgadey Dec 28, 2024
eaec632
add home by bridge api to my tado (#134)
wmalgadey Dec 28, 2024
71849f4
Support devices with serialNumber as their property (#124)
inverse Dec 28, 2024
ac56425
Add childlock support (#127)
erwindouna Dec 28, 2024
638653d
fix for autopep8 (#135)
Moritz-Schmidt Dec 29, 2024
51860cd
Fixed devcontainer (#136)
wmalgadey Dec 30, 2024
a81be2a
Bootstrap improvements (#137)
inverse Dec 30, 2024
c2310e6
Fix script naming (#138)
inverse Jan 1, 2025
dbf2295
Tidy GitHub action pipelines (#139)
inverse Jan 1, 2025
5dbecaf
drop coverage and add codecov.io (#140)
wmalgadey Jan 1, 2025
bfab483
Add main test foundations (#141)
inverse Jan 1, 2025
dc0818f
Merge branch 'master' into fix-open-window-mode-merge-conflicts
FilBr Jan 3, 2025
7272721
fix: pre-commits
Jan 3, 2025
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
70 changes: 70 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"customizations": {
"codespaces": {
"openFiles": [
"README.md",
"CONTRIBUTING.md"
]
},
"vscode": {
"extensions": [
"ms-python.python",
"redhat.vscode-yaml",
"esbenp.prettier-vscode",
"GitHub.vscode-pull-request-github",
"charliermarsh.ruff",
"GitHub.vscode-github-actions",
"ryanluker.vscode-coverage-gutters"
],
"settings": {
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll": "always",
"source.organizeImports": "always"
}
},
"coverage-gutters.customizable.context-menu": true,
"coverage-gutters.customizable.status-bar-toggler-watchCoverageAndVisibleEditors-enabled": true,
"coverage-gutters.showGutterCoverage": false,
"coverage-gutters.showLineCoverage": true,
"coverage-gutters.xmlname": "coverage.xml",
"python.analysis.extraPaths": [
"${workspaceFolder}/src"
],
"python.defaultInterpreterPath": ".venv/bin/python",
"python.formatting.provider": "black",
"python.linting.enabled": true,
"python.linting.mypyEnabled": true,
"python.linting.pylintEnabled": true,
"python.testing.cwd": "${workspaceFolder}",
"python.testing.pytestArgs": [
"--cov-report=xml"
],
"python.testing.pytestEnabled": true,
"ruff.importStrategy": "fromEnvironment",
"ruff.interpreter": [
".venv/bin/python"
],
"terminal.integrated.defaultProfile.linux": "zsh"
}
}
},
"features": {
"ghcr.io/devcontainers-contrib/features/poetry:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/python:1": {
"installTools": false
}
},
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.12",
"name": "PyTado",
"postStartCommand": "bash scripts/bootstrap",
"updateContentCommand": "bash scripts/bootstrap",
"containerUser": "vscode",
"remoteUser": "vscode",
"updateRemoteUserUID": true,
"containerEnv": {
"HOME": "/home/vscode"
}
}
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export VIRTUAL_ENV=."venv"
layout python

[[ -f .envrc.private ]] && source_env .envrc.private
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"

on:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package
name: Lint and test multiple Python versions

on:
push:
Expand All @@ -10,44 +10,58 @@ on:
branches: [ master ]

jobs:
build:
lint:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v4

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


- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .

pip install -e '.[all]'

- name: Lint with black
uses: psf/black@stable
with:
options: "--check --verbose"
src: "./PyTado"
use_pyproject: true

- name: Run Tests with Coverage

test:

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

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.[all]'

- name: Run Tests with coverage
run: |
pip install coverage pytest pytest-cov
coverage run -m pytest --maxfail=1 --disable-warnings -q
coverage report -m
coverage html

# Optionally upload coverage reports as an artifact.
- name: Upload coverage report
uses: actions/upload-artifact@v3
pytest --cov --junitxml=junit.xml -o junit_family=legacy --cov-branch --cov-report=xml

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
name: coverage-html-report
path: coverage_html_report
token: ${{ secrets.CODECOV_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
push:
branches-ignore:
- master
pull_request: ~

env:
FORCE_COLOR: 1

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.[all]'

- name: Run pre-commit hooks
uses: pre-commit/action@v3.0.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Upload Python Package
name: Build and deploy to pypi

on:
release:
Expand All @@ -20,8 +20,6 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
Expand Down
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ instance/
# Sphinx documentation
docs/_build/

# Ruff cache
.ruff_cache

# Example dev
/examples/example_dev.py

# PyBuilder
.pybuilder/
target/
Expand Down Expand Up @@ -127,6 +133,8 @@ venv/
ENV/
env.bak/
venv.bak/
.envrc.private
!/.envrc

# Spyder project settings
.spyderproject
Expand Down Expand Up @@ -157,4 +165,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
#.idea/

.DS_Store
junit.xml
85 changes: 85 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
fail_fast: true

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: no-commit-to-branch
name: "Don't commit to master branch"
args: [--branch, master]
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: check-json
- id: end-of-file-fixer
exclude: custom_components/econnect_metronet/manifest.json
- id: mixed-line-ending
- id: trailing-whitespace


- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
exclude: tests/
args: ["--profile", "black"]

- repo: https://github.com/hhatto/autopep8
rev: v2.3.1
hooks:
- id: autopep8
exclude: tests/
args: [--max-line-length=100, --in-place, --aggressive]

- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
exclude: tests/
args: [--max-line-length=100]

- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade

- repo: https://github.com/PyCQA/bandit
rev: '1.8.0'
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.4
hooks:
- id: ruff
exclude: tests/
args: [--line-length=100, --fix]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.0
hooks:
- id: mypy
exclude: tests/
additional_dependencies: [types-requests]

- repo: local
hooks:
- id: prettier
name: prettier
entry: prettier
language: system
types: [python, json, yaml, markdown]

- id: pytest
name: pytest
entry: pytest
language: python
types: [python]
pass_filenames: false
always_run: true
additional_dependencies: [responses, pytest-mock]
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"github.vscode-github-actions",
"ms-python.pylint"
]
}
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"ansible.python.interpreterPath": "/Volumes/Daten/Projects/PyTado/.venv/bin/python"
}
}
Loading
Loading