python-rako-2025 0.3.11__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- python_rako_2025-0.4.0/.claude/settings.local.json +13 -0
- python_rako_2025-0.4.0/.coveragerc +22 -0
- python_rako_2025-0.4.0/.editorconfig +22 -0
- python_rako_2025-0.4.0/.flake8 +3 -0
- python_rako_2025-0.4.0/.gitattributes +2 -0
- python_rako_2025-0.4.0/.github/dependabot.yml +15 -0
- python_rako_2025-0.4.0/.github/workflows/ci.yml +54 -0
- python_rako_2025-0.4.0/.github/workflows/release.yml +50 -0
- python_rako_2025-0.4.0/.gitignore +140 -0
- python_rako_2025-0.4.0/.isort.cfg +3 -0
- python_rako_2025-0.4.0/.pre-commit-config.yaml +35 -0
- python_rako_2025-0.4.0/.yamllint +63 -0
- python_rako_2025-0.4.0/Makefile +124 -0
- {python_rako_2025-0.3.11/python_rako_2025.egg-info → python_rako_2025-0.4.0}/PKG-INFO +21 -11
- python_rako_2025-0.4.0/catalog-info.yaml +18 -0
- python_rako_2025-0.4.0/conftest.py +29 -0
- python_rako_2025-0.4.0/doc/accessing-the-rako-bridge.pdf +0 -0
- python_rako_2025-0.4.0/examples/discover_all_devices.py +72 -0
- python_rako_2025-0.4.0/examples/example.py +38 -0
- python_rako_2025-0.4.0/examples/ventilation_example.py +51 -0
- python_rako_2025-0.4.0/examples/view_updates.py +47 -0
- python_rako_2025-0.4.0/pyproject.toml +131 -0
- {python_rako_2025-0.3.11 → python_rako_2025-0.4.0}/python_rako/__init__.py +14 -8
- python_rako_2025-0.4.0/python_rako/__version__.py +1 -0
- {python_rako_2025-0.3.11 → python_rako_2025-0.4.0}/python_rako/bridge.py +27 -36
- {python_rako_2025-0.3.11 → python_rako_2025-0.4.0}/python_rako/helpers.py +26 -34
- python_rako_2025-0.4.0/tests/README_TESTING.md +46 -0
- python_rako_2025-0.4.0/tests/resources/rako.xml +46 -0
- python_rako_2025-0.4.0/tests/resources/rako2.xml +22 -0
- python_rako_2025-0.4.0/tests/resources/rako3.xml +397 -0
- python_rako_2025-0.4.0/tests/test_async_lock.py +291 -0
- {python_rako_2025-0.3.11 → python_rako_2025-0.4.0}/tests/test_bridge.py +10 -32
- python_rako_2025-0.4.0/tests/test_edge_cases.py +138 -0
- {python_rako_2025-0.3.11 → python_rako_2025-0.4.0}/tests/test_helpers.py +2 -4
- {python_rako_2025-0.3.11 → python_rako_2025-0.4.0}/tests/test_model.py +1 -1
- python_rako_2025-0.4.0/tests/test_xml_parsing.py +140 -0
- python_rako_2025-0.4.0/tests_integration/__init__.py +0 -0
- python_rako_2025-0.4.0/tests_integration/conftest.py +21 -0
- python_rako_2025-0.4.0/tests_integration/test_command_live.py +106 -0
- python_rako_2025-0.4.0/tests_integration/test_general_live.py +41 -0
- python_rako_2025-0.3.11/PKG-INFO +0 -167
- python_rako_2025-0.3.11/pyproject.toml +0 -90
- python_rako_2025-0.3.11/python_rako/__version__.py +0 -1
- python_rako_2025-0.3.11/python_rako_2025.egg-info/SOURCES.txt +0 -20
- python_rako_2025-0.3.11/python_rako_2025.egg-info/dependency_links.txt +0 -1
- python_rako_2025-0.3.11/python_rako_2025.egg-info/requires.txt +0 -3
- python_rako_2025-0.3.11/python_rako_2025.egg-info/top_level.txt +0 -1
- python_rako_2025-0.3.11/setup.cfg +0 -4
- python_rako_2025-0.3.11/setup.py +0 -3
- {python_rako_2025-0.3.11 → python_rako_2025-0.4.0}/LICENSE +0 -0
- {python_rako_2025-0.3.11 → python_rako_2025-0.4.0}/README.md +0 -0
- {python_rako_2025-0.3.11 → python_rako_2025-0.4.0}/python_rako/const.py +0 -0
- {python_rako_2025-0.3.11 → python_rako_2025-0.4.0}/python_rako/exceptions.py +0 -0
- {python_rako_2025-0.3.11 → python_rako_2025-0.4.0}/python_rako/model.py +0 -0
- {python_rako_2025-0.3.11 → python_rako_2025-0.4.0}/python_rako/py.typed +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[run]
|
|
2
|
+
source = python_rako
|
|
3
|
+
omit =
|
|
4
|
+
python_rako/__init__.py
|
|
5
|
+
python_rako/bridge.py
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
[report]
|
|
9
|
+
# Regexes for lines to exclude from consideration
|
|
10
|
+
exclude_lines =
|
|
11
|
+
# Have to re-enable the standard pragma
|
|
12
|
+
pragma: no cover
|
|
13
|
+
|
|
14
|
+
# Don't complain about missing debug-only code:
|
|
15
|
+
def __repr__
|
|
16
|
+
|
|
17
|
+
# Don't complain if tests don't hit defensive assertion code:
|
|
18
|
+
raise AssertionError
|
|
19
|
+
raise NotImplementedError
|
|
20
|
+
|
|
21
|
+
# TYPE_CHECKING block is never executed during pytest run
|
|
22
|
+
if TYPE_CHECKING:
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
charset = utf-8
|
|
5
|
+
end_of_line = lf
|
|
6
|
+
indent_style = space
|
|
7
|
+
insert_final_newline = true
|
|
8
|
+
trim_trailing_whitespace = true
|
|
9
|
+
ident_size = 4
|
|
10
|
+
|
|
11
|
+
[*.md]
|
|
12
|
+
ident_size = 2
|
|
13
|
+
trim_trailing_whitespace = false
|
|
14
|
+
|
|
15
|
+
[*.json]
|
|
16
|
+
ident_size = 2
|
|
17
|
+
|
|
18
|
+
[{.gitignore,.gitkeep,.editorconfig}]
|
|
19
|
+
ident_size = 2
|
|
20
|
+
|
|
21
|
+
[Makefile]
|
|
22
|
+
ident_style = tab
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 2
|
|
3
|
+
updates:
|
|
4
|
+
- package-ecosystem: pip
|
|
5
|
+
directory: "/"
|
|
6
|
+
schedule:
|
|
7
|
+
interval: daily
|
|
8
|
+
time: "06:00"
|
|
9
|
+
open-pull-requests-limit: 10
|
|
10
|
+
- package-ecosystem: "github-actions"
|
|
11
|
+
directory: "/"
|
|
12
|
+
schedule:
|
|
13
|
+
interval: daily
|
|
14
|
+
time: "06:00"
|
|
15
|
+
open-pull-requests-limit: 10
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Continuous Integration
|
|
3
|
+
|
|
4
|
+
on: [push, pull_request]
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
linting:
|
|
8
|
+
name: Linting
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- name: Checking out code from GitHub
|
|
12
|
+
uses: actions/checkout@v4
|
|
13
|
+
- name: Set up Python 3.12
|
|
14
|
+
uses: actions/setup-python@v5
|
|
15
|
+
with:
|
|
16
|
+
python-version: "3.12"
|
|
17
|
+
- name: Install dependencies
|
|
18
|
+
run: |
|
|
19
|
+
python -m pip install --upgrade pip
|
|
20
|
+
pip install .[dev]
|
|
21
|
+
pip list
|
|
22
|
+
- name: Run pre-commit on all files
|
|
23
|
+
run: |
|
|
24
|
+
pre-commit run --all-files --show-diff-on-failure
|
|
25
|
+
|
|
26
|
+
test:
|
|
27
|
+
name: Python ${{ matrix.python }} on ${{ matrix.os }}
|
|
28
|
+
runs-on: ${{ matrix.os }}-latest
|
|
29
|
+
strategy:
|
|
30
|
+
matrix:
|
|
31
|
+
os: [ubuntu]
|
|
32
|
+
python: ["3.12", "3.13"]
|
|
33
|
+
steps:
|
|
34
|
+
- name: Checking out code from GitHub
|
|
35
|
+
uses: actions/checkout@v4
|
|
36
|
+
- name: Set up Python ${{ matrix.python }}
|
|
37
|
+
uses: actions/setup-python@v5
|
|
38
|
+
with:
|
|
39
|
+
python-version: ${{ matrix.python }}
|
|
40
|
+
- name: Install dependencies
|
|
41
|
+
run: |
|
|
42
|
+
python -m pip install --upgrade pip
|
|
43
|
+
pip install .[test]
|
|
44
|
+
pip list
|
|
45
|
+
- name: Run tests with coverage
|
|
46
|
+
run: python -m pytest
|
|
47
|
+
- name: Upload coverage to Codecov
|
|
48
|
+
if: matrix.python == '3.12' && matrix.os == 'ubuntu'
|
|
49
|
+
uses: codecov/codecov-action@v5
|
|
50
|
+
with:
|
|
51
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
52
|
+
file: ./coverage.xml
|
|
53
|
+
flags: unittests
|
|
54
|
+
name: codecov-umbrella
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: PyPi Release
|
|
3
|
+
|
|
4
|
+
# https://help.github.com/en/actions/reference/events-that-trigger-workflows
|
|
5
|
+
on:
|
|
6
|
+
release:
|
|
7
|
+
types:
|
|
8
|
+
- created
|
|
9
|
+
|
|
10
|
+
# based on https://github.com/pypa/gh-action-pypi-publish
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checking out code from GitHub
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
- name: Set up Python 3.12
|
|
19
|
+
uses: actions/setup-python@v4
|
|
20
|
+
with:
|
|
21
|
+
python-version: 3.12
|
|
22
|
+
- name: generate version file
|
|
23
|
+
run: |
|
|
24
|
+
echo "$RELEASE_TAG" > python_rako/__version__.py
|
|
25
|
+
cat python_rako/__version__.py
|
|
26
|
+
env:
|
|
27
|
+
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: |
|
|
30
|
+
python -m pip install --user --upgrade pip setuptools wheel build
|
|
31
|
+
- name: Build
|
|
32
|
+
run: >-
|
|
33
|
+
python -m build
|
|
34
|
+
|
|
35
|
+
# TEST
|
|
36
|
+
- name: Publish to Test PyPI
|
|
37
|
+
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
|
|
38
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
39
|
+
with:
|
|
40
|
+
user: __token__
|
|
41
|
+
password: ${{ secrets.TEST_PYPI_TOKEN }}
|
|
42
|
+
repository_url: https://test.pypi.org/legacy/
|
|
43
|
+
|
|
44
|
+
# PROD
|
|
45
|
+
- name: Publish distribution 📦 to PyPI
|
|
46
|
+
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
|
|
47
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
48
|
+
with:
|
|
49
|
+
user: __token__
|
|
50
|
+
password: ${{ secrets.PYPI_TOKEN }}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
config/*
|
|
2
|
+
config2/*
|
|
3
|
+
|
|
4
|
+
tests/testing_config/deps
|
|
5
|
+
tests/testing_config/home-assistant.log
|
|
6
|
+
|
|
7
|
+
# hass-release
|
|
8
|
+
data/
|
|
9
|
+
.token
|
|
10
|
+
|
|
11
|
+
# Hide sublime text stuff
|
|
12
|
+
*.sublime-project
|
|
13
|
+
*.sublime-workspace
|
|
14
|
+
|
|
15
|
+
# Hide some OS X stuff
|
|
16
|
+
.DS_Store
|
|
17
|
+
.AppleDouble
|
|
18
|
+
.LSOverride
|
|
19
|
+
Icon
|
|
20
|
+
|
|
21
|
+
# Thumbnails
|
|
22
|
+
._*
|
|
23
|
+
|
|
24
|
+
# IntelliJ IDEA
|
|
25
|
+
.idea
|
|
26
|
+
*.iml
|
|
27
|
+
|
|
28
|
+
# pytest
|
|
29
|
+
.pytest_cache
|
|
30
|
+
.cache
|
|
31
|
+
|
|
32
|
+
# GITHUB Proposed Python stuff:
|
|
33
|
+
*.py[cod]
|
|
34
|
+
|
|
35
|
+
# C extensions
|
|
36
|
+
*.so
|
|
37
|
+
|
|
38
|
+
# Packages
|
|
39
|
+
*.egg
|
|
40
|
+
*.egg-info
|
|
41
|
+
dist
|
|
42
|
+
build
|
|
43
|
+
eggs
|
|
44
|
+
.eggs
|
|
45
|
+
parts
|
|
46
|
+
bin
|
|
47
|
+
var
|
|
48
|
+
sdist
|
|
49
|
+
develop-eggs
|
|
50
|
+
.installed.cfg
|
|
51
|
+
lib
|
|
52
|
+
lib64
|
|
53
|
+
pip-wheel-metadata
|
|
54
|
+
|
|
55
|
+
# Logs
|
|
56
|
+
*.log
|
|
57
|
+
pip-log.txt
|
|
58
|
+
|
|
59
|
+
# Unit test / coverage reports
|
|
60
|
+
.coverage
|
|
61
|
+
.tox
|
|
62
|
+
coverage.xml
|
|
63
|
+
nosetests.xml
|
|
64
|
+
htmlcov/
|
|
65
|
+
test-reports/
|
|
66
|
+
test-results.xml
|
|
67
|
+
test-output.xml
|
|
68
|
+
|
|
69
|
+
# Translations
|
|
70
|
+
*.mo
|
|
71
|
+
|
|
72
|
+
# Mr Developer
|
|
73
|
+
.mr.developer.cfg
|
|
74
|
+
.project
|
|
75
|
+
.pydevproject
|
|
76
|
+
|
|
77
|
+
.python-version
|
|
78
|
+
|
|
79
|
+
# emacs auto backups
|
|
80
|
+
*~
|
|
81
|
+
*#
|
|
82
|
+
*.orig
|
|
83
|
+
|
|
84
|
+
# venv stuff
|
|
85
|
+
pyvenv.cfg
|
|
86
|
+
pip-selfcheck.json
|
|
87
|
+
venv
|
|
88
|
+
.venv
|
|
89
|
+
Pipfile*
|
|
90
|
+
share/*
|
|
91
|
+
/Scripts/
|
|
92
|
+
|
|
93
|
+
# vimmy stuff
|
|
94
|
+
*.swp
|
|
95
|
+
*.swo
|
|
96
|
+
tags
|
|
97
|
+
ctags.tmp
|
|
98
|
+
|
|
99
|
+
# vagrant stuff
|
|
100
|
+
virtualization/vagrant/setup_done
|
|
101
|
+
virtualization/vagrant/.vagrant
|
|
102
|
+
virtualization/vagrant/config
|
|
103
|
+
|
|
104
|
+
# Visual Studio Code
|
|
105
|
+
.vscode/*
|
|
106
|
+
!.vscode/cSpell.json
|
|
107
|
+
!.vscode/extensions.json
|
|
108
|
+
!.vscode/tasks.json
|
|
109
|
+
.env
|
|
110
|
+
|
|
111
|
+
# Built docs
|
|
112
|
+
docs/build
|
|
113
|
+
|
|
114
|
+
# Windows Explorer
|
|
115
|
+
desktop.ini
|
|
116
|
+
/home-assistant.pyproj
|
|
117
|
+
/home-assistant.sln
|
|
118
|
+
/.vs/*
|
|
119
|
+
|
|
120
|
+
# mypy
|
|
121
|
+
/.mypy_cache/*
|
|
122
|
+
/.dmypy.json
|
|
123
|
+
|
|
124
|
+
# Secrets
|
|
125
|
+
.lokalise_token
|
|
126
|
+
|
|
127
|
+
# monkeytype
|
|
128
|
+
monkeytype.sqlite3
|
|
129
|
+
|
|
130
|
+
# This is left behind by Azure Restore Cache
|
|
131
|
+
tmp_cache
|
|
132
|
+
|
|
133
|
+
# python-language-server / Rope
|
|
134
|
+
.ropeproject
|
|
135
|
+
|
|
136
|
+
.idea
|
|
137
|
+
*.iml
|
|
138
|
+
examples/test_xml.py
|
|
139
|
+
cov.xml
|
|
140
|
+
tests/sample_rako.xml
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
repos:
|
|
3
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
4
|
+
rev: v0.1.15
|
|
5
|
+
hooks:
|
|
6
|
+
- id: ruff
|
|
7
|
+
args: [--fix]
|
|
8
|
+
- id: ruff-format
|
|
9
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
10
|
+
rev: v5.0.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: trailing-whitespace
|
|
13
|
+
- id: end-of-file-fixer
|
|
14
|
+
- id: check-merge-conflict
|
|
15
|
+
- id: debug-statements
|
|
16
|
+
- id: check-docstring-first
|
|
17
|
+
- id: check-json
|
|
18
|
+
- id: check-yaml
|
|
19
|
+
- id: check-byte-order-marker
|
|
20
|
+
- id: check-case-conflict
|
|
21
|
+
- id: check-executables-have-shebangs
|
|
22
|
+
- id: check-ast
|
|
23
|
+
- id: detect-private-key
|
|
24
|
+
- id: forbid-new-submodules
|
|
25
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
26
|
+
rev: v1.16.1
|
|
27
|
+
hooks:
|
|
28
|
+
- id: mypy
|
|
29
|
+
files: ^python_rako/.+\.py$
|
|
30
|
+
exclude: ^python_rako/__version__\.py$
|
|
31
|
+
additional_dependencies: [types-requests]
|
|
32
|
+
- repo: https://github.com/adrienverge/yamllint.git
|
|
33
|
+
rev: v1.37.1
|
|
34
|
+
hooks:
|
|
35
|
+
- id: yamllint
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
rules:
|
|
3
|
+
braces:
|
|
4
|
+
level: error
|
|
5
|
+
min-spaces-inside: 0
|
|
6
|
+
max-spaces-inside: 1
|
|
7
|
+
min-spaces-inside-empty: -1
|
|
8
|
+
max-spaces-inside-empty: -1
|
|
9
|
+
brackets:
|
|
10
|
+
level: error
|
|
11
|
+
min-spaces-inside: 0
|
|
12
|
+
max-spaces-inside: 0
|
|
13
|
+
min-spaces-inside-empty: -1
|
|
14
|
+
max-spaces-inside-empty: -1
|
|
15
|
+
colons:
|
|
16
|
+
level: error
|
|
17
|
+
max-spaces-before: 0
|
|
18
|
+
max-spaces-after: 1
|
|
19
|
+
commas:
|
|
20
|
+
level: error
|
|
21
|
+
max-spaces-before: 0
|
|
22
|
+
min-spaces-after: 1
|
|
23
|
+
max-spaces-after: 1
|
|
24
|
+
comments:
|
|
25
|
+
level: error
|
|
26
|
+
require-starting-space: true
|
|
27
|
+
min-spaces-from-content: 2
|
|
28
|
+
comments-indentation:
|
|
29
|
+
level: error
|
|
30
|
+
document-end:
|
|
31
|
+
level: error
|
|
32
|
+
present: false
|
|
33
|
+
document-start:
|
|
34
|
+
level: error
|
|
35
|
+
present: true
|
|
36
|
+
empty-lines:
|
|
37
|
+
level: error
|
|
38
|
+
max: 1
|
|
39
|
+
max-start: 0
|
|
40
|
+
max-end: 1
|
|
41
|
+
hyphens:
|
|
42
|
+
level: error
|
|
43
|
+
max-spaces-after: 1
|
|
44
|
+
indentation:
|
|
45
|
+
level: error
|
|
46
|
+
spaces: 2
|
|
47
|
+
indent-sequences: true
|
|
48
|
+
check-multi-line-strings: false
|
|
49
|
+
key-duplicates:
|
|
50
|
+
level: error
|
|
51
|
+
line-length:
|
|
52
|
+
level: warning
|
|
53
|
+
max: 120
|
|
54
|
+
allow-non-breakable-words: true
|
|
55
|
+
allow-non-breakable-inline-mappings: true
|
|
56
|
+
new-line-at-end-of-file:
|
|
57
|
+
level: error
|
|
58
|
+
new-lines:
|
|
59
|
+
level: error
|
|
60
|
+
type: unix
|
|
61
|
+
trailing-spaces:
|
|
62
|
+
level: error
|
|
63
|
+
truthy: disable
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
.DEFAULT_GOAL := help
|
|
2
|
+
export VENV := $(abspath venv)
|
|
3
|
+
export PATH := ${VENV}/bin:${PATH}
|
|
4
|
+
|
|
5
|
+
define BROWSER_PYSCRIPT
|
|
6
|
+
import os, webbrowser, sys
|
|
7
|
+
|
|
8
|
+
try:
|
|
9
|
+
from urllib import pathname2url
|
|
10
|
+
except:
|
|
11
|
+
from urllib.request import pathname2url
|
|
12
|
+
|
|
13
|
+
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
|
|
14
|
+
endef
|
|
15
|
+
export BROWSER_PYSCRIPT
|
|
16
|
+
|
|
17
|
+
BROWSER := python -c "$$BROWSER_PYSCRIPT"
|
|
18
|
+
|
|
19
|
+
.PHONY: help
|
|
20
|
+
help: ## Shows this message.
|
|
21
|
+
@echo "Asynchronous Python client for Rako Controls."; \
|
|
22
|
+
echo; \
|
|
23
|
+
echo "Usage:"; \
|
|
24
|
+
awk -F ':|##' '/^[^\t].+?:.*?##/ {\
|
|
25
|
+
printf "\033[36m make %-30s\033[0m %s\n", $$1, $$NF \
|
|
26
|
+
}' $(MAKEFILE_LIST)
|
|
27
|
+
|
|
28
|
+
.PHONY: dev
|
|
29
|
+
dev: install-dev install ## Set up a development environment.
|
|
30
|
+
|
|
31
|
+
.PHONY: lint
|
|
32
|
+
lint: ## Run Ruff linting and formatting checks.
|
|
33
|
+
python -m ruff check
|
|
34
|
+
python -m ruff format --check
|
|
35
|
+
|
|
36
|
+
.PHONY: format
|
|
37
|
+
format: ## Format code with Ruff.
|
|
38
|
+
python -m ruff format
|
|
39
|
+
python -m ruff check --fix
|
|
40
|
+
|
|
41
|
+
.PHONY: typecheck
|
|
42
|
+
typecheck: ## Run type checking with MyPy.
|
|
43
|
+
python -m mypy python_rako/
|
|
44
|
+
|
|
45
|
+
.PHONY: check
|
|
46
|
+
check: lint typecheck ## Run all checks (linting, formatting, and type checking).
|
|
47
|
+
|
|
48
|
+
.PHONY: test
|
|
49
|
+
test: ## Run tests quickly with the default Python.
|
|
50
|
+
pytest --cov-report html --cov-report term --cov-report xml:cov.xml --cov=python_rako .;
|
|
51
|
+
|
|
52
|
+
.PHONY: coverage
|
|
53
|
+
coverage: test ## Check code coverage quickly with the default Python.
|
|
54
|
+
$(BROWSER) htmlcov/index.html
|
|
55
|
+
|
|
56
|
+
.PHONY: install
|
|
57
|
+
install: clean ## Install the package to the active Python's site-packages.
|
|
58
|
+
pip install -Ur requirements.txt; \
|
|
59
|
+
pip install -e .;
|
|
60
|
+
|
|
61
|
+
.PHONY: clean clean-all
|
|
62
|
+
clean: clean-build clean-pyc clean-test ## Removes build, test, coverage and Python artifacts.
|
|
63
|
+
clean-all: clean-build clean-pyc clean-test clean-venv ## Removes all venv, build, test, coverage and Python artifacts.
|
|
64
|
+
|
|
65
|
+
.PHONY: clean-build
|
|
66
|
+
clean-build: ## Removes build artifacts.
|
|
67
|
+
rm -fr build/; \
|
|
68
|
+
rm -fr dist/; \
|
|
69
|
+
rm -fr .eggs/; \
|
|
70
|
+
find . -name '*.egg-info' -exec rm -fr {} +; \
|
|
71
|
+
find . -name '*.egg' -exec rm -fr {} +;
|
|
72
|
+
|
|
73
|
+
.PHONY: clean-pyc
|
|
74
|
+
clean-pyc: ## Removes Python file artifacts.
|
|
75
|
+
find . -name '*.pyc' -delete; \
|
|
76
|
+
find . -name '*.pyo' -delete; \
|
|
77
|
+
find . -name '*~' -delete; \
|
|
78
|
+
find . -name '__pycache__' -exec rm -fr {} +;
|
|
79
|
+
|
|
80
|
+
.PHONY: clean-test
|
|
81
|
+
clean-test: ## Removes test and coverage artifacts.
|
|
82
|
+
rm -f .coverage; \
|
|
83
|
+
rm -fr htmlcov/; \
|
|
84
|
+
rm -fr .pytest_cache;
|
|
85
|
+
|
|
86
|
+
.PHONY: clean-venv
|
|
87
|
+
clean-venv: ## Removes Python virtual environment artifacts.
|
|
88
|
+
rm -fr venv/;
|
|
89
|
+
|
|
90
|
+
.PHONY: dist
|
|
91
|
+
dist: clean ## Builds source and wheel package.
|
|
92
|
+
python -m build; \
|
|
93
|
+
ls -l dist;
|
|
94
|
+
|
|
95
|
+
.PHONY: release
|
|
96
|
+
release: ## Release build on PyP
|
|
97
|
+
twine upload dist/*
|
|
98
|
+
|
|
99
|
+
.PHONY: venv
|
|
100
|
+
venv: clean-venv ## Create Python venv environment.
|
|
101
|
+
python3 -m venv venv;
|
|
102
|
+
|
|
103
|
+
.PHONY: install-dev
|
|
104
|
+
install-dev: clean
|
|
105
|
+
pip install -Ur requirements_dev.txt; \
|
|
106
|
+
pre-commit install;
|
|
107
|
+
|
|
108
|
+
.PHONY: bump-patch
|
|
109
|
+
bump-patch: ## Bump patch version (x.y.Z) and commit
|
|
110
|
+
@python -c "import re; content = open('python_rako/__version__.py').read().strip(); match = re.search(r'(\d+)\.(\d+)\.(\d+)', content); major, minor, patch = match.groups(); new_version = f'{major}.{minor}.{int(patch) + 1}'; open('python_rako/__version__.py', 'w').write(f'__version__ = \"{new_version}\"\n'); print(f'Bumped version to {new_version}')"
|
|
111
|
+
@git add python_rako/__version__.py
|
|
112
|
+
@git commit -m "Bump version to $$(python -c "import re; content = open('python_rako/__version__.py').read(); match = re.search(r'\"([^\"]+)\"', content); print(match.group(1))")"
|
|
113
|
+
|
|
114
|
+
.PHONY: bump-minor
|
|
115
|
+
bump-minor: ## Bump minor version (x.Y.z) and commit
|
|
116
|
+
@python -c "import re; content = open('python_rako/__version__.py').read().strip(); match = re.search(r'(\d+)\.(\d+)\.(\d+)', content); major, minor, patch = match.groups(); new_version = f'{major}.{int(minor) + 1}.0'; open('python_rako/__version__.py', 'w').write(f'__version__ = \"{new_version}\"\n'); print(f'Bumped version to {new_version}')"
|
|
117
|
+
@git add python_rako/__version__.py
|
|
118
|
+
@git commit -m "Bump version to $$(python -c "import re; content = open('python_rako/__version__.py').read(); match = re.search(r'\"([^\"]+)\"', content); print(match.group(1))")"
|
|
119
|
+
|
|
120
|
+
.PHONY: bump-major
|
|
121
|
+
bump-major: ## Bump major version (X.y.z) and commit
|
|
122
|
+
@python -c "import re; content = open('python_rako/__version__.py').read().strip(); match = re.search(r'(\d+)\.(\d+)\.(\d+)', content); major, minor, patch = match.groups(); new_version = f'{int(major) + 1}.0.0'; open('python_rako/__version__.py', 'w').write(f'__version__ = \"{new_version}\"\n'); print(f'Bumped version to {new_version}')"
|
|
123
|
+
@git add python_rako/__version__.py
|
|
124
|
+
@git commit -m "Bump version to $$(python -c "import re; content = open('python_rako/__version__.py').read(); match = re.search(r'\"([^\"]+)\"', content); print(match.group(1))")"
|
|
@@ -1,31 +1,41 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-rako-2025
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Asynchronous Python client for Rako Controls Lighting
|
|
5
|
-
Author-email: Simon Leigh <simonleigh@users.noreply.github.com>
|
|
6
5
|
Project-URL: Homepage, https://github.com/simonleigh/python-rako
|
|
7
6
|
Project-URL: Repository, https://github.com/simonleigh/python-rako
|
|
8
7
|
Project-URL: Issues, https://github.com/simonleigh/python-rako/issues
|
|
9
|
-
|
|
8
|
+
Author-email: Simon Leigh <simonleigh@users.noreply.github.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: api,async,automation,client,controls,lighting,rako
|
|
10
12
|
Classifier: Development Status :: 4 - Beta
|
|
11
13
|
Classifier: Framework :: AsyncIO
|
|
12
14
|
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
16
|
Classifier: Natural Language :: English
|
|
14
17
|
Classifier: Operating System :: OS Independent
|
|
15
18
|
Classifier: Programming Language :: Python
|
|
16
19
|
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
19
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
21
|
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Home Automation
|
|
21
23
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Requires-Dist: aiohttp>=3.10.0
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.12
|
|
26
|
+
Requires-Dist: aiohttp>=3.12.0
|
|
26
27
|
Requires-Dist: asyncio-dgram>=2.2.0
|
|
27
|
-
Requires-Dist: xmltodict>=0.
|
|
28
|
-
|
|
28
|
+
Requires-Dist: xmltodict>=0.14.0
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: hatch>=1.9.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: pre-commit>=3.6.0; extra == 'dev'
|
|
32
|
+
Provides-Extra: test
|
|
33
|
+
Requires-Dist: aresponses>=3.0.0; extra == 'test'
|
|
34
|
+
Requires-Dist: coverage[toml]>=7.9.0; extra == 'test'
|
|
35
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'test'
|
|
36
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == 'test'
|
|
37
|
+
Requires-Dist: pytest>=8.4.0; extra == 'test'
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
29
39
|
|
|
30
40
|
# Python: Rako Controls API Client
|
|
31
41
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
apiVersion: backstage.io/v1alpha1
|
|
3
|
+
kind: Component
|
|
4
|
+
metadata:
|
|
5
|
+
name: python-rako
|
|
6
|
+
description: Asynchronous Python client for Rako Controls Lighting
|
|
7
|
+
annotations:
|
|
8
|
+
github.com/project-slug: 'marengaz/python-rako'
|
|
9
|
+
tags:
|
|
10
|
+
- python3
|
|
11
|
+
- async
|
|
12
|
+
links:
|
|
13
|
+
- url: https://www.home-assistant.io/integrations/rako/
|
|
14
|
+
title: Home Assistant Rako Integration
|
|
15
|
+
spec:
|
|
16
|
+
type: library
|
|
17
|
+
lifecycle: production
|
|
18
|
+
owner: user:guest
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
RESOURCES = Path(__file__).parent / "tests/resources"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@pytest.fixture
|
|
9
|
+
def rako_xml() -> str:
|
|
10
|
+
with (RESOURCES / "rako.xml").open() as f:
|
|
11
|
+
xml = f.read()
|
|
12
|
+
|
|
13
|
+
return xml
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@pytest.fixture
|
|
17
|
+
def rako_xml2() -> str:
|
|
18
|
+
with (RESOURCES / "rako2.xml").open() as f:
|
|
19
|
+
xml = f.read()
|
|
20
|
+
|
|
21
|
+
return xml
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@pytest.fixture
|
|
25
|
+
def rako_xml3() -> str:
|
|
26
|
+
with (RESOURCES / "rako3.xml").open() as f:
|
|
27
|
+
xml = f.read()
|
|
28
|
+
|
|
29
|
+
return xml
|
|
Binary file
|