Skip to content

Commit

Permalink
[EN] Context area aware intents
Browse files Browse the repository at this point in the history
  • Loading branch information
tetele committed Jan 4, 2024
1 parent 36c5f5c commit f5d461d
Show file tree
Hide file tree
Showing 14 changed files with 212 additions and 6 deletions.
11 changes: 11 additions & 0 deletions sentences/en/cover_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,14 @@ intents:
slots:
domain: cover
response: cover_device_class

- sentences:
- "<close> [the] {cover_classes:device_class}[<in_here>]"
expansion_rules:
in_here: "[ in] here"
slots:
domain: cover
response: cover_device_class
requires_context:
area:
slot: true
11 changes: 11 additions & 0 deletions sentences/en/cover_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,14 @@ intents:
slots:
domain: cover
response: cover_device_class

- sentences:
- "<open> [the] {cover_classes:device_class}[<in_here>]"
expansion_rules:
in_here: "[ in] here"
slots:
domain: cover
response: cover_device_class
requires_context:
area:
slot: true
13 changes: 13 additions & 0 deletions sentences/en/fan_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,16 @@ intents:
slots:
domain: "fan"
name: "all"

- sentences:
- "<turn> off[ all][ the] fan[s][<in_here>]"
- "<turn>[ all][ the] fan[s]( off;<in_here>)"
- "<turn>[ all][ the] fan[s] off"
response: "fans_area"
expansion_rules:
in_here: "[ in] here"
slots:
domain: fan
requires_context:
area:
slot: true
13 changes: 13 additions & 0 deletions sentences/en/fan_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,16 @@ intents:
domain: "fan"
name: "all"
response: fans_area

- sentences:
- "<turn> on[ all][ the] fan[s][<in_here>]"
- "<turn>[ all][ the] fan[s]( on;<in_here>)"
- "<turn>[ all][ the] fan[s] on"
response: "fans_area"
expansion_rules:
in_here: "[ in] here"
slots:
domain: fan
requires_context:
area:
slot: true
30 changes: 30 additions & 0 deletions sentences/en/light_HassLightSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ intents:
name: "all"
response: "brightness"

- sentences:
- "[<numeric_value_set>] [the] brightness to <brightness>"
- "[<numeric_value_set>] [the] brightness (<in_here>;to <brightness>)"
expansion_rules:
in_here: "[ in] here"
response: "brightness"
requires_context:
area:
slot: true

# Max/Min brightness
- sentences:
- "[<numeric_value_set>] <name> brightness to [the] {brightness_level:brightness}"
Expand All @@ -51,6 +61,16 @@ intents:
name: "all"
response: "brightness"

- sentences:
- "[<numeric_value_set>] [the] brightness to [the] {brightness_level:brightness}"
- "[<numeric_value_set>] [the] brightness (<in_here>;to [the] {brightness_level:brightness})"
expansion_rules:
in_here: "[ in] here"
response: "brightness"
requires_context:
area:
slot: true

# color
- sentences:
- "[<set>] <name> [color] [to] {color}"
Expand All @@ -64,3 +84,13 @@ intents:
slots:
name: "all"
response: "color"

- sentences:
- "[<set>] [[the] color of] [all] <light> [to] {color}"
- "[<set>] [[the] color of] [all] <light> (<in_here>;[to] {color})"
expansion_rules:
in_here: "[ in] here"
response: "color"
requires_context:
area:
slot: true
7 changes: 4 additions & 3 deletions sentences/en/light_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ intents:

# Turn off lights in the same area as a satellite device
- sentences:
- "<turn> off[ the] lights<in_here>"
- "<turn>[ the] lights( off;<in_here>)"
- "<turn> off[ all] <light>[<in_here>]"
- "<turn>[ all] <light>( off;<in_here>)"
- "<turn>[ all] <light> off"
response: "lights_area"
expansion_rules:
in_here: "[[ in] here]"
in_here: "[ in] here"
slots:
domain: "light"
requires_context:
Expand Down
7 changes: 4 additions & 3 deletions sentences/en/light_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ intents:

# Turn on all lights in the same area as a satellite device
- sentences:
- "<turn> on[ the] lights<in_here>"
- "<turn>[ the] lights( on;<in_here>)"
- "<turn> on[ all] <light>[<in_here>]"
- "<turn>[ all] <light>( on;<in_here>)"
- "<turn>[ all] <light> on"
response: "lights_area"
expansion_rules:
in_here: "[[ in] here]"
in_here: "[ in] here"
slots:
domain: "light"
requires_context:
Expand Down
13 changes: 13 additions & 0 deletions tests/en/cover_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,16 @@ tests:
area: Bedroom
domain: cover
device_class: blind

- sentences:
- "close the curtains"
- "close the curtains in here"
intent:
name: HassTurnOff
context:
area: Living Room
slots:
domain: cover
area: Living Room
device_class: curtain
response: "Closed curtains"
14 changes: 14 additions & 0 deletions tests/en/cover_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,17 @@ tests:
domain: cover
device_class: blind
response: "Opened the blinds"

- sentences:
- "open the curtains"
- "open the curtains in here"
intent:
name: HassTurnOn
context:
area: Living Room
slots:
domain: cover
area: Living Room
device_class: curtain
response: "Opened the curtains"

15 changes: 15 additions & 0 deletions tests/en/fan_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,18 @@ tests:
slots:
domain: fan
name: all

- sentences:
- "turn off all the fans"
- "turn off the fans in here"
- "turn all the fans off in here"
- "turn the fans here off"
- "turn the fans off"
intent:
name: HassTurnOff
context:
area: Living Room
slots:
domain: fan
area: Living Room
response: "Turned off fans"
15 changes: 15 additions & 0 deletions tests/en/fan_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,18 @@ tests:
domain: fan
name: all
response: Turned on the fans

- sentences:
- "turn on all the fans"
- "turn on the fans in here"
- "turn all the fans on in here"
- "turn the fans here on"
- "turn the fans on"
intent:
name: HassTurnOn
context:
area: Living Room
slots:
domain: fan
area: Living Room
response: "Turned on the fans"
39 changes: 39 additions & 0 deletions tests/en/light_HassLightSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ tests:
name: all
response: "Brightness set"

- sentences:
- "set the brightness to 50%"
- "change the brightness in here to 50 percent"
- "turn brightness to 50% in here"
intent:
name: HassLightSet
context:
area: Bedroom
slots:
brightness: 50
area: Bedroom
response: "Brightness set"

- sentences:
- "set the bedroom lamp brightness to max"
- "change the brightness of bedroom lamp to the highest"
Expand Down Expand Up @@ -88,6 +101,19 @@ tests:
name: all
response: "Brightness set"

- sentences:
- "set the brightness to the max"
- "change the brightness in here to highest"
- "turn brightness to maximum in here"
intent:
name: HassLightSet
context:
area: Bedroom
slots:
brightness: 100
area: Bedroom
response: "Brightness set"

# color
- sentences:
- "set the bedroom lamp color to red"
Expand Down Expand Up @@ -117,3 +143,16 @@ tests:
area: Bedroom
name: all
response: "Color set"

- sentences:
- "make the lights red"
- "set the color of all lights in here to red"
- "make all the lights red in here"
intent:
name: HassLightSet
context:
area: Bedroom
slots:
color: red
area: Bedroom
response: "Color set"
15 changes: 15 additions & 0 deletions tests/en/light_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,18 @@ tests:
domain: light
area: Living Room
response: "Turned off the lights"

- sentences:
- "turn off all the lights"
- "turn off the light in here"
- "turn all the lighting off in here"
- "turn the light here off"
- "turn the lights off"
intent:
name: HassTurnOff
context:
area: Living Room
slots:
domain: light
area: Living Room
response: "Turned off the lights"
15 changes: 15 additions & 0 deletions tests/en/light_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,18 @@ tests:
domain: light
area: Living Room
response: "Turned on the lights"

- sentences:
- "turn on all the lights"
- "turn on the light in here"
- "turn all the lighting on in here"
- "turn the light here on"
- "turn the lights on"
intent:
name: HassTurnOn
context:
area: Living Room
slots:
domain: light
area: Living Room
response: "Turned on the lights"

0 comments on commit f5d461d

Please sign in to comment.