mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-10 02:46:38 +00:00
ZWaveJS: Add names to colors in Installer Settings (#22819)
This commit is contained in:
parent
cae5540c44
commit
b8a13dd6eb
@ -8,6 +8,18 @@ import "../../../../../../components/ha-circular-progress";
|
||||
import { extractApiErrorMessage } from "../../../../../../data/hassio/common";
|
||||
import "./zwave_js-capability-control-multilevel-switch";
|
||||
|
||||
enum ColorComponent {
|
||||
"Warm White" = 0,
|
||||
"Cold White",
|
||||
Red,
|
||||
Green,
|
||||
Blue,
|
||||
Amber,
|
||||
Cyan,
|
||||
Purple,
|
||||
Index,
|
||||
}
|
||||
|
||||
@customElement("zwave_js-capability-control-color_switch")
|
||||
class ZWaveJSCapabilityColorSwitch extends LitElement {
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
@ -20,7 +32,7 @@ class ZWaveJSCapabilityColorSwitch extends LitElement {
|
||||
|
||||
@property({ type: Number }) public version!: number;
|
||||
|
||||
@state() private _color_components?: number[];
|
||||
@state() private _color_components?: ColorComponent[];
|
||||
|
||||
@state() private _error?: string;
|
||||
|
||||
@ -37,7 +49,9 @@ class ZWaveJSCapabilityColorSwitch extends LitElement {
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.zwave_js.node_installer.capability_controls.color_switch.color_component"
|
||||
)}:
|
||||
${color}
|
||||
${this.hass.localize(
|
||||
`ui.panel.config.zwave_js.node_installer.capability_controls.color_switch.colors.${color}`
|
||||
)}
|
||||
</h5>
|
||||
<zwave_js-capability-control-multilevel_switch
|
||||
.hass=${this.hass}
|
||||
|
@ -5268,7 +5268,18 @@
|
||||
"control_failed": "Failed to control transition. {error}"
|
||||
},
|
||||
"color_switch": {
|
||||
"color_component": "Color component"
|
||||
"color_component": "Color component",
|
||||
"colors": {
|
||||
"0": "Warm White",
|
||||
"1": "Cold White",
|
||||
"2": "Red",
|
||||
"3": "Green",
|
||||
"4": "Blue",
|
||||
"5": "Amber",
|
||||
"6": "Cyan",
|
||||
"7": "Purple",
|
||||
"8": "Index"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user