dbus2mqtt 0.1.1__tar.gz → 0.2.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.
Potentially problematic release.
This version of dbus2mqtt might be problematic. Click here for more details.
- dbus2mqtt-0.2.0/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- dbus2mqtt-0.2.0/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- dbus2mqtt-0.2.0/.github/release-drafter.yml +51 -0
- dbus2mqtt-0.2.0/.github/scripts/release-versions.py +66 -0
- dbus2mqtt-0.1.1/.github/workflows/main.yml → dbus2mqtt-0.2.0/.github/workflows/ci.yml +1 -1
- dbus2mqtt-0.2.0/.github/workflows/docker-dev.yml +74 -0
- dbus2mqtt-0.2.0/.github/workflows/docker-stable.yml +97 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/.github/workflows/publish.yml +0 -8
- dbus2mqtt-0.2.0/.gitignore +25 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/.pre-commit-config.yaml +1 -1
- dbus2mqtt-0.2.0/.python-version +1 -0
- dbus2mqtt-0.2.0/.vscode/launch.json +13 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/PKG-INFO +17 -21
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/README.md +15 -20
- dbus2mqtt-0.1.1/Dockerfile → dbus2mqtt-0.2.0/docker/Dockerfile.latest +6 -4
- dbus2mqtt-0.2.0/docker/Dockerfile.pypi +12 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/docs/examples/home_assistant_media_player.md +51 -25
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/docs/examples/home_assistant_media_player.yaml +22 -13
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/docs/examples/linux_desktop.yaml +5 -4
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/pyproject.toml +1 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/renovate.json +5 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/src/dbus2mqtt/config.py +9 -8
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/src/dbus2mqtt/dbus/dbus_client.py +12 -10
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/src/dbus2mqtt/dbus/dbus_util.py +1 -1
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/src/dbus2mqtt/event_broker.py +1 -2
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/src/dbus2mqtt/flow/__init__.py +22 -3
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/src/dbus2mqtt/flow/actions/context_set.py +2 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/src/dbus2mqtt/flow/actions/mqtt_publish.py +12 -6
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/src/dbus2mqtt/main.py +0 -9
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/src/dbus2mqtt/mqtt/mqtt_client.py +9 -5
- dbus2mqtt-0.2.0/src/dbus2mqtt/template/templating.py +103 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/tests/__init__.py +18 -1
- dbus2mqtt-0.2.0/tests/dbus/test_dbus_client.py +49 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/tests/flow/actions/test_context_set.py +1 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/tests/flow/triggers/test_dbus_client_triggers.py +6 -25
- dbus2mqtt-0.2.0/tests/template/test_templating.py +141 -0
- dbus2mqtt-0.2.0/tests/template/test_templating_config.py +87 -0
- dbus2mqtt-0.1.1/.github/release-drafter.yml +0 -35
- dbus2mqtt-0.1.1/.gitignore +0 -6
- dbus2mqtt-0.1.1/.python-version +0 -1
- dbus2mqtt-0.1.1/config-test.yaml +0 -141
- dbus2mqtt-0.1.1/src/dbus2mqtt/template/templating.py +0 -129
- dbus2mqtt-0.1.1/tests/template/test_templating.py +0 -55
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/.dockerignore +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/.env.example +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/.github/workflows/pre-commit.yml +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/.github/workflows/release-drafter.yml +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/.vscode/settings.json +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/.yamllint.yml +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/LICENSE +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/docs/debugging.md +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/docs/examples/linux_desktop.md +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/docs/examples.md +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/src/dbus2mqtt/__init__.py +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/src/dbus2mqtt/__main__.py +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/src/dbus2mqtt/dbus/dbus_types.py +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/src/dbus2mqtt/flow/flow_processor.py +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/src/dbus2mqtt/template/dbus_template_functions.py +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/tests/config/test_examples.py +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/tests/flow/actions/test_mqtt_publish.py +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/tests/flow/test_flow_processor.py +0 -0
- {dbus2mqtt-0.1.1 → dbus2mqtt-0.2.0}/uv.lock +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the behavior:
|
|
15
|
+
1. Go to '...'
|
|
16
|
+
2. Click on '....'
|
|
17
|
+
3. Scroll down to '....'
|
|
18
|
+
4. See error
|
|
19
|
+
|
|
20
|
+
**Expected behavior**
|
|
21
|
+
A clear and concise description of what you expected to happen.
|
|
22
|
+
|
|
23
|
+
**Screenshots**
|
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
|
25
|
+
|
|
26
|
+
**Desktop (please complete the following information):**
|
|
27
|
+
- OS: [e.g. iOS]
|
|
28
|
+
- Browser [e.g. chrome, safari]
|
|
29
|
+
- Version [e.g. 22]
|
|
30
|
+
|
|
31
|
+
**Smartphone (please complete the following information):**
|
|
32
|
+
- Device: [e.g. iPhone6]
|
|
33
|
+
- OS: [e.g. iOS8.1]
|
|
34
|
+
- Browser [e.g. stock browser, safari]
|
|
35
|
+
- Version [e.g. 22]
|
|
36
|
+
|
|
37
|
+
**Additional context**
|
|
38
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name-template: 'v$RESOLVED_VERSION 🌈'
|
|
2
|
+
tag-template: 'v$RESOLVED_VERSION'
|
|
3
|
+
exclude-labels:
|
|
4
|
+
- dependencies
|
|
5
|
+
categories:
|
|
6
|
+
- title: 💥 Breaking changes
|
|
7
|
+
labels:
|
|
8
|
+
- breaking-change
|
|
9
|
+
- title: 🚀 Features
|
|
10
|
+
labels:
|
|
11
|
+
- feature
|
|
12
|
+
- enhancement
|
|
13
|
+
- title: 🐛 Bug Fixes
|
|
14
|
+
labels:
|
|
15
|
+
- fix
|
|
16
|
+
- bugfix
|
|
17
|
+
- bug
|
|
18
|
+
- title: 🧰 Maintenance
|
|
19
|
+
labels:
|
|
20
|
+
- chore
|
|
21
|
+
- documentation
|
|
22
|
+
exclude-contributors:
|
|
23
|
+
- jwnmulder
|
|
24
|
+
autolabeler:
|
|
25
|
+
- label: enhancement
|
|
26
|
+
branch:
|
|
27
|
+
- '/feature\/.+/'
|
|
28
|
+
- label: fix
|
|
29
|
+
branch:
|
|
30
|
+
- '/fix\/.+/'
|
|
31
|
+
title:
|
|
32
|
+
- '/fix/i'
|
|
33
|
+
version-resolver:
|
|
34
|
+
major:
|
|
35
|
+
labels:
|
|
36
|
+
- major
|
|
37
|
+
minor:
|
|
38
|
+
labels:
|
|
39
|
+
- minor
|
|
40
|
+
- feature
|
|
41
|
+
- enhancement
|
|
42
|
+
- breaking-change # minor until we are on 1.x
|
|
43
|
+
patch:
|
|
44
|
+
labels:
|
|
45
|
+
- patch
|
|
46
|
+
default: patch
|
|
47
|
+
change-template: '* $TITLE (#$NUMBER)'
|
|
48
|
+
template: |
|
|
49
|
+
## Changes
|
|
50
|
+
|
|
51
|
+
$CHANGES
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import json
|
|
3
|
+
import subprocess
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
from packaging import version
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def get_versions_from_git_tags() -> list[version.Version]:
|
|
10
|
+
result = subprocess.run(
|
|
11
|
+
["git", "tag"],
|
|
12
|
+
capture_output=True, text=True, check=True
|
|
13
|
+
)
|
|
14
|
+
tags = result.stdout.strip().splitlines()
|
|
15
|
+
versions = [t.lstrip("v") for t in tags if t.startswith("v")]
|
|
16
|
+
|
|
17
|
+
parsed_versions = []
|
|
18
|
+
for v in versions:
|
|
19
|
+
try:
|
|
20
|
+
parsed = version.parse(v)
|
|
21
|
+
parsed_versions.append(parsed)
|
|
22
|
+
except Exception as e:
|
|
23
|
+
print(f"Error parsing version {v}: {e}")
|
|
24
|
+
|
|
25
|
+
return parsed_versions
|
|
26
|
+
|
|
27
|
+
def latest_version_by_cycle(versions: list[version.Version], cycles: list[str]) -> dict[str, version.Version]:
|
|
28
|
+
res = {}
|
|
29
|
+
for cycle in cycles:
|
|
30
|
+
parsed_cycle = version.parse(cycle)
|
|
31
|
+
|
|
32
|
+
for v in versions:
|
|
33
|
+
# check if version is in cycle range
|
|
34
|
+
# cycle can be major or major.minor or major.minor.patch
|
|
35
|
+
if len(v.release) > len(parsed_cycle.release):
|
|
36
|
+
# update if version is later within cycle
|
|
37
|
+
if cycle not in cycles or v > parsed_cycle:
|
|
38
|
+
res[cycle] = v
|
|
39
|
+
return res
|
|
40
|
+
|
|
41
|
+
def main():
|
|
42
|
+
args = sys.argv[1:]
|
|
43
|
+
if not args:
|
|
44
|
+
print("Usage: release-versions.py 0.1 0.2 1.0 ...")
|
|
45
|
+
sys.exit(1)
|
|
46
|
+
|
|
47
|
+
versions = get_versions_from_git_tags()
|
|
48
|
+
cycles = latest_version_by_cycle(versions, args)
|
|
49
|
+
|
|
50
|
+
# Detect the overall latest version
|
|
51
|
+
overall_latest = max(versions) if versions else None
|
|
52
|
+
|
|
53
|
+
cycle_details = []
|
|
54
|
+
for cycle in args:
|
|
55
|
+
latest = cycles.get(cycle)
|
|
56
|
+
if latest:
|
|
57
|
+
cycle_details.append({
|
|
58
|
+
"cycle": cycle,
|
|
59
|
+
"latestVersion": latest.base_version,
|
|
60
|
+
"isLatestStable": latest == overall_latest
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
print(json.dumps(cycle_details))
|
|
64
|
+
|
|
65
|
+
if __name__ == "__main__":
|
|
66
|
+
main()
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
name: docker-dev
|
|
2
|
+
|
|
3
|
+
"on":
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
docker:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
packages: write
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Install uv
|
|
19
|
+
uses: astral-sh/setup-uv@v5
|
|
20
|
+
with:
|
|
21
|
+
enable-cache: true
|
|
22
|
+
|
|
23
|
+
- name: "Set up Python"
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version-file: ".python-version"
|
|
27
|
+
|
|
28
|
+
- name: Determine version from hatch
|
|
29
|
+
id: version
|
|
30
|
+
run: echo "PRETEND_VERSION=$(uvx hatch version)" >> "$GITHUB_OUTPUT"
|
|
31
|
+
|
|
32
|
+
- name: Docker meta
|
|
33
|
+
id: meta
|
|
34
|
+
uses: docker/metadata-action@v5
|
|
35
|
+
with:
|
|
36
|
+
images: |
|
|
37
|
+
jwnmulder/dbus2mqtt
|
|
38
|
+
ghcr.io/jwnmulder/dbus2mqtt
|
|
39
|
+
tags: |
|
|
40
|
+
type=raw,value=dev,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
|
41
|
+
labels: |
|
|
42
|
+
org.opencontainers.image.source=https://github.com/jwnmulder/dbus2mqtt
|
|
43
|
+
|
|
44
|
+
- name: Set up QEMU
|
|
45
|
+
uses: docker/setup-qemu-action@v3
|
|
46
|
+
|
|
47
|
+
- name: Set up Docker Buildx
|
|
48
|
+
uses: docker/setup-buildx-action@v3
|
|
49
|
+
|
|
50
|
+
- name: Login to DockerHub
|
|
51
|
+
if: github.event_name != 'pull_request'
|
|
52
|
+
uses: docker/login-action@v3
|
|
53
|
+
with:
|
|
54
|
+
username: jwnmulder
|
|
55
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
56
|
+
|
|
57
|
+
- name: Login to GHCR
|
|
58
|
+
if: github.event_name != 'pull_request'
|
|
59
|
+
uses: docker/login-action@v3
|
|
60
|
+
with:
|
|
61
|
+
registry: ghcr.io
|
|
62
|
+
username: jwnmulder
|
|
63
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
64
|
+
|
|
65
|
+
- name: Build and push
|
|
66
|
+
uses: docker/build-push-action@v6
|
|
67
|
+
with:
|
|
68
|
+
context: .
|
|
69
|
+
file: ./docker/Dockerfile.latest
|
|
70
|
+
push: ${{ github.event_name != 'pull_request' }}
|
|
71
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
72
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
73
|
+
build-args: |
|
|
74
|
+
PRETEND_VERSION=${{ steps.version.outputs.PRETEND_VERSION }}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
name: docker-stable releases
|
|
2
|
+
|
|
3
|
+
"on":
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths:
|
|
8
|
+
- "docker/**"
|
|
9
|
+
release:
|
|
10
|
+
types: [published]
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
setup:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
outputs:
|
|
17
|
+
versions_matrix: ${{ steps.supported_release_versions.outputs.versions_matrix }}
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
|
|
24
|
+
- name: Determine supported release versions
|
|
25
|
+
id: supported_release_versions
|
|
26
|
+
run: |
|
|
27
|
+
SUPPORTED_CYCLES=("0.1" "0.2" "0.3" "0.4" "0.5" "0.6" "0.7" "0.8" "0.9" "1.0" "2.0")
|
|
28
|
+
|
|
29
|
+
VERSIONS_JSON=$(python3 .github/scripts/release-versions.py "${SUPPORTED_CYCLES[@]}")
|
|
30
|
+
|
|
31
|
+
# Wrap the output into matrix include
|
|
32
|
+
VERSIONS_MATRIX=$(echo "$VERSIONS_JSON" | jq -c '{include: [.[] | {cycle: .cycle, version: .latestVersion, isLatestStable: .isLatestStable}]}')
|
|
33
|
+
|
|
34
|
+
echo "VERSIONS_MATRIX=$VERSIONS_MATRIX"
|
|
35
|
+
echo "versions_matrix=$VERSIONS_MATRIX" >> $GITHUB_OUTPUT
|
|
36
|
+
docker:
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
needs: setup
|
|
39
|
+
permissions:
|
|
40
|
+
packages: write
|
|
41
|
+
strategy:
|
|
42
|
+
fail-fast: false
|
|
43
|
+
matrix: ${{ fromJson(needs.setup.outputs.versions_matrix) }}
|
|
44
|
+
|
|
45
|
+
steps:
|
|
46
|
+
- name: Checkout
|
|
47
|
+
uses: actions/checkout@v4
|
|
48
|
+
|
|
49
|
+
- name: Docker meta
|
|
50
|
+
id: meta
|
|
51
|
+
uses: docker/metadata-action@v5
|
|
52
|
+
with:
|
|
53
|
+
images: |
|
|
54
|
+
jwnmulder/dbus2mqtt
|
|
55
|
+
ghcr.io/jwnmulder/dbus2mqtt
|
|
56
|
+
tags: |
|
|
57
|
+
type=raw,value=latest,enable=${{ matrix.isLatestStable }}
|
|
58
|
+
type=pep440,pattern={{major}},value=${{ matrix.version }},enable=${{ !startsWith(matrix.version, '0.') }}
|
|
59
|
+
type=pep440,pattern={{major}}.{{minor}},value=${{ matrix.version }}
|
|
60
|
+
type=pep440,pattern={{major}}.{{minor}}.{{patch}},value=${{ matrix.version }}
|
|
61
|
+
# type=ref,event=branch
|
|
62
|
+
# type=ref,event=pr
|
|
63
|
+
# type=semver,pattern={{version}},value=${{ matrix.version }}
|
|
64
|
+
labels: |
|
|
65
|
+
org.opencontainers.image.source=https://github.com/jwnmulder/dbus2mqtt
|
|
66
|
+
|
|
67
|
+
- name: Set up QEMU
|
|
68
|
+
uses: docker/setup-qemu-action@v3
|
|
69
|
+
|
|
70
|
+
- name: Set up Docker Buildx
|
|
71
|
+
uses: docker/setup-buildx-action@v3
|
|
72
|
+
|
|
73
|
+
- name: Login to DockerHub
|
|
74
|
+
if: github.event_name != 'pull_request'
|
|
75
|
+
uses: docker/login-action@v3
|
|
76
|
+
with:
|
|
77
|
+
username: jwnmulder
|
|
78
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
79
|
+
|
|
80
|
+
- name: Login to GHCR
|
|
81
|
+
if: github.event_name != 'pull_request'
|
|
82
|
+
uses: docker/login-action@v3
|
|
83
|
+
with:
|
|
84
|
+
registry: ghcr.io
|
|
85
|
+
username: jwnmulder
|
|
86
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
87
|
+
|
|
88
|
+
- name: Build and push
|
|
89
|
+
uses: docker/build-push-action@v6
|
|
90
|
+
with:
|
|
91
|
+
context: .
|
|
92
|
+
file: ./docker/Dockerfile.pypi
|
|
93
|
+
push: ${{ github.event_name != 'pull_request' }}
|
|
94
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
95
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
96
|
+
build-args: |
|
|
97
|
+
DBUS2MQTT_VERSION=${{ matrix.version }}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
# This workflow will upload a Python Package to PyPI when a release is created
|
|
2
|
-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
|
|
3
|
-
|
|
4
|
-
# This workflow uses actions that are not certified by GitHub.
|
|
5
|
-
# They are provided by a third-party and are governed by
|
|
6
|
-
# separate terms of service, privacy policy, and support
|
|
7
|
-
# documentation.
|
|
8
|
-
|
|
9
1
|
name: Upload Python Package
|
|
10
2
|
|
|
11
3
|
"on":
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# https://github.com/github/gitignore/blob/main/Python.gitignore
|
|
2
|
+
# https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
|
|
3
|
+
|
|
4
|
+
# Byte-compiled / optimized / DLL files
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
*$py.class
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
dist/
|
|
11
|
+
|
|
12
|
+
# Environments
|
|
13
|
+
.env
|
|
14
|
+
.venv
|
|
15
|
+
|
|
16
|
+
# Ruff stuff:
|
|
17
|
+
.ruff_cache/
|
|
18
|
+
|
|
19
|
+
### VisualStudioCode ###
|
|
20
|
+
.vscode/*
|
|
21
|
+
!.vscode/settings.json
|
|
22
|
+
!.vscode/tasks.json
|
|
23
|
+
!.vscode/launch.json
|
|
24
|
+
!.vscode/extensions.json
|
|
25
|
+
*.code-workspace
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.10
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
"name": "dbus2mqtt - home_assistant_media_player",
|
|
6
|
+
"type": "debugpy",
|
|
7
|
+
"request": "launch",
|
|
8
|
+
"module": "dbus2mqtt",
|
|
9
|
+
"console": "integratedTerminal",
|
|
10
|
+
"args": "--config docs/examples/home_assistant_media_player.yaml"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dbus2mqtt
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: A Python tool to expose Linux D-Bus signals, methods and properties over MQTT - featuring templating, payload enrichment and Home Assistant-ready examples
|
|
5
5
|
Project-URL: Repository, https://github.com/jwnmulder/dbus2mqtt.git
|
|
6
6
|
Project-URL: Issues, https://github.com/jwnmulder/dbus2mqtt/issues
|
|
@@ -9,6 +9,7 @@ License-File: LICENSE
|
|
|
9
9
|
Keywords: dbus,home-assistant,mpris,mqtt,python
|
|
10
10
|
Classifier: Development Status :: 4 - Beta
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
13
|
Classifier: Operating System :: POSIX :: Linux
|
|
13
14
|
Classifier: Programming Language :: Python :: 3
|
|
14
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -31,8 +32,6 @@ Description-Content-Type: text/markdown
|
|
|
31
32
|
|
|
32
33
|
# dbus2mqtt
|
|
33
34
|
|
|
34
|
-
> **⚠️ Warning:** This project has no releases yet. Running from source works. Docker images and Python packages are planned but not yet available.
|
|
35
|
-
|
|
36
35
|
**dbus2mqtt** is a Python application that bridges **Linux D-Bus** with **MQTT**.
|
|
37
36
|
It lets you forward D-Bus signals and properties to MQTT topics, call D-Bus methods via MQTT messages, and shape payloads using flexible **Jinja2 templating**.
|
|
38
37
|
|
|
@@ -46,12 +45,11 @@ This makes it easy to integrate Linux desktop services or system signals into MQ
|
|
|
46
45
|
* 📡 Expose **D-Bus methods** for remote control via MQTT messages.
|
|
47
46
|
* 🏠 Includes example configurations for **MPRIS** and **Home Assistant Media Player** integration.
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
## Project status
|
|
49
|
+
|
|
50
|
+
**dbus2mqtt** is considered stable for the use-cases it has been tested against, and is actively being developed. Documentation is continuously being improved.
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
* Release a docker image
|
|
53
|
-
* Improve error handling when deleting message with 'retain' set. WARNING:dbus2mqtt.mqtt_client:on_message: Unexpected payload, expecting json, topic=dbus2mqtt/org.mpris.MediaPlayer2/command, payload=, error=Expecting value: line 1 column 1 (char 0)
|
|
54
|
-
* Property set only works the first time, need to restart after which the first set will work again
|
|
52
|
+
Initial testing has focused on MPRIS integration. A table of tested MPRIS players and their supported methods can be found here: [home_assistant_media_player.md](https://github.com/jwnmulder/dbus2mqtt/blob/main/docs/examples/home_assistant_media_player.md)
|
|
55
53
|
|
|
56
54
|
## Getting started with dbus2mqtt
|
|
57
55
|
|
|
@@ -82,7 +80,7 @@ dbus:
|
|
|
82
80
|
topic: dbus2mqtt/org.mpris.MediaPlayer2/state
|
|
83
81
|
payload_type: json
|
|
84
82
|
payload_template: |
|
|
85
|
-
{{ dbus_call(mpris_bus_name, path, 'org.freedesktop.DBus.Properties', 'GetAll', ['org.mpris.MediaPlayer2.Player'])
|
|
83
|
+
{{ dbus_call(mpris_bus_name, path, 'org.freedesktop.DBus.Properties', 'GetAll', ['org.mpris.MediaPlayer2.Player']) }}
|
|
86
84
|
```
|
|
87
85
|
|
|
88
86
|
MQTT connection details can be configured in that same `config.yaml` file or via environment variables. For now create a `.env` file with the following contents.
|
|
@@ -94,17 +92,17 @@ MQTT__USERNAME=
|
|
|
94
92
|
MQTT__PASSWORD=
|
|
95
93
|
```
|
|
96
94
|
|
|
97
|
-
###
|
|
98
|
-
|
|
99
|
-
To run dbus2mqtt from source (requires uv to be installed)
|
|
95
|
+
### Install and run dbus2mqtt
|
|
100
96
|
|
|
101
97
|
```bash
|
|
102
|
-
|
|
98
|
+
python -m pip install dbus2mqtt
|
|
99
|
+
dbus2mqtt --config config.yaml
|
|
103
100
|
```
|
|
104
101
|
|
|
102
|
+
|
|
105
103
|
### Run using docker with auto start behavior
|
|
106
104
|
|
|
107
|
-
To build and run dbus2mqtt using Docker with the [home_assistant_media_player.yaml](docs/examples/home_assistant_media_player.yaml) example from this repository
|
|
105
|
+
To build and run dbus2mqtt using Docker with the [home_assistant_media_player.yaml](https://github.com/jwnmulder/dbus2mqtt/blob/main/docs/examples/home_assistant_media_player.yaml) example from this repository.
|
|
108
106
|
|
|
109
107
|
```bash
|
|
110
108
|
# setup configuration
|
|
@@ -112,10 +110,8 @@ mkdir -p $HOME/.config/dbus2mqtt
|
|
|
112
110
|
cp docs/examples/home_assistant_media_player.yaml $HOME/.config/dbus2mqtt/config.yaml
|
|
113
111
|
cp .env.example $HOME/.config/dbus2mqtt/.env
|
|
114
112
|
|
|
115
|
-
# build image
|
|
116
|
-
docker build -t jwnmulder/dbus2mqtt:latest .
|
|
117
|
-
|
|
118
113
|
# run image and automatically start on reboot
|
|
114
|
+
sudo docker pull jwnmulder/dbus2mqtt
|
|
119
115
|
docker run --detach --name dbus2mqtt \
|
|
120
116
|
--volume "$HOME"/.config/dbus2mqtt:"$HOME"/.config/dbus2mqtt \
|
|
121
117
|
--volume /run/user:/run/user \
|
|
@@ -133,7 +129,7 @@ sudo docker logs dbus2mqtt -f
|
|
|
133
129
|
|
|
134
130
|
## Examples
|
|
135
131
|
|
|
136
|
-
This repository contains
|
|
132
|
+
This repository contains examples under [docs/examples](https://github.com/jwnmulder/dbus2mqtt/blob/main//docs/examples.md). The most complete one being [MPRIS to Home Assistant Media Player integration](https://github.com/jwnmulder/dbus2mqtt/blob/main/docs/examples/home_assistant_media_player.md)
|
|
137
133
|
|
|
138
134
|
## Configuration reference
|
|
139
135
|
|
|
@@ -169,7 +165,7 @@ dbus:
|
|
|
169
165
|
path: /org/mpris/MediaPlayer2
|
|
170
166
|
interfaces:
|
|
171
167
|
- interface: org.mpris.MediaPlayer2.Player
|
|
172
|
-
|
|
168
|
+
mqtt_command_topic: dbus2mqtt/org.mpris.MediaPlayer2/command
|
|
173
169
|
methods:
|
|
174
170
|
- method: Pause
|
|
175
171
|
- method: Play
|
|
@@ -216,8 +212,8 @@ dbus:
|
|
|
216
212
|
|
|
217
213
|
## Flows
|
|
218
214
|
|
|
219
|
-
TODO: Document flows, for now see the [MPRIS to Home Assistant Media Player integration](docs/examples/home_assistant_media_player.md) example
|
|
215
|
+
TODO: Document flows, for now see the [MPRIS to Home Assistant Media Player integration](https://github.com/jwnmulder/dbus2mqtt/blob/main/docs/examples/home_assistant_media_player.md) example
|
|
220
216
|
|
|
221
217
|
## Jinja templating
|
|
222
218
|
|
|
223
|
-
TODO: Document Jinja templating, for now see the [MPRIS to Home Assistant Media Player integration](docs/examples/home_assistant_media_player.md) example
|
|
219
|
+
TODO: Document Jinja templating, for now see the [MPRIS to Home Assistant Media Player integration](https://github.com/jwnmulder/dbus2mqtt/blob/main/docs/examples/home_assistant_media_player.md) example
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# dbus2mqtt
|
|
2
2
|
|
|
3
|
-
> **⚠️ Warning:** This project has no releases yet. Running from source works. Docker images and Python packages are planned but not yet available.
|
|
4
|
-
|
|
5
3
|
**dbus2mqtt** is a Python application that bridges **Linux D-Bus** with **MQTT**.
|
|
6
4
|
It lets you forward D-Bus signals and properties to MQTT topics, call D-Bus methods via MQTT messages, and shape payloads using flexible **Jinja2 templating**.
|
|
7
5
|
|
|
@@ -15,12 +13,11 @@ This makes it easy to integrate Linux desktop services or system signals into MQ
|
|
|
15
13
|
* 📡 Expose **D-Bus methods** for remote control via MQTT messages.
|
|
16
14
|
* 🏠 Includes example configurations for **MPRIS** and **Home Assistant Media Player** integration.
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
## Project status
|
|
17
|
+
|
|
18
|
+
**dbus2mqtt** is considered stable for the use-cases it has been tested against, and is actively being developed. Documentation is continuously being improved.
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
* Release a docker image
|
|
22
|
-
* Improve error handling when deleting message with 'retain' set. WARNING:dbus2mqtt.mqtt_client:on_message: Unexpected payload, expecting json, topic=dbus2mqtt/org.mpris.MediaPlayer2/command, payload=, error=Expecting value: line 1 column 1 (char 0)
|
|
23
|
-
* Property set only works the first time, need to restart after which the first set will work again
|
|
20
|
+
Initial testing has focused on MPRIS integration. A table of tested MPRIS players and their supported methods can be found here: [home_assistant_media_player.md](https://github.com/jwnmulder/dbus2mqtt/blob/main/docs/examples/home_assistant_media_player.md)
|
|
24
21
|
|
|
25
22
|
## Getting started with dbus2mqtt
|
|
26
23
|
|
|
@@ -51,7 +48,7 @@ dbus:
|
|
|
51
48
|
topic: dbus2mqtt/org.mpris.MediaPlayer2/state
|
|
52
49
|
payload_type: json
|
|
53
50
|
payload_template: |
|
|
54
|
-
{{ dbus_call(mpris_bus_name, path, 'org.freedesktop.DBus.Properties', 'GetAll', ['org.mpris.MediaPlayer2.Player'])
|
|
51
|
+
{{ dbus_call(mpris_bus_name, path, 'org.freedesktop.DBus.Properties', 'GetAll', ['org.mpris.MediaPlayer2.Player']) }}
|
|
55
52
|
```
|
|
56
53
|
|
|
57
54
|
MQTT connection details can be configured in that same `config.yaml` file or via environment variables. For now create a `.env` file with the following contents.
|
|
@@ -63,17 +60,17 @@ MQTT__USERNAME=
|
|
|
63
60
|
MQTT__PASSWORD=
|
|
64
61
|
```
|
|
65
62
|
|
|
66
|
-
###
|
|
67
|
-
|
|
68
|
-
To run dbus2mqtt from source (requires uv to be installed)
|
|
63
|
+
### Install and run dbus2mqtt
|
|
69
64
|
|
|
70
65
|
```bash
|
|
71
|
-
|
|
66
|
+
python -m pip install dbus2mqtt
|
|
67
|
+
dbus2mqtt --config config.yaml
|
|
72
68
|
```
|
|
73
69
|
|
|
70
|
+
|
|
74
71
|
### Run using docker with auto start behavior
|
|
75
72
|
|
|
76
|
-
To build and run dbus2mqtt using Docker with the [home_assistant_media_player.yaml](docs/examples/home_assistant_media_player.yaml) example from this repository
|
|
73
|
+
To build and run dbus2mqtt using Docker with the [home_assistant_media_player.yaml](https://github.com/jwnmulder/dbus2mqtt/blob/main/docs/examples/home_assistant_media_player.yaml) example from this repository.
|
|
77
74
|
|
|
78
75
|
```bash
|
|
79
76
|
# setup configuration
|
|
@@ -81,10 +78,8 @@ mkdir -p $HOME/.config/dbus2mqtt
|
|
|
81
78
|
cp docs/examples/home_assistant_media_player.yaml $HOME/.config/dbus2mqtt/config.yaml
|
|
82
79
|
cp .env.example $HOME/.config/dbus2mqtt/.env
|
|
83
80
|
|
|
84
|
-
# build image
|
|
85
|
-
docker build -t jwnmulder/dbus2mqtt:latest .
|
|
86
|
-
|
|
87
81
|
# run image and automatically start on reboot
|
|
82
|
+
sudo docker pull jwnmulder/dbus2mqtt
|
|
88
83
|
docker run --detach --name dbus2mqtt \
|
|
89
84
|
--volume "$HOME"/.config/dbus2mqtt:"$HOME"/.config/dbus2mqtt \
|
|
90
85
|
--volume /run/user:/run/user \
|
|
@@ -102,7 +97,7 @@ sudo docker logs dbus2mqtt -f
|
|
|
102
97
|
|
|
103
98
|
## Examples
|
|
104
99
|
|
|
105
|
-
This repository contains
|
|
100
|
+
This repository contains examples under [docs/examples](https://github.com/jwnmulder/dbus2mqtt/blob/main//docs/examples.md). The most complete one being [MPRIS to Home Assistant Media Player integration](https://github.com/jwnmulder/dbus2mqtt/blob/main/docs/examples/home_assistant_media_player.md)
|
|
106
101
|
|
|
107
102
|
## Configuration reference
|
|
108
103
|
|
|
@@ -138,7 +133,7 @@ dbus:
|
|
|
138
133
|
path: /org/mpris/MediaPlayer2
|
|
139
134
|
interfaces:
|
|
140
135
|
- interface: org.mpris.MediaPlayer2.Player
|
|
141
|
-
|
|
136
|
+
mqtt_command_topic: dbus2mqtt/org.mpris.MediaPlayer2/command
|
|
142
137
|
methods:
|
|
143
138
|
- method: Pause
|
|
144
139
|
- method: Play
|
|
@@ -185,8 +180,8 @@ dbus:
|
|
|
185
180
|
|
|
186
181
|
## Flows
|
|
187
182
|
|
|
188
|
-
TODO: Document flows, for now see the [MPRIS to Home Assistant Media Player integration](docs/examples/home_assistant_media_player.md) example
|
|
183
|
+
TODO: Document flows, for now see the [MPRIS to Home Assistant Media Player integration](https://github.com/jwnmulder/dbus2mqtt/blob/main/docs/examples/home_assistant_media_player.md) example
|
|
189
184
|
|
|
190
185
|
## Jinja templating
|
|
191
186
|
|
|
192
|
-
TODO: Document Jinja templating, for now see the [MPRIS to Home Assistant Media Player integration](docs/examples/home_assistant_media_player.md) example
|
|
187
|
+
TODO: Document Jinja templating, for now see the [MPRIS to Home Assistant Media Player integration](https://github.com/jwnmulder/dbus2mqtt/blob/main/docs/examples/home_assistant_media_player.md) example
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# First, build the application in the `/app` directory.
|
|
4
4
|
# See `Dockerfile` for details.
|
|
5
|
-
FROM ghcr.io/astral-sh/uv:python3.
|
|
5
|
+
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS builder
|
|
6
6
|
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
|
|
7
7
|
|
|
8
|
+
ARG PRETEND_VERSION
|
|
9
|
+
ENV SETUPTOOLS_SCM_PRETEND_VERSION=${PRETEND_VERSION}
|
|
10
|
+
|
|
8
11
|
# Disable Python downloads, because we want to use the system interpreter
|
|
9
12
|
# across both images. If using a managed Python version, it needs to be
|
|
10
13
|
# copied from the build image into the final image; see `standalone.Dockerfile`
|
|
@@ -17,13 +20,12 @@ RUN --mount=type=cache,target=/root/.cache/uv \
|
|
|
17
20
|
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
|
18
21
|
uv sync --frozen --no-install-project --no-dev
|
|
19
22
|
|
|
20
|
-
ADD src/ pyproject.toml uv.lock
|
|
23
|
+
ADD src/ pyproject.toml uv.lock README.md /app
|
|
21
24
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
22
25
|
uv sync --frozen --no-dev
|
|
23
26
|
|
|
24
|
-
|
|
25
27
|
# Then, use a final image without uv
|
|
26
|
-
FROM python:3.
|
|
28
|
+
FROM python:3.13-slim-bookworm
|
|
27
29
|
# It is important to use the image that matches the builder, as the path to the
|
|
28
30
|
# Python executable must be the same, e.g., using `python:3.12-slim-bookworm`
|
|
29
31
|
# will fail.
|