Skip to content

Commit 7d3b0fc

Browse files
committed
[en] Refactor HassLightSet using LLM TDD and new expansions
This should make the matching more robust and much easier to manage.
1 parent 3a845a1 commit 7d3b0fc

File tree

3 files changed

+119
-122
lines changed

3 files changed

+119
-122
lines changed

sentences/en/_common.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,11 @@ lists:
7474
out: "fahrenheit"
7575
brightness_level:
7676
values:
77-
- in: (max|maximum|highest)
77+
- in: (max|maximum|highest|full|all the way up|as (bright|light) as possible)
7878
out: 100
79-
- in: (min|minimum|lowest)
79+
- in: (half|halfway|mid)
80+
out: 50
81+
- in: (min|minimum|lowest|all the way down|as (dim|dark) as possible)
8082
out: 1
8183
on_off_states:
8284
values:
@@ -379,15 +381,16 @@ expansion_rules:
379381
any: "(any|some) [of <the>]"
380382
are_any: "[<are>] <any>"
381383
how_many: "how many [of <the>]"
382-
brightness: "{brightness}[([ ]%)| percent]"
384+
brightness: "({brightness}[([ ]%)| percent]|[the] {brightness_level:brightness} [(level|value|setting)]) [(brightness|bright|light)]"
383385
light: "(light|lights|lighting|lamp|lamps)"
384386
turn: "(turn|switch|change|bring)"
385387
temp: "(temp|temperature)"
386388
temperature: "{temperature}[([ ]°[[ ]{temperature_unit}])|( degrees {temperature_unit})]"
387389
open: "(open|raise|lift) [up]"
388390
close: "(close|shut|lower) [(up|down)]"
389-
set: "(set|make|change|turn)"
390-
numeric_value_set: "(set|change|turn [(up|down)]|increase|decrease|make)"
391+
set: "(set|make|change|turn|adjust)"
392+
numeric_value_set: "(set|change|turn [(up|down)]|increase|decrease|make|adjust)"
393+
brightness_value_set: "(<numeric_value_set>|(brighten [up]|lighten [up]|brighten [up]|dim [down]|darken [down]))"
391394
in: "(in|on|at|of|across|around|throughout)"
392395
position: "{position}[([ ]%)| percent]"
393396
volume: "{volume:volume_level}[([ ]%)| percent]"

sentences/en/light_HassLightSet.yaml

Lines changed: 48 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -2,97 +2,80 @@ language: "en"
22
intents:
33
HassLightSet:
44
data:
5-
# brightness
5+
################
6+
## BRIGHTNESS ##
7+
################
8+
9+
# Set device brightness
610
- sentences:
7-
- "[<numeric_value_set>] <name> brightness [to] <brightness>"
8-
- "[<numeric_value_set>] [the] brightness [of] <name> [to] <brightness>"
9-
- "[<numeric_value_set>] <name> [to] <brightness> [brightness]"
11+
- "[<brightness_value_set>] [<area_floor>] <name> [brightness] [to] <brightness>"
12+
- "[<brightness_value_set>] <name> [brightness] [to] <brightness> <in_area_floor>"
13+
- "[<brightness_value_set>] <name> <in_area_floor> [brightness] [to] <brightness>"
14+
15+
- "[<brightness_value_set>] [the] brightness [of] [<area_floor>] <name> [to] <brightness>"
16+
- "[<brightness_value_set>] [the] brightness [of] <name> [to] <brightness> <in_area_floor>"
17+
- "[<brightness_value_set>] [the] brightness [of] <name> <in_area_floor> [to] <brightness>"
1018
response: "brightness"
1119
requires_context:
1220
domain: light
1321

22+
# Set area/floor brightness
1423
- sentences:
15-
- "<numeric_value_set> <name> to <brightness>"
16-
requires_context:
17-
domain: "light"
18-
response: "brightness"
19-
- sentences:
20-
- "[<numeric_value_set>] [the] brightness in <area> to <brightness>"
21-
- "[<numeric_value_set>] [the] brightness of <area> to <brightness>"
22-
- "[<numeric_value_set>] <area> brightness [to] <brightness>"
23-
- "[<numeric_value_set>] <area> [to] <brightness> brightness"
24-
- "[<numeric_value_set>] <area> [to] <brightness>"
25-
- "[<numeric_value_set>] [(<all>|<the>)] <light> [<in>] <area> to <brightness> [brightness]"
26-
response: "brightness"
24+
- "[<brightness_value_set>] [(<all>|<the>)] <area_floor> [<light>] [brightness] [to] <brightness>"
25+
- "[<brightness_value_set>] [[(<all>|<the>)] <light>] [brightness] [to] <brightness> <in_area_floor>"
26+
- "[<brightness_value_set>] [(<all>|<the>)] <light> <in_area_floor> [brightness] [to] <brightness>"
2727

28-
- sentences:
29-
- "<numeric_value_set> <area> to <brightness>"
28+
- "[<brightness_value_set>] [the] brightness [of [(<all>|<the>)]] <in_area_floor> [<light>] [to] <brightness>"
29+
- "[<brightness_value_set>] [the] brightness [of [(<all>|<the>)]] <light> [to] <brightness> <in_area_floor>"
30+
- "[<brightness_value_set>] [the] brightness [of [(<all>|<the>)]] <light> <in_area_floor> [to] <brightness>"
3031
response: "brightness"
3132

33+
# Set brightness in the current context
3234
- sentences:
33-
- "[<numeric_value_set>] [the] brightness to <brightness>"
34-
- "[<numeric_value_set>] [the] brightness (<in_here>;to <brightness>)"
35-
expansion_rules:
36-
in_here: "[in] here"
35+
- "[<brightness_value_set>] [the] brightness [of [(<all>|<the>)] <light>] [<here>] [to] <brightness>"
36+
- "[<brightness_value_set>] [the] brightness [of [(<all>|<the>)] <light>] [to] <brightness> <here>"
37+
- "[<brightness_value_set>] [(<all>|<the>)] <light> [brightness] [<here>] [to] <brightness>"
38+
- "[<brightness_value_set>] [(<all>|<the>)] <light> [brightness] [to] <brightness> <here>"
3739
response: "brightness"
3840
requires_context:
3941
area:
4042
slot: true
4143

42-
# Max/Min brightness
43-
- sentences:
44-
- "[<numeric_value_set>] <name> brightness to [the] {brightness_level:brightness}"
45-
- "[<numeric_value_set>] [the] brightness of <name> to [the] {brightness_level:brightness}"
46-
- "[<numeric_value_set>] <name> [to] [the] {brightness_level:brightness} brightness"
47-
requires_context:
48-
domain: light
49-
response: "brightness"
44+
###########
45+
## COLOR ##
46+
###########
5047

48+
# Set device color
5149
- sentences:
52-
- "[<numeric_value_set>] [the] brightness in <area> to [the] {brightness_level:brightness}"
53-
- "[<numeric_value_set>] [the] brightness of <area> to [the] {brightness_level:brightness}"
54-
- "[<numeric_value_set>] <area> brightness to [the] {brightness_level:brightness}"
55-
- "[<numeric_value_set>] <area> [to] [the] {brightness_level:brightness} brightness"
56-
response: "brightness"
50+
- "[<set>] [<area_floor>] <name> [color] [to] {color}"
51+
- "[<set>] <name> [color] [to] {color} <in_area_floor>"
52+
- "[<set>] <name> <in_area_floor> [color] [to] {color}"
5753

58-
- sentences:
59-
- "[<numeric_value_set>] [the] brightness to [the] {brightness_level:brightness}"
60-
- "[<numeric_value_set>] [the] brightness (<in_here>;to [the] {brightness_level:brightness})"
61-
expansion_rules:
62-
in_here: "[in] here"
63-
response: "brightness"
54+
- "[<set>] [the] color [of] [<area_floor>] <name> [to] {color}"
55+
- "[<set>] [the] color [of] <name> [to] {color} <in_area_floor>"
56+
- "[<set>] [the] color [of] <name> <in_area_floor> [to] {color}"
57+
response: "color"
6458
requires_context:
65-
area:
66-
slot: true
59+
domain: light
6760

68-
# Floor support for brightness
61+
# Set area/floor color
6962
- sentences:
70-
- "[<numeric_value_set>] <floor> brightness [to] <brightness>"
71-
response: "brightness"
63+
- "[<set>] <area_floor> [<light>] [color] [to] {color}"
64+
- "[<set>] [[(<all>|<the>)] <light>] [color] [to] {color} <in_area_floor>"
65+
- "[<set>] [(<all>|<the>)] <light> <in_area_floor> [color] [to] {color}"
7266

73-
# color
74-
- sentences:
75-
- "[<set>] <name> [color] [to] {color}"
76-
- "[<set>] [[the] color of] <name> to {color}"
77-
requires_context:
78-
domain: light
79-
response: "color"
80-
- sentences:
81-
- "[<set>] [[the] color of] (<area> | [<all>] lights in <area> | [all] <area> lights) [to] {color}"
82-
- "[<set>] (<area> | [all] lights in <area> | [all] <area> lights) [color] [to] {color}"
67+
- "[<set>] [the] color <in_area_floor> [<light>] [to] {color}"
68+
- "[<set>] [the] color [of] [(<all>|<the>)] <light> [to] {color} <in_area_floor>"
69+
- "[<set>] [the] color [of] [(<all>|<the>)] <light> <in_area_floor> [to] {color}"
8370
response: "color"
8471

72+
# Set color in the current context
8573
- sentences:
86-
- "[<set>] [[the] color of] [(<all>|<the>)] <light> [to] {color}"
87-
- "[<set>] [[the] color of] [(<all>|<the>)] <light> (<in_here>;[to] {color})"
88-
expansion_rules:
89-
in_here: "[in] here"
74+
- "[<set>] [the] color [of [(<all>|<the>)] <light>] [<here>] [to] {color}"
75+
- "[<set>] [the] color [of [(<all>|<the>)] <light>] [to] {color} <here>"
76+
- "[<set>] [(<all>|<the>)] <light> [color] [<here>] [to] {color}"
77+
- "[<set>] [(<all>|<the>)] <light> [color] [to] {color} <here>"
9078
response: "color"
9179
requires_context:
9280
area:
9381
slot: true
94-
95-
# Floor support for color
96-
- sentences:
97-
- "[<set>] <floor> [color] [to] {color}"
98-
response: "color"

0 commit comments

Comments
 (0)