Remove deprecated color_mode flag, adjust brightness description for MQTT json light (#31707)

* Remove deprecated `color_mode` flag, adjust `brightness` description

* tiny tweak

---------

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
Jan Bouwhuis 2024-03-05 10:15:44 +01:00 committed by GitHub
parent c67a7d846d
commit dbe598959f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,7 +40,7 @@ When a state topic is not available, the light will work in optimistic mode. In
Optimistic mode can be forced, even if the `state_topic` is available. Try to enable it, if experiencing incorrect light operation.
Home Assistant internally assumes that a light's state corresponds to a defined `color_mode`.
The state of MQTT lights with default schema and support for both color and color temperature will set the `color_mode` according to the last received valid color or color temperature. Optionally, a `color_mode_state_topic` can be configured for explicit control of the `color_mode`
The state of MQTT lights with default schema and support for both color and color temperature will set the `color_mode` according to the last received valid color or color temperature. Optionally, a `color_mode_state_topic` can be configured for explicit control of the `color_mode`.
```yaml
# Example configuration.yaml entry
@ -563,7 +563,7 @@ availability_topic:
required: false
type: string
brightness:
description: Flag that defines if the light supports brightness.
description: Flag that defines if light supports brightness when the `rgb`, `rgbw`, or `rgbww` color mode is supported.
required: false
type: boolean
default: false
@ -572,11 +572,6 @@ brightness_scale:
required: false
type: integer
default: 255
color_mode:
description: Flag that defines if the light supports color modes.
required: false
type: boolean
default: false
command_topic:
description: The MQTT topic to publish commands to change the lights state.
required: true
@ -715,7 +710,7 @@ state_topic:
required: false
type: string
supported_color_modes:
description: A list of color modes supported by the list. This is required if `color_mode` is `True`. Possible color modes are `onoff`, `brightness`, `color_temp`, `hs`, `xy`, `rgb`, `rgbw`, `rgbww`, `white`. Note that if `onoff` **or** `brightness` are used, that must be the _only_ value in the list.
description: A list of color modes supported by the list. Possible color modes are `onoff`, `brightness`, `color_temp`, `hs`, `xy`, `rgb`, `rgbw`, `rgbww`, `white`. Note that if `onoff` **or** `brightness` are used, that must be the _only_ value in the list.
required: false
type: list
unique_id:
@ -758,7 +753,6 @@ mqtt:
state_topic: "home/rgb1"
command_topic: "home/rgb1/set"
brightness: true
color_mode: true
supported_color_modes: ["rgb"]
```
@ -775,7 +769,6 @@ mqtt:
state_topic: "home/rgb1"
command_topic: "home/rgb1/set"
brightness: true
color_mode: true
supported_color_modes: ["brightness"]
```
@ -793,7 +786,6 @@ mqtt:
command_topic: "home/light/set"
brightness: true
brightness_scale: 4095
color_mode: true
supported_color_modes: ["brightness"]
```
@ -817,7 +809,6 @@ mqtt:
name: mqtt_json_hs_light
state_topic: "home/light"
command_topic: "home/light/set"
color_mode: true
supported_color_modes: ["hs"]
```
@ -847,7 +838,6 @@ mqtt:
state_topic: "home/rgbw1"
command_topic: "home/rgbw1/set"
brightness: true
color_mode: true
supported_color_modes: ["rgbw"]
```