dbus2mqtt 0.5.0__tar.gz → 0.5.2__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.

Files changed (102) hide show
  1. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.github/workflows/ci.yml +2 -1
  2. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.github/workflows/deploy-docs.yml +1 -1
  3. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.github/workflows/docker-dev.yml +2 -1
  4. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.github/workflows/pre-commit.yml +1 -1
  5. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.github/workflows/publish.yml +1 -1
  6. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.github/workflows/trivy.yml +2 -2
  7. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.pre-commit-config.yaml +3 -3
  8. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/PKG-INFO +9 -9
  9. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/README.md +7 -7
  10. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docker/Dockerfile.dev +2 -2
  11. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docker/Dockerfile.pypi +1 -1
  12. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/examples/bluez.md +2 -1
  13. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/examples/dbus2mqtt_internal_state.yaml +1 -0
  14. dbus2mqtt-0.5.2/docs/examples/home_assistant_media_player/mqtt_mediaplayer.yaml +123 -0
  15. dbus2mqtt-0.5.2/docs/examples/home_assistant_media_player.md +82 -0
  16. dbus2mqtt-0.5.2/docs/examples/linux_desktop/notify.json +13 -0
  17. dbus2mqtt-0.5.2/docs/examples/linux_desktop/notify_with_actions_and_hints.json +13 -0
  18. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/examples/linux_desktop.md +6 -32
  19. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/flows/flow_triggers.md +4 -4
  20. dbus2mqtt-0.5.2/docs/templating/index.md +20 -0
  21. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/mkdocs.yml +2 -0
  22. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/pyproject.toml +1 -1
  23. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/config/__init__.py +16 -10
  24. dbus2mqtt-0.5.2/src/dbus2mqtt/config/jsonarparse.py +38 -0
  25. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/dbus/dbus_client.py +2 -2
  26. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/flow/flow_processor.py +1 -1
  27. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/mqtt/mqtt_client.py +2 -2
  28. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/template/templating.py +27 -3
  29. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/__init__.py +1 -2
  30. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/template/test_templating.py +20 -0
  31. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/uv.lock +0 -125
  32. dbus2mqtt-0.5.0/docs/examples/home_assistant_media_player.md +0 -201
  33. dbus2mqtt-0.5.0/docs/templating/index.md +0 -14
  34. dbus2mqtt-0.5.0/src/dbus2mqtt/config/jsonarparse.py +0 -32
  35. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.dockerignore +0 -0
  36. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.env.example +0 -0
  37. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  38. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  39. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.github/release-drafter.yml +0 -0
  40. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.github/scripts/release-versions.py +0 -0
  41. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.github/workflows/docker-stable.yml +0 -0
  42. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.github/workflows/release-drafter.yml +0 -0
  43. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.gitignore +0 -0
  44. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.markdownlint.json +0 -0
  45. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.python-version +0 -0
  46. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.vscode/launch.json +0 -0
  47. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.vscode/settings.json +0 -0
  48. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/.yamllint.yml +0 -0
  49. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/LICENSE +0 -0
  50. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/assets/favicon.svg +0 -0
  51. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/assets/logo-dark-img.svg +0 -0
  52. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/assets/logo-dark-text.png +0 -0
  53. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/assets/logo-dark-text.svg +0 -0
  54. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/assets/logo-light-img.svg +0 -0
  55. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/assets/logo-light-text.svg +0 -0
  56. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/developer/debugging_dbus.md +0 -0
  57. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/developer/index.md +0 -0
  58. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/examples/bluez.yaml +0 -0
  59. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/examples/connman-config.md +0 -0
  60. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/examples/connman-config.yaml +0 -0
  61. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/examples/dbus2mqtt_internal_state.md +0 -0
  62. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/examples/home_assistant_media_player.yaml +0 -0
  63. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/examples/index.md +0 -0
  64. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/examples/linux_desktop.yaml +0 -0
  65. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/flows/flow_actions.md +0 -0
  66. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/flows/index.md +0 -0
  67. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/hooks.py +0 -0
  68. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/index.md +0 -0
  69. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/overrides/main.html +0 -0
  70. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/setup.md +0 -0
  71. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/stylesheets/extra.css +0 -0
  72. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/docs/subscriptions.md +0 -0
  73. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/renovate.json +0 -0
  74. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/__init__.py +0 -0
  75. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/__main__.py +0 -0
  76. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/dbus/dbus_types.py +0 -0
  77. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/dbus/dbus_util.py +0 -0
  78. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/dbus/introspection_patches/mpris_playerctl.py +0 -0
  79. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/dbus/introspection_patches/mpris_vlc.py +0 -0
  80. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/event_broker.py +0 -0
  81. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/flow/__init__.py +0 -0
  82. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/flow/actions/context_set.py +0 -0
  83. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/flow/actions/log_action.py +0 -0
  84. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/flow/actions/mqtt_publish.py +0 -0
  85. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/main.py +0 -0
  86. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/src/dbus2mqtt/template/dbus_template_functions.py +0 -0
  87. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/config/fixtures/payload_template_jinja_expressions.yaml +0 -0
  88. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/config/fixtures/payload_template_off.yaml +0 -0
  89. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/config/fixtures/schedule_cron_trigger.yaml +0 -0
  90. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/config/test_config.py +0 -0
  91. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/config/test_examples.py +0 -0
  92. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/conftest.py +0 -0
  93. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/dbus/test_dbus_client.py +0 -0
  94. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/dbus/test_dbus_client_mqtt_command.py +0 -0
  95. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/dbus/test_dbus_utils.py +0 -0
  96. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/flow/actions/test_context_set.py +0 -0
  97. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/flow/actions/test_log.py +0 -0
  98. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/flow/actions/test_mqtt_publish.py +0 -0
  99. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/flow/test_flow_processor.py +0 -0
  100. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/flow/triggers/test_dbus_client_triggers.py +0 -0
  101. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/flow/triggers/test_mqtt_client_triggers.py +0 -0
  102. {dbus2mqtt-0.5.0 → dbus2mqtt-0.5.2}/tests/template/test_templating_config.py +0 -0
@@ -19,12 +19,13 @@ jobs:
19
19
  - "3.11"
20
20
  - "3.12"
21
21
  - "3.13"
22
+ - "3.14"
22
23
 
23
24
  steps:
24
25
  - uses: actions/checkout@v5
25
26
 
26
27
  - name: Install uv
27
- uses: astral-sh/setup-uv@v6
28
+ uses: astral-sh/setup-uv@v7
28
29
  with:
29
30
  activate-environment: true
30
31
  enable-cache: true
@@ -20,7 +20,7 @@ jobs:
20
20
  git config user.name github-actions[bot]
21
21
  git config user.email 41898282+github-actions[bot]@users.noreply.github.com
22
22
  - name: Install uv
23
- uses: astral-sh/setup-uv@v6
23
+ uses: astral-sh/setup-uv@v7
24
24
  with:
25
25
  activate-environment: true
26
26
  enable-cache: true
@@ -10,6 +10,7 @@ name: docker-dev
10
10
  - '.pre-commit-config.yaml'
11
11
  - 'README.md'
12
12
  - 'renovate.json'
13
+ - 'mkdocs.yaml'
13
14
  workflow_dispatch:
14
15
 
15
16
  jobs:
@@ -22,7 +23,7 @@ jobs:
22
23
  uses: actions/checkout@v5
23
24
 
24
25
  - name: Install uv
25
- uses: astral-sh/setup-uv@v6
26
+ uses: astral-sh/setup-uv@v7
26
27
  with:
27
28
  enable-cache: true
28
29
 
@@ -16,7 +16,7 @@ jobs:
16
16
  - uses: actions/checkout@v5
17
17
 
18
18
  - name: Install uv
19
- uses: astral-sh/setup-uv@v6
19
+ uses: astral-sh/setup-uv@v7
20
20
  with:
21
21
  activate-environment: true
22
22
  enable-cache: true
@@ -17,7 +17,7 @@ jobs:
17
17
  persist-credentials: false
18
18
 
19
19
  - name: Install uv
20
- uses: astral-sh/setup-uv@v6
20
+ uses: astral-sh/setup-uv@v7
21
21
  with:
22
22
  activate-environment: true
23
23
  enable-cache: true
@@ -21,7 +21,7 @@ jobs:
21
21
  uses: actions/checkout@v5
22
22
 
23
23
  - name: Run Trivy vulnerability scanner
24
- uses: aquasecurity/trivy-action@0.33.0
24
+ uses: aquasecurity/trivy-action@0.33.1
25
25
  with:
26
26
  image-ref: ghcr.io/jwnmulder/dbus2mqtt:latest
27
27
  format: 'sarif'
@@ -30,6 +30,6 @@ jobs:
30
30
  ignore-unfixed: true
31
31
 
32
32
  - name: Upload Trivy scan results to GitHub Security tab
33
- uses: github/codeql-action/upload-sarif@v3
33
+ uses: github/codeql-action/upload-sarif@v4
34
34
  with:
35
35
  sarif_file: 'trivy-results.sarif'
@@ -33,7 +33,7 @@ repos:
33
33
  - --strict
34
34
 
35
35
  - repo: https://github.com/astral-sh/ruff-pre-commit
36
- rev: v0.12.11
36
+ rev: v0.14.0
37
37
  hooks:
38
38
  - id: ruff
39
39
  args:
@@ -42,12 +42,12 @@ repos:
42
42
  - I
43
43
 
44
44
  - repo: https://github.com/astral-sh/uv-pre-commit
45
- rev: 0.8.14
45
+ rev: 0.9.2
46
46
  hooks:
47
47
  - id: uv-lock
48
48
 
49
49
  - repo: https://github.com/RobertCraigie/pyright-python
50
- rev: v1.1.404
50
+ rev: v1.1.406
51
51
  hooks:
52
52
  - id: pyright
53
53
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dbus2mqtt
3
- Version: 0.5.0
3
+ Version: 0.5.2
4
4
  Summary: General purpose DBus to MQTT bridge - expose signals, methods and properties over MQTT - featuring jinja based templating, payload enrichment and MPRIS / BlueZ / Home Assistant ready examples
5
5
  Project-URL: Documentation, https://jwnmulder.github.io/dbus2mqtt
6
6
  Project-URL: Source, https://github.com/jwnmulder/dbus2mqtt
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.10
17
17
  Classifier: Programming Language :: Python :: 3.11
18
18
  Classifier: Programming Language :: Python :: 3.12
19
19
  Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
20
21
  Classifier: Topic :: Home Automation
21
22
  Requires-Python: >=3.10
22
23
  Requires-Dist: apscheduler>=3.11.0
@@ -27,7 +28,6 @@ Requires-Dist: jinja2-ansible-filters>=1.3.2
27
28
  Requires-Dist: jinja2>=3.1.6
28
29
  Requires-Dist: jsonargparse>=4.38.0
29
30
  Requires-Dist: paho-mqtt>=2.1.0
30
- Requires-Dist: pydantic>=2.11.3
31
31
  Requires-Dist: python-dotenv>=1.1.0
32
32
  Requires-Dist: pyyaml>=6.0.2
33
33
  Description-Content-Type: text/markdown
@@ -51,7 +51,7 @@ This makes it easy to integrate Linux desktop services or system signals into MQ
51
51
 
52
52
  **dbus2mqtt** is considered stable for the use-cases it has been tested against, and is actively being developed. Documentation is continuously being improved.
53
53
 
54
- Initial testing has focused on MPRIS integration. A table of tested MPRIS players and their supported methods can be found on [Mediaplayer integration with Home Assistant](https://jwnmulder.github.io/dbus2mqtt/examples/home_assistant_media_player.html)
54
+ Initial testing has focused on MPRIS integration. A table of tested MPRIS players and their supported methods can be found on [Mediaplayer integration with Home Assistant](https://jwnmulder.github.io/dbus2mqtt/examples/home_assistant_media_player/)
55
55
 
56
56
  ## Getting started with dbus2mqtt
57
57
 
@@ -101,16 +101,16 @@ python -m pip install dbus2mqtt
101
101
  dbus2mqtt --config config.yaml
102
102
  ```
103
103
 
104
- See [setup](https://jwnmulder.github.io/dbus2mqtt/setup.html) for more installation options and configuration details.
104
+ See [setup](https://jwnmulder.github.io/dbus2mqtt/setup/) for more installation options and configuration details.
105
105
 
106
106
  ## Examples
107
107
 
108
- More dbus2mqtt examples can be found in the [examples](https://jwnmulder.github.io/dbus2mqtt/examples/index.html) section.
109
- The most complete one being [Mediaplayer integration with Home Assistant](https://jwnmulder.github.io/dbus2mqtt/examples/home_assistant_media_player.html)
108
+ More dbus2mqtt examples can be found in the [examples](https://jwnmulder.github.io/dbus2mqtt/examples/) section.
109
+ The most complete one being [Mediaplayer integration with Home Assistant](https://jwnmulder.github.io/dbus2mqtt/examples/home_assistant_media_player/)
110
110
 
111
111
  ## Exposing dbus methods, properties and signals
112
112
 
113
- See [subscriptions](https://jwnmulder.github.io/dbus2mqtt/subscriptions.html) for documentation on calling methods, setting properties and exposing D-Bus signals to MQTT. When configured, D-Bus methods can be invoked by publishing a message like
113
+ See [subscriptions](https://jwnmulder.github.io/dbus2mqtt/subscriptions/) for documentation on calling methods, setting properties and exposing D-Bus signals to MQTT. When configured, D-Bus methods can be invoked by publishing a message like
114
114
 
115
115
  ```json
116
116
  {
@@ -120,6 +120,6 @@ See [subscriptions](https://jwnmulder.github.io/dbus2mqtt/subscriptions.html) fo
120
120
 
121
121
  ## Flows and Jinja based templating
122
122
 
123
- For more advanced use-cases, dbus2mqtt has support for flows and Jinja2 based templates. A reference of all supported flow triggers and actions can be found on [flows](https://jwnmulder.github.io/dbus2mqtt/flows/index.html)
123
+ For more advanced use-cases, dbus2mqtt has support for flows and Jinja2 based templates. A reference of all supported flow triggers and actions can be found on [flows](https://jwnmulder.github.io/dbus2mqtt/flows/)
124
124
 
125
- Jinja templating documentation can be found here: [templating](templating/index.md)
125
+ Jinja templating documentation can be found here: [templating](https://jwnmulder.github.io/dbus2mqtt/templating/)
@@ -17,7 +17,7 @@ This makes it easy to integrate Linux desktop services or system signals into MQ
17
17
 
18
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
- Initial testing has focused on MPRIS integration. A table of tested MPRIS players and their supported methods can be found on [Mediaplayer integration with Home Assistant](https://jwnmulder.github.io/dbus2mqtt/examples/home_assistant_media_player.html)
20
+ Initial testing has focused on MPRIS integration. A table of tested MPRIS players and their supported methods can be found on [Mediaplayer integration with Home Assistant](https://jwnmulder.github.io/dbus2mqtt/examples/home_assistant_media_player/)
21
21
 
22
22
  ## Getting started with dbus2mqtt
23
23
 
@@ -67,16 +67,16 @@ python -m pip install dbus2mqtt
67
67
  dbus2mqtt --config config.yaml
68
68
  ```
69
69
 
70
- See [setup](https://jwnmulder.github.io/dbus2mqtt/setup.html) for more installation options and configuration details.
70
+ See [setup](https://jwnmulder.github.io/dbus2mqtt/setup/) for more installation options and configuration details.
71
71
 
72
72
  ## Examples
73
73
 
74
- More dbus2mqtt examples can be found in the [examples](https://jwnmulder.github.io/dbus2mqtt/examples/index.html) section.
75
- The most complete one being [Mediaplayer integration with Home Assistant](https://jwnmulder.github.io/dbus2mqtt/examples/home_assistant_media_player.html)
74
+ More dbus2mqtt examples can be found in the [examples](https://jwnmulder.github.io/dbus2mqtt/examples/) section.
75
+ The most complete one being [Mediaplayer integration with Home Assistant](https://jwnmulder.github.io/dbus2mqtt/examples/home_assistant_media_player/)
76
76
 
77
77
  ## Exposing dbus methods, properties and signals
78
78
 
79
- See [subscriptions](https://jwnmulder.github.io/dbus2mqtt/subscriptions.html) for documentation on calling methods, setting properties and exposing D-Bus signals to MQTT. When configured, D-Bus methods can be invoked by publishing a message like
79
+ See [subscriptions](https://jwnmulder.github.io/dbus2mqtt/subscriptions/) for documentation on calling methods, setting properties and exposing D-Bus signals to MQTT. When configured, D-Bus methods can be invoked by publishing a message like
80
80
 
81
81
  ```json
82
82
  {
@@ -86,6 +86,6 @@ See [subscriptions](https://jwnmulder.github.io/dbus2mqtt/subscriptions.html) fo
86
86
 
87
87
  ## Flows and Jinja based templating
88
88
 
89
- For more advanced use-cases, dbus2mqtt has support for flows and Jinja2 based templates. A reference of all supported flow triggers and actions can be found on [flows](https://jwnmulder.github.io/dbus2mqtt/flows/index.html)
89
+ For more advanced use-cases, dbus2mqtt has support for flows and Jinja2 based templates. A reference of all supported flow triggers and actions can be found on [flows](https://jwnmulder.github.io/dbus2mqtt/flows/)
90
90
 
91
- Jinja templating documentation can be found here: [templating](templating/index.md)
91
+ Jinja templating documentation can be found here: [templating](https://jwnmulder.github.io/dbus2mqtt/templating/)
@@ -20,12 +20,12 @@ RUN --mount=type=cache,target=/root/.cache/uv \
20
20
  --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
21
21
  uv sync --frozen --no-install-project --no-dev
22
22
 
23
- ADD src/ pyproject.toml uv.lock README.md /app
23
+ ADD src/ pyproject.toml uv.lock README.md /app/
24
24
  RUN --mount=type=cache,target=/root/.cache/uv \
25
25
  uv sync --frozen --no-dev
26
26
 
27
27
  # Then, use a final image without uv
28
- FROM python:3.13-slim-bookworm@sha256:9b8102b7b3a61db24fe58f335b526173e5aeaaf7d13b2fbfb514e20f84f5e386
28
+ FROM python:3.13-slim-bookworm@sha256:adafcc17694d715c905b4c7bebd96907a1fd5cf183395f0ebc4d3428bd22d92d
29
29
  # It is important to use the image that matches the builder, as the path to the
30
30
  # Python executable must be the same, e.g., using `python:3.12-slim-bookworm`
31
31
  # will fail.
@@ -1,4 +1,4 @@
1
- FROM python:3.13-slim-bookworm@sha256:9b8102b7b3a61db24fe58f335b526173e5aeaaf7d13b2fbfb514e20f84f5e386
1
+ FROM python:3.13-slim-bookworm@sha256:adafcc17694d715c905b4c7bebd96907a1fd5cf183395f0ebc4d3428bd22d92d
2
2
 
3
3
  WORKDIR /app
4
4
 
@@ -40,4 +40,5 @@ Dbus methods can be invoked by sendig the JSON payload to MQTT topic `dbus2mqtt/
40
40
 
41
41
  ## References
42
42
 
43
- * <https://manpages.ubuntu.com/manpages/noble/man5/org.bluez>
43
+ * <https://manpages.ubuntu.com/manpages/noble/man5/org.bluez.Adapter.5.html>
44
+ * <https://manpages.ubuntu.com/manpages/noble/man5/org.bluez.Device.5.html>
@@ -39,6 +39,7 @@ flows:
39
39
  payload_type: json
40
40
  payload_template:
41
41
  now: "{{ now().isoformat() }}"
42
+ dbus2mqtt: " {{ dbus2mqtt }}"
42
43
  dbus_list_res: "{{ dbus_list('*') }}"
43
44
  - type: log
44
45
  level: INFO
@@ -0,0 +1,123 @@
1
+ mqtt:
2
+ sensor:
3
+ - name: MPRIS Media Player
4
+ state_topic: dbus2mqtt/org.mpris.MediaPlayer2/state
5
+ json_attributes_topic: dbus2mqtt/org.mpris.MediaPlayer2/state
6
+ value_template: >-
7
+ {% set status = value_json.PlaybackStatus %}
8
+ {{ {'Playing': 'playing', 'Paused': 'paused', 'Stopped': 'idle'}.get(status, 'off') }}
9
+
10
+ image:
11
+ - name: MPRIS Media Player MQTT image
12
+ image_topic: dbus2mqtt/org.mpris.MediaPlayer2/artUrlImage
13
+
14
+ media_player:
15
+ - platform: media_player_template
16
+ media_players:
17
+ mpris_media_player:
18
+ device_class: receiver
19
+ friendly_name: MPRIS Media Player
20
+ value_template: "{{ states('sensor.mpris_media_player') }}"
21
+
22
+ current_volume_template: "{{ state_attr('sensor.mpris_media_player', 'Volume') }}"
23
+ current_is_muted_template: "{{ state_attr('sensor.mpris_media_player', 'Volume') == 0 }}"
24
+ current_position_template: "{{ (state_attr('sensor.mpris_media_player', 'Position') / 1000000) | int }}"
25
+
26
+ # title: 'xesam:title' or filename without extension from 'xesam:url'
27
+ title_template: >-
28
+ {% set metadata = state_attr('sensor.mpris_media_player', 'Metadata') or {} %}
29
+ {% set title = metadata.get('xesam:title', '') %}
30
+ {% if not title or title == '' %}
31
+ {% set title = metadata.get('xesam:url', '') | regex_findall(find='([^\\/]+?)(?:\.[^.\\/]+)?$') | first | default('') %}
32
+ {% endif %}
33
+ {{ title }}
34
+
35
+ media_content_type_template: music # needed to show 'artist'
36
+ media_duration_template: "{{ ((state_attr('sensor.mpris_media_player', 'Metadata') or {}).get('mpris:length', 0) / 1000000) | int }}"
37
+ album_template: "{{ (state_attr('sensor.mpris_media_player', 'Metadata') or {}).get('xesam:album', '') }}"
38
+ artist_template: >-
39
+ {% set artist = (state_attr('sensor.mpris_media_player', 'Metadata') or {}).get('xesam:artist', '') %}
40
+ {% if artist is string %}
41
+ {% set artist = [artist] %}
42
+ {% endif %}
43
+ {{ artist | first }}
44
+
45
+ # mpris:artUrl might contain a file:// schema. In these cases we rely on images published via MQTT
46
+ media_image_url_template: >-
47
+ {% set mpris_metadata = state_attr('sensor.mpris_media_player', 'Metadata') or {} %}
48
+ {% set mpris_art_url = mpris_metadata.get('mpris:artUrl', '') %}
49
+ {% set mpris_url = mpris_metadata.get('xesam:url') %}
50
+
51
+ {% if mpris_art_url.startswith('http') %}
52
+ {{ mpris_art_url }}
53
+ {% elif mpris_art_url.startswith('file://') %}
54
+ http://127.0.0.1:8123{{ state_attr('image.mpris_media_player_mqtt_image', 'entity_picture') }}
55
+ {% else %}
56
+ {{
57
+ mpris_url | regex_replace(
58
+ find='https:\/\/www\\.youtube\\.com\/watch\\?v=([^&]+).*',
59
+ replace='https://img.youtube.com/vi/\\1/maxresdefault.jpg'
60
+ )
61
+ }}
62
+ {% endif %}
63
+
64
+ turn_off:
65
+ service: mqtt.publish
66
+ data:
67
+ topic: dbus2mqtt/org.mpris.MediaPlayer2/command
68
+ payload: >
69
+ {"method": "Quit"}
70
+ play:
71
+ service: mqtt.publish
72
+ data:
73
+ topic: dbus2mqtt/org.mpris.MediaPlayer2/command
74
+ payload: >
75
+ {"method": "Play"}
76
+ pause:
77
+ service: mqtt.publish
78
+ data:
79
+ topic: dbus2mqtt/org.mpris.MediaPlayer2/command
80
+ payload: >
81
+ {"method": "Pause"}
82
+ stop:
83
+ service: mqtt.publish
84
+ data:
85
+ topic: dbus2mqtt/org.mpris.MediaPlayer2/command
86
+ payload: >
87
+ {"method": "Stop"}
88
+ next:
89
+ service: mqtt.publish
90
+ data:
91
+ topic: dbus2mqtt/org.mpris.MediaPlayer2/command
92
+ payload: >
93
+ {"method": "Next"}
94
+ previous:
95
+ service: mqtt.publish
96
+ data:
97
+ topic: dbus2mqtt/org.mpris.MediaPlayer2/command
98
+ payload: >
99
+ {"method": "Previous"}
100
+ seek:
101
+ service: mqtt.publish
102
+ data:
103
+ topic: dbus2mqtt/org.mpris.MediaPlayer2/command
104
+ payload: >
105
+ { "method": "SetPosition", "args": ["{{ state_attr('sensor.mpris_media_player', 'Metadata')['mpris:trackid'] }}", {{ (position * 1000000) | int }}] }
106
+ set_volume:
107
+ service: mqtt.publish
108
+ data:
109
+ topic: dbus2mqtt/org.mpris.MediaPlayer2/command
110
+ payload: >
111
+ {"property": "Volume", "value": {{volume}} }
112
+ volume_up:
113
+ service: mqtt.publish
114
+ data:
115
+ topic: dbus2mqtt/org.mpris.MediaPlayer2/command
116
+ payload: >
117
+ {"property": "Volume", "value": {{ [1, (state_attr('sensor.mpris_media_player', 'Volume') + 0.1)] | min }} }
118
+ volume_down:
119
+ service: mqtt.publish
120
+ data:
121
+ topic: dbus2mqtt/org.mpris.MediaPlayer2/command
122
+ payload: >
123
+ {"property": "Volume", "value": {{ [0, (state_attr('sensor.mpris_media_player', 'Volume') - 0.1)] | max }} }
@@ -0,0 +1,82 @@
1
+ ---
2
+ hide:
3
+ - toc
4
+ ---
5
+
6
+ # Mediaplayer integration with Home Assistant
7
+
8
+ With dbus2mqtt as a bridge between MPRIS players and Home Assistant, it becomes possible to control Linux based media players via Home Assistant.
9
+
10
+ The Media Player Remote Interfacing Specification (MPRIS) is a standard for controlling Linux media players. It provides a mechanism for compliant media players discovery, basic playback and media player state control as well as a tracklist interface which is used to add context to the current item.
11
+
12
+ Pre-requisites:
13
+
14
+ * Home-Assistant with a working MQTT setup
15
+ * The community Home-Assistant plugin [github.com/Sennevds/media_player.template](https://github.com/Sennevds/media_player.template)
16
+
17
+ ## Features
18
+
19
+ * dbus subscription using `org.mpris.MediaPlayer2.*` wildcard to support multiple concurrent MRPIS players
20
+ * Every 5 seconds, the state of the `first` known MPRIS player is published to MQTT topic `dbus2mqtt/org.mpris.MediaPlayer2/state`
21
+ * Every MPRIS property update immediately publishes the state to MQTT topic `dbus2mqtt/org.mpris.MediaPlayer2/state`
22
+ * Support for player commands (see below)
23
+
24
+ ## Setup activities
25
+
26
+ * Configure the MQTT Sensor and player configuration in Home Assistant with the configuration listed below
27
+ * Config dbus2mqtt using the supplied [home_assistant_media_player.yaml](https://github.com/jwnmulder/dbus2mqtt/blob/main/docs/examples/home_assistant_media_player.yaml)
28
+
29
+ To run, execute the following commands
30
+
31
+ ```bash
32
+ dbus2mqtt --config docs/examples/home_assistant_media_player.yaml
33
+ ```
34
+
35
+ ## Tested configurations
36
+
37
+ The following MPRIS players are known to work with Home Assistant.
38
+
39
+ | Application | Play<br />Pause<br /> | Stop | Next<br />Previous | Seek<br />SetPosition | Volume | Quit | Media Info | Media Image | Notes |
40
+ |--------------|-----------------------|------|--------------------|------|--------|------|------------|-------------|-------------------|
41
+ | `Firefox` | ✅ | ✅ | ✅ | ✅ | | ❌ | ✅ | ✅ | |
42
+ | `VLC` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | |
43
+ | `Chromium` | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✔️ | Images not working when Chromium is running as snap |
44
+ | `Kodi` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | Requires Kodi plugin [MediaPlayerRemoteInterface](https://github.com/wastis/MediaPlayerRemoteInterface) |
45
+
46
+ !!! note
47
+ More players that support MPRIS (but have not been tested) can be found here: <https://wiki.archlinux.org/title/MPRIS>
48
+
49
+ ## Player commands
50
+
51
+ The following table lists player commands, their descriptions, and an example JSON payload for invoking them via MQTT.
52
+
53
+ Dbus methods can be invoked by sendig the JSON payload to MQTT topic `dbus2mqtt/org.mpris.MediaPlayer2/command`. Method calls will be done for all matching players. The same applies to property updates.
54
+
55
+ | Method<br />Property | Description | Example MQTT JSON Payload |
56
+ |---------------|------------------------------------------|------------------------------------------------|
57
+ | `Play` | Starts playback | `#!json { "method": "Play" }` |
58
+ | `Pause` | Pauses playback | `#!json { "method": "Pause" }` |
59
+ | `PlayPause` | Toggles between play and pause | `#!json { "method": "PlayPause" }` |
60
+ | `Stop` | Stops playback | `#!json { "method": "Stop" }` |
61
+ | `Next` | Next | `#!json { "method": "Next" }` |
62
+ | `Previous` | Previous | `#!json { "method": "Previous" }` |
63
+ | `Seek` | Seek forward or backward in micro seconds | `#!json { "method": "Seek", "args": [60000000] }` |
64
+ | `Volume` | Set volume (double between 0 and 1) | `#!json { "property": "Volume", "value": 1.0 }` |
65
+ | `SetPosition` | Set / seek to position in micro seconds. First arguments needs to be trackid which can be determined via Metadata.mpris:trackid | `#!json { "method": "SetPosition", "args": ["/org/mpris/MediaPlayer2/firefox", 170692139] }` |
66
+ | `Quit` | Quits the media player | `#!json { "method": "Quit" }` |
67
+
68
+ For an overview of MPRIS commands have a look at <https://mpris2.readthedocs.io/en/latest/interfaces.html#mpris2.MediaPlayer2>
69
+
70
+ ## Home Assistant configuration
71
+
72
+ Besides setting up `dbus2mqtt`, Home Assistant needs to be configured as well. The configuration shown below creates the necessary components in Home Assistant for controlling MPRIS Media Players. Three components will be setup.
73
+
74
+ * MQTT sensor listening on topic `dbus2mqtt/org.mpris.MediaPlayer2/state`
75
+ * MQTT image listening on topic `dbus2mqtt/org.mpris.MediaPlayer2/artUrlImage`
76
+ * Media Player
77
+
78
+ ```yaml+jinja title='config/packages/mqtt_mediaplayer.yaml'
79
+ --8<-- "docs/examples/home_assistant_media_player/mqtt_mediaplayer.yaml"
80
+ ```
81
+
82
+ Source: [mqtt_mediaplayer.yaml](https://github.com/jwnmulder/dbus2mqtt/blob/main/docs/examples/home_assistant_media_player/mqtt_mediaplayer.yaml)
@@ -0,0 +1,13 @@
1
+ {
2
+ "method": "Notify",
3
+ "args": [
4
+ "dbus2mqtt",
5
+ 0,
6
+ "dialog-information",
7
+ "dbus2mqtt",
8
+ "Message from <b><i>dbus2mqtt</i></b>",
9
+ [],
10
+ {},
11
+ 0
12
+ ]
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "method": "Notify",
3
+ "args": [
4
+ "dbus2mqtt",
5
+ 0,
6
+ "dialog-information",
7
+ "dbus2mqtt",
8
+ "Message from <b><i>dbus2mqtt</i></b>",
9
+ ["ok", "OK", "cancel", "Cancel"],
10
+ { "urgency": 1, "category": "device" },
11
+ 5000
12
+ ]
13
+ }
@@ -5,8 +5,6 @@ hide:
5
5
 
6
6
  # Linux Desktop
7
7
 
8
- ## Introduction
9
-
10
8
  Use dbus2mqtt to interface with your Linux desktop
11
9
 
12
10
  Pre-requisites:
@@ -29,40 +27,16 @@ uv run dbus2mqtt --config docs/examples/linux_desktop.yaml
29
27
 
30
28
  Trigger a desktop notification by sending one of the following example payloads to `dbus2mqtt/Notifications/command`
31
29
 
32
- Simple notification with no timeout
30
+ Example notification with no timeout
33
31
 
34
32
  ```json
35
- {
36
- "method": "Notify",
37
- "args": [
38
- "dbus2mqtt",
39
- 0,
40
- "dialog-information",
41
- "dbus2mqtt",
42
- "Message from <b><i>dbus2mqtt</i></b>",
43
- [],
44
- {},
45
- 0
46
- ]
47
- }
33
+ --8<-- "docs/examples/linux_desktop/notify.json"
48
34
  ```
49
35
 
50
- Notification with actions and hints that automatically disappears after 5 seconds
36
+ Example notification with actions and hints, that automatically disappears after 5 seconds
51
37
 
52
38
  ```json
53
- {
54
- "method": "Notify",
55
- "args": [
56
- "dbus2mqtt",
57
- 0,
58
- "dialog-information",
59
- "dbus2mqtt",
60
- "Message from <b><i>dbus2mqtt</i></b>",
61
- ["ok", "OK", "cancel", "Cancel"],
62
- { "urgency": 1, "category": "device" },
63
- 5000
64
- ]
65
- }
39
+ --8<-- "docs/examples/linux_desktop/notify_with_actions_and_hints.json"
66
40
  ```
67
41
 
68
42
  Further references:
@@ -70,7 +44,7 @@ Further references:
70
44
  * <https://specifications.freedesktop.org/notification-spec/1.3/>
71
45
  * <https://specifications.freedesktop.org/icon-naming-spec/latest/>
72
46
 
73
- ## Gnome SessionManager
47
+ <!-- ## Gnome SessionManager
74
48
 
75
49
  !!! note
76
50
  work in progress
@@ -79,4 +53,4 @@ The following table lists the supported commands, their descriptions, and an exa
79
53
 
80
54
  dbus methods can be invoked by sendig the JSON payload to MQTT topic `dbus2mqtt/SessionManager/command`.
81
55
 
82
- For an overview of commands have a look at <https://docs.flatpak.org/en/latest/portal-api-reference.html>
56
+ For an overview of commands have a look at <https://docs.flatpak.org/en/latest/portal-api-reference.html> -->
@@ -81,16 +81,13 @@ When triggered, the following context parameters are available
81
81
  filter: "{{ payload.get('action') == 'Mute' }}"
82
82
  ```
83
83
 
84
- Listens for MQTT message on the configured topic. The message payload is expected to be JSON formatted
84
+ Listens for MQTT messages on the configured topic. The message payload is expected to be JSON formatted
85
85
 
86
86
  | key | description |
87
87
  |------|-------------|
88
88
  | topic | topic to subscribe to, e.g. 'dbus2mqtt/org.mpris.MediaPlayer2/flow-trigger' |
89
89
  | filter | A templated string that must evaluate to a boolean result. When False, the flow is not triggered |
90
90
 
91
- !!! note
92
- If `topic` overlaps with `subscription[].interfaces[].mqtt_command_topic` and the JSON payload structure follows `mqtt_command_topic` layout, a dbus call will be executed as well.
93
-
94
91
  When triggered, the following context parameters are available
95
92
 
96
93
  | name | type | description |
@@ -112,3 +109,6 @@ flows:
112
109
  msg: |
113
110
  Flow triggered by MQTT message, payload.action={{ payload.get('action') }}
114
111
  ```
112
+
113
+ !!! note
114
+ If `topic` overlaps with `subscription[].interfaces[].mqtt_command_topic` and the JSON payload structure follows `mqtt_command_topic` layout, a dbus call will be executed as well. Similar, warnings will be logged if a message does not match any flow or D-Bus method.
@@ -0,0 +1,20 @@
1
+ # Templating
2
+
3
+ **dbus2mqtt** leverages Jinja to allow formatting MQTT messages, D-Bus responses or advanced configuration use-cases. If you are not familiar with Jinja based expressions, have a look at Jinjas own [Template Designer Documentation](https://jinja.palletsprojects.com/en/stable/templates/).
4
+
5
+ Templating is used in these areas of dbus2mqtt:
6
+
7
+ * [subscriptions](../subscriptions.md)
8
+ * [flow actions](../flows/flow_actions.md)
9
+
10
+ Besides the filters and functions Jinja provides out of the box, additional extensions are available.
11
+
12
+ All filters from [jinja2-ansible-filters](https://pypi.org/project/jinja2-ansible-filters/) are included as well as the following global functions, variables and filters:
13
+
14
+ | Name | Type | Description |
15
+ |---------------------|-----------|-----------------------------------------------------------------------------|
16
+ | `now` | function | Returns the current date and time as a `datetime` object. |
17
+ | `urldecode` | function | Decodes a URL-encoded string. |
18
+ | `dbus2mqtt.version` | string | The current version of the `dbus2mqtt` package. |
19
+
20
+ More documentation to be added, for now see the [Mediaplayer integration with Home Assistant](../examples/home_assistant_media_player.md) example for inspiration.
@@ -134,6 +134,8 @@ markdown_extensions:
134
134
  - pymdownx.snippets:
135
135
  check_paths: true
136
136
 
137
+ - footnotes
138
+
137
139
  hooks:
138
140
  - docs/hooks.py
139
141
 
@@ -34,6 +34,7 @@ classifiers = [
34
34
  "Programming Language :: Python :: 3.11",
35
35
  "Programming Language :: Python :: 3.12",
36
36
  "Programming Language :: Python :: 3.13",
37
+ "Programming Language :: Python :: 3.14",
37
38
  ]
38
39
 
39
40
  requires-python = ">=3.10"
@@ -47,7 +48,6 @@ dependencies = [
47
48
  "jinja2-ansible-filters>=1.3.2",
48
49
  "jsonargparse>=4.38.0",
49
50
  "paho-mqtt>=2.1.0",
50
- "pydantic>=2.11.3",
51
51
  "python-dotenv>=1.1.0",
52
52
  "pyyaml>=6.0.2",
53
53
  ]