Ver código fonte

fix(lumary-c2): coordinate light with master power (#6074)

On the Lumary C2, DPS 119 is the device-wide master switch and DPS 20 is
the main light switch. When the master is off, the device can retain DPS
20 as `true`, so Tuya Local can report the light on even though it is
physically off. Sending only DPS 20 as `true` also cannot restore power.

This updates the existing profile from #5634 so:

- `119=false` masks a stale `20=true` light state;
- turning the light on sets both `119=true` and `20=true`;
- turning the light off sets only `20=false`.

The change uses the integration's existing conditional mapping support
and does not change Python code.

Tested on all six installed L-CFL19C2 fixtures. One fixture was used as
the physical canary, followed by a two-day household soak.

Validation:

- 428 full tests passed;
- 32 device-config tests passed;
- Ruff, import order, formatting, yamllint, the direct DPS semantic
probe, duplicate-profile check, and diff hygiene passed.

---------

Co-authored-by: digitalvir <1421360+digitalvir@users.noreply.github.com>
Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
DigitalVir 1 semana atrás
pai
commit
9786abd930

+ 15 - 0
custom_components/tuya_local/devices/lumary_c2_ceilingfanlight.yaml

@@ -11,6 +11,9 @@ entities:
       - id: 20
         type: boolean
         name: switch
+      - id: 119
+        type: boolean
+        name: available
       - id: 21
         name: color_mode
         type: string
@@ -130,6 +133,9 @@ entities:
   - entity: fan
     translation_only_key: fan_with_presets
     dps:
+      - id: 119
+        type: boolean
+        name: available
       - id: 101
         type: boolean
         name: switch
@@ -178,6 +184,9 @@ entities:
   - entity: light
     translation_key: nightlight
     dps:
+      - id: 119
+        type: boolean
+        name: available
       - id: 143
         type: boolean
         name: switch
@@ -185,6 +194,9 @@ entities:
     name: White
     category: config
     dps:
+      - id: 119
+        type: boolean
+        name: available
       - id: 107
         type: boolean
         name: switch
@@ -208,6 +220,9 @@ entities:
     name: Color
     category: config
     dps:
+      - id: 119
+        type: boolean
+        name: available
       - id: 108
         type: boolean
         name: switch