From c8d05acae9e739ce069712177ed5ae9d4055c024 Mon Sep 17 00:00:00 2001 From: bahmcloud Date: Sun, 15 Feb 2026 21:00:24 +0100 Subject: [PATCH] Tune relative dimming steps --- .idea/PROJECT_STATE.md | 3 ++- CHANGELOG.md | 3 +++ README.md | 4 ++-- custom_components/ha_knx_bridge/bridge.py | 14 +++++++------- custom_components/ha_knx_bridge/manifest.json | 2 +- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.idea/PROJECT_STATE.md b/.idea/PROJECT_STATE.md index 208a6dd..a4ba110 100644 --- a/.idea/PROJECT_STATE.md +++ b/.idea/PROJECT_STATE.md @@ -42,7 +42,8 @@ Completed: - Light port keys renamed to avoid conflicts; outgoing updates now only target light state addresses. - Light port optional relative dimming address (DPT 3.007) added. - Light color temperature event type mapping and relative dimming decoding fixed. -- Project version set to 0.0.24 and `CHANGELOG.md` maintained. +- Relative dimming step mapping tuned to avoid on/off jumps. +- Project version set to 0.0.25 and `CHANGELOG.md` maintained. Files created: - `custom_components/ha_knx_bridge/__init__.py` diff --git a/CHANGELOG.md b/CHANGELOG.md index 74fae5a..30c11cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 0.0.25 - 2026-02-15 +- Tune light relative dimming step mapping to avoid on/off jumps. + ## 0.0.24 - 2026-02-15 - Fix light color temperature event type mapping and improve relative dimming decoding. diff --git a/README.md b/README.md index 6ccfbad..726c6ea 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Only state addresses expose an `invert outgoing` toggle to flip KNX payloads. Notes: - For XY color, the bridge sends the brightness as the Y (luminance) component. -- Relative dimming (DPT 3.007) maps KNX step values to `brightness_step_pct` in Home Assistant. +- Relative dimming (DPT 3.007) maps KNX step values to small `brightness_step_pct` changes in Home Assistant. - Color temperature mode must match the KNX telegram DPT: `relative` for 5.001, `absolute` for 7.600, `absolute_float` for DPT 9. ## Notes @@ -108,5 +108,5 @@ Notes: - Advanced DPT mapping options and inversion settings. ## Versioning and Releases -- Current version: 0.0.24 +- Current version: 0.0.25 - `CHANGELOG.md` lists versions with the newest entries at the top. diff --git a/custom_components/ha_knx_bridge/bridge.py b/custom_components/ha_knx_bridge/bridge.py index fd772b9..e06f8c0 100644 --- a/custom_components/ha_knx_bridge/bridge.py +++ b/custom_components/ha_knx_bridge/bridge.py @@ -1678,13 +1678,13 @@ def _relative_dimming_step(value: int) -> tuple[str, int] | None: direction = "up" step = value - 8 percent_map = { - 1: 100, - 2: 50, - 3: 25, - 4: 13, - 5: 6, - 6: 3, - 7: 2, + 1: 10, + 2: 8, + 3: 6, + 4: 4, + 5: 3, + 6: 2, + 7: 1, } percent = percent_map.get(step) if percent is None: diff --git a/custom_components/ha_knx_bridge/manifest.json b/custom_components/ha_knx_bridge/manifest.json index 00542fc..132acdf 100644 --- a/custom_components/ha_knx_bridge/manifest.json +++ b/custom_components/ha_knx_bridge/manifest.json @@ -1,7 +1,7 @@ { "domain": "ha_knx_bridge", "name": "HA KNX Bridge", - "version": "0.0.24", + "version": "0.0.25", "config_flow": true, "documentation": "https://github.com/bahmcloud/HA-KNX-Bridge", "issue_tracker": "https://github.com/bahmcloud/HA-KNX-Bridge/issues",