feat(hass): restrict input_text to percentage values
This commit is contained in:
parent
dcd4e56e7a
commit
9ce5b7e8a5
1 changed files with 9 additions and 5 deletions
|
@ -124,12 +124,16 @@ in {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
# TODO: restrict to 0-100
|
config.input_text = let
|
||||||
config.input_text = {
|
mkPercentInput = name: {
|
||||||
bathroom_light_brightness = {
|
inherit name;
|
||||||
name = "BathroomLightBrightness";
|
# restricts to 0-100
|
||||||
pattern = "[0-9]*";
|
pattern = "^(0|[1-9][0-9]?|100)$";
|
||||||
|
initial = "0";
|
||||||
|
max = 3;
|
||||||
};
|
};
|
||||||
|
in {
|
||||||
|
bathroom_light_brightness = mkPercentInput "BathroomLightBrightness";
|
||||||
};
|
};
|
||||||
|
|
||||||
lovelaceConfig = {
|
lovelaceConfig = {
|
||||||
|
|
Loading…
Reference in a new issue