Kaynağa Gözat

fix (thermex_if50v_waterheater): revert removal of default marking

Although I thought at the time default was only used by siren.turn_on,
it turns out to also be used for water_heater.turn_away_mode_off when
away mode is mixed in with other modes. Luckily a unit test was
implemented to catch this erroneous change, though it was only
triggered after a python change.
Jason Rumney 2 ay önce
ebeveyn
işleme
772bf83dec

+ 5 - 1
custom_components/tuya_local/devices/device_config_schema.json

@@ -314,7 +314,7 @@
                                             },
                                             "default": {
                                                 "type": "boolean",
-                                                "description": "true if this mapping should be used as the default when no value was specified. Currently used only for a siren entity tone dp when there is no switch dp and the turn_on action is called without arguments."
+                                                "description": "true if this mapping should be used as the default when no value was specified. Currently used only for a siren entity tone dp when there is no switch dp and the turn_on action is called without arguments, or for a water_heater entity when switching out of away mode and away is implemented as a normal mode in the device."
                                             },
                                             "hidden": {
                                                 "type": "boolean",
@@ -375,6 +375,10 @@
                                                             "required": ["min", "max"],
                                                             "additionalProperties": false
                                                         },
+                                                        "default": {
+                                                            "type": "boolean",
+                                                            "description": "true if this mapping should be used as the default when no value was specified. Currently used only for a siren entity tone dp when there is no switch dp and the turn_on action is called without arguments, or for a water_heater entity when switching out of away mode and away is implemented as a normal mode in the device."
+                                                        },
                                                         "scale": {
                                                             "type": "number",
                                                             "description": "An optional scale to apply when this mapping is matched.",

+ 1 - 0
custom_components/tuya_local/devices/thermex_if50v_waterheater.yaml

@@ -22,6 +22,7 @@ entities:
                 value: eco
               - dps_val: "2"
                 value: electric
+                default: true
               - dps_val: "4"
                 value: away
               - dps_val: "1"