From b44457e2e1fb3456fbdc5652aaf040dabe7db281 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Mon, 10 Feb 2025 21:09:42 +0900 Subject: [PATCH] Ledvance Planon lights: improvements based on feedback - swap main and backlight switch bits. - properly use standard color_temp dp as backup for dp 51 based color temp - consistently use "std_" for standard dp prefixes - set lower range of color temp to 3000K - make backlight unavailable until dp 51 is received, as changing the color will give errors until then std_rgbhsv is left for reference, even though it is unused by the actual entities. Maybe one day the code will be able to use a different format dp as a backup for a dp with multi-value format. Issue #2683 --- .../devices/ledvance_smart_plabl100x25b.yaml | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/custom_components/tuya_local/devices/ledvance_smart_plabl100x25b.yaml b/custom_components/tuya_local/devices/ledvance_smart_plabl100x25b.yaml index a02bc8bd27..9fc98919ed 100644 --- a/custom_components/tuya_local/devices/ledvance_smart_plabl100x25b.yaml +++ b/custom_components/tuya_local/devices/ledvance_smart_plabl100x25b.yaml @@ -19,7 +19,7 @@ entities: name: available - id: 51 type: base64 - mask: "000200000000000000000000" + mask: "000100000000000000000000" optional: true force: true name: switch @@ -31,7 +31,7 @@ entities: optional: true name: work_mode - id: 22 - name: standard_brightness + name: std_brightness type: integer range: min: 0 @@ -44,7 +44,7 @@ entities: name: brightness mapping: - dps_val: null - value_mirror: standard_brightness + value_mirror: std_brightness range: min: 0 max: 1000 @@ -56,7 +56,7 @@ entities: max: 500 mapping: - target_range: - min: 2700 + min: 3000 max: 6500 - id: 51 type: base64 @@ -66,9 +66,9 @@ entities: name: color_temp mapping: - dps_val: null - value_mirror: standard_brightness + value_mirror: std_color_temp - target_range: - min: 2700 + min: 3000 max: 6500 range: min: 0 @@ -79,9 +79,16 @@ entities: - id: 20 type: boolean name: available + mapping: + - dps_val: true + value: true + constraint: switch + conditions: + - dps_val: null + value: false - id: 51 type: base64 - mask: "000100000000000000000000" + mask: "000200000000000000000000" optional: true force: true name: switch