Skip to content

Commit

Permalink
[EN] Improvement on how we turn on and off lights in a room and in th…
Browse files Browse the repository at this point in the history
…e whole house. (#2100)

* Turn off

* A few typos

* adding "all of"

* Turn on

* Update tests/en/light_HassTurnOn.yaml

Co-authored-by: Michael Hansen <mike@rhasspy.org>

* Update tests/en/light_HassTurnOn.yaml

Co-authored-by: Michael Hansen <mike@rhasspy.org>

* Update tests/en/light_HassTurnOn.yaml

Co-authored-by: Michael Hansen <mike@rhasspy.org>

* Update tests/en/light_HassTurnOff.yaml

Co-authored-by: Michael Hansen <mike@rhasspy.org>

* Update tests/en/light_HassTurnOff.yaml

Co-authored-by: Michael Hansen <mike@rhasspy.org>

* Update tests/en/light_HassTurnOff.yaml

Co-authored-by: Michael Hansen <mike@rhasspy.org>

* Update tests/en/light_HassTurnOn.yaml

Co-authored-by: Michael Hansen <mike@rhasspy.org>

* Update tests/en/light_HassTurnOn.yaml

Co-authored-by: Michael Hansen <mike@rhasspy.org>

* Update tests/en/light_HassTurnOn.yaml

Co-authored-by: Michael Hansen <mike@rhasspy.org>

* Update tests/en/light_HassTurnOff.yaml

Co-authored-by: Michael Hansen <mike@rhasspy.org>

* Update tests/en/light_HassTurnOn.yaml

Co-authored-by: Michael Hansen <mike@rhasspy.org>

* Update tests/en/light_HassTurnOff.yaml

Co-authored-by: Michael Hansen <mike@rhasspy.org>

* Update tests/en/light_HassTurnOff.yaml

Co-authored-by: Michael Hansen <mike@rhasspy.org>

---------

Co-authored-by: Michael Hansen <mike@rhasspy.org>
  • Loading branch information
jlpouffier and synesthesiam authored Mar 27, 2024
1 parent a48b4b1 commit a8dfbb0
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 50 deletions.
1 change: 1 addition & 0 deletions responses/en/HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ responses:
HassTurnOn:
default: "Turned on the {{ state.domain }}"
lights_area: "Turned on the lights"
light_all: "Turned on all of the lights"
fans_area: "Turned on the fans"
cover: "Opened"
cover_device_class: "Opened the {{ slots.device_class }}"
Expand Down
6 changes: 6 additions & 0 deletions sentences/en/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,12 @@ expansion_rules:
position: "{position}[[ ]%| percent]"
volume: "{volume:volume_level}[[ ]%| percent]"

# Context awareness expansion rules
all: "(all|all of|every|every single|each|each and every)"
home: "(home|house|appartment|flat)"
everywhere: "(everywhere|in all [the] rooms|in every room[s]|in each room|in the <home>)"
here: "(here|in here|in this room|in the room)"

# Questions
what_is_the_class_of_name: "(<what_is> the <class> (of|in|from|(indicated|measured) by) <name> [in <area>]|<what_is> <name>['s] <class> [in <area>]|<what_is> <area> <name>['s] <class>)"
skip_words:
Expand Down
29 changes: 21 additions & 8 deletions sentences/en/light_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,35 @@ intents:
domain: "light"
response: "lights_area"

# Turn off all lights in the home
- sentences:
- "[<turn>] (all <light> off|<light> off everywhere)"
- "deactivate (all <light>|<light> everywhere)"
- "<turn> <all> <light> off <everywhere>"
- "<turn> off <all> <light> <everywhere>"
- "deactivate <all> <light> <everywhere>"
- "<turn> <light> off <everywhere>"
- "<turn> off <light> <everywhere>"
- "deactivate <light> <everywhere>"
- "<turn> <all> <light> off"
- "<turn> off <all> <light>"
- "deactivate <all> <light>"
response: "light_all"
slots:
domain: "light"
name: "all"

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

# Turn on all lights in the same area as a satellite device
# Turn on all lights in the home
- sentences:
- "<turn> on[ all] <light>[<in_here>]"
- "<turn>[ all] <light>( on;<in_here>)"
- "<turn>[ all] <light> on"
- "<turn> <all> <light> on <everywhere>"
- "<turn> on <all> <light> <everywhere>"
- "activate <all> <light> <everywhere>"
- "<turn> <light> on <everywhere>"
- "<turn> on <light> <everywhere>"
- "activate <light> <everywhere>"
- "<turn> <all> <light> on"
- "<turn> on <all> <light>"
- "activate <all> <light>"
response: "light_all"
slots:
domain: "light"

# Turn on lights in the same area as a satellite device
- sentences:
- "<turn> <all> <light> on <here>"
- "<turn> <light> on <here>"
- "<turn> <all> <light> <here> on"
- "<turn> <light> <here> on"
- "<turn> on <all> <light> <here>"
- "<turn> on <light> <here>"
- "activate <all> <light> <here>"
- "activate <light> <here>"
- "<turn> <light> on"
- "<turn> on <light>"
- "activate <light>"
response: "lights_area"
expansion_rules:
in_here: "[ in] here"
slots:
domain: "light"
requires_context:
Expand Down
48 changes: 25 additions & 23 deletions tests/en/light_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,39 @@ tests:
domain: light
response: "Turned off the lights"

# Turn off all lights in the home
- sentences:
- Turn the lights off everywhere
- Turn all lights off in the appartment
- Switch off every light in the home
- Deactivate each and every lights everywhere
- Turn the lights off in the house
- Switch off the lights in every room
- Deactivate the lights in the home
- Turn all lights off
- Turn off every light
- Deactivate each light
- Turn the lights off in all the rooms
- Turn all lighting off
- Deactivate all lights
- Deactivate lights everywhere
- Deactivate every single light
- Deactivate lights in each room
intent:
name: HassTurnOff
slots:
domain: light
name: all

# Turn off lights in the same area as a satellite device
- sentences:
- "turn off the lights"
- "turn off the lights in here"
- "turn the lights in here off"
- "turn the lights off here"
intent:
name: HassTurnOff
context:
area: Living Room
slots:
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"
- Turn every light off in this room
- Turn the lights off here
- Turn every light in here off
- Turn the lights in here off
- Switch off each and every light in the room
- Switch off the lights in this room
- Deactivate all the lights here
- Deactivate the lights in this room
- Turn the lights off
- Turn off the lights
- Deactivate the lights
intent:
name: HassTurnOff
context:
Expand Down
39 changes: 26 additions & 13 deletions tests/en/light_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,39 @@ tests:
domain: light
response: "Turned on the lights"

# Turn on all lights in the home
- sentences:
- "turn on the lights"
- "turn on the lights in here"
- "turn the lights in here on"
- "turn the lights on here"
- Turn all lights on in the appartment
- Switch on every light in the home
- Activate each and every light everywhere
- Turn the lights on in the house
- Switch on the lights in every room
- Activate the lights in the home
- Turn all lights on
- Turn on every light
- Activate each light
- Turn the lights on in all the rooms
- Turn all lighting on
- Activate every single light
- Activate lights in each room
intent:
name: HassTurnOn
context:
area: Living Room
slots:
domain: light
area: Living Room
response: "Turned on the lights"

# Turn on lights in the same area as a satellite device
- 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"
- Turn every light on in this room
- Turn the lights on here
- Turn every light in here on
- Turn the lights in here on
- Switch on each and every light in the room
- Switch on the lights in this room
- Activate all the lights here
- Activate the lights in this room
- Turn the lights on
- Turn on the lights
- Activate the lights
intent:
name: HassTurnOn
context:
Expand Down

0 comments on commit a8dfbb0

Please sign in to comment.