Skip to content

[en] Refactor HassLightSet using LLM TDD and new expansions #2783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions sentences/en/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ lists:
out: "fahrenheit"
brightness_level:
values:
- in: (max|maximum|highest)
- in: ([the] (max|maximum|highest) [(level|value|setting|brightness)]|full [(brightness|light)]|all the way up|as (bright|light) as possible)
out: 100
- in: (min|minimum|lowest)
- in: "[the] (half|halfway|mid) [(level|setting|brightness|bright|light|lit)]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The mid lit" doesn't sound right

Suggested change
- in: "[the] (half|halfway|mid) [(level|setting|brightness|bright|light|lit)]"
- in: "([the] (half|halfway|mid) [(level|setting|brightness|light)]|(half|halfway|mid) (bright|lit)"

out: 50
- in: ([the] (min|minimum|lowest) [(level|value|setting|brightness)]|all the way down|as (dim|dark) as possible)
out: 1
on_off_states:
values:
Expand Down Expand Up @@ -379,15 +381,16 @@ expansion_rules:
any: "(any|some) [of <the>]"
are_any: "[<are>] <any>"
how_many: "how many [of <the>]"
brightness: "{brightness}[([ ]%)| percent]"
brightness: "({brightness}[([ ]%)| percent] [(brightness|bright|light|lit)]|{brightness_level:brightness})"
light: "(light|lights|lighting|lamp|lamps)"
turn: "(turn|switch|change|bring)"
temp: "(temp|temperature)"
temperature: "{temperature}[([ ]°[[ ]{temperature_unit}])|( degrees {temperature_unit})]"
open: "(open|raise|lift) [up]"
close: "(close|shut|lower) [(up|down)]"
set: "(set|make|change|turn)"
numeric_value_set: "(set|change|turn [(up|down)]|increase|decrease|make)"
set: "(set|make|change|turn|adjust)"
numeric_value_set: "(set|change|turn [(up|down)]|increase|decrease|make|adjust)"
brightness_relative: "(brighten [up]|lighten [up]|dim [down]|darken [down])"
in: "(in|on|at|of|across|around|throughout)"
position: "{position}[([ ]%)| percent]"
volume: "{volume:volume_level}[([ ]%)| percent]"
Expand Down
124 changes: 59 additions & 65 deletions sentences/en/light_HassLightSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,97 +2,91 @@ language: "en"
intents:
HassLightSet:
data:
# brightness
- sentences:
- "[<numeric_value_set>] <name> brightness [to] <brightness>"
- "[<numeric_value_set>] [the] brightness [of] <name> [to] <brightness>"
- "[<numeric_value_set>] <name> [to] <brightness> [brightness]"
response: "brightness"
requires_context:
domain: light
################
## BRIGHTNESS ##
################

# Set device brightness
- sentences:
- "<numeric_value_set> <name> to <brightness>"
requires_context:
domain: "light"
response: "brightness"
- sentences:
- "[<numeric_value_set>] [the] brightness in <area> to <brightness>"
- "[<numeric_value_set>] [the] brightness of <area> to <brightness>"
- "[<numeric_value_set>] <area> brightness [to] <brightness>"
- "[<numeric_value_set>] <area> [to] <brightness> brightness"
- "[<numeric_value_set>] <area> [to] <brightness>"
- "[<numeric_value_set>] [(<all>|<the>)] <light> [<in>] <area> to <brightness> [brightness]"
response: "brightness"
- "[<numeric_value_set>] [<area_floor>] <name> [brightness] [to] <brightness>"
- "[<numeric_value_set>] <name> [brightness] [to] <brightness> <in_area_floor>"
- "[<numeric_value_set>] <name> <in_area_floor> [brightness] [to] <brightness>"

- sentences:
- "<numeric_value_set> <area> to <brightness>"
response: "brightness"
- "[<numeric_value_set>] [the] brightness [of] [<area_floor>] <name> [to] <brightness>"
- "[<numeric_value_set>] [the] brightness [of] <name> [to] <brightness> <in_area_floor>"
- "[<numeric_value_set>] [the] brightness [of] <name> <in_area_floor> [to] <brightness>"

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

# Max/Min brightness
- sentences:
- "[<numeric_value_set>] <name> brightness to [the] {brightness_level:brightness}"
- "[<numeric_value_set>] [the] brightness of <name> to [the] {brightness_level:brightness}"
- "[<numeric_value_set>] <name> [to] [the] {brightness_level:brightness} brightness"
requires_context:
domain: light
response: "brightness"

# Set area/floor brightness
- sentences:
- "[<numeric_value_set>] [the] brightness in <area> to [the] {brightness_level:brightness}"
- "[<numeric_value_set>] [the] brightness of <area> to [the] {brightness_level:brightness}"
- "[<numeric_value_set>] <area> brightness to [the] {brightness_level:brightness}"
- "[<numeric_value_set>] <area> [to] [the] {brightness_level:brightness} brightness"
- "[<numeric_value_set>] [(<all>|<the>)] <area_floor> [<light>] [brightness] [to] <brightness>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would match "living room 50%" which, again, may not necessarily mean brightness. It could mean fan speed, it could mean many more things. It's too ambiguous

- "[<numeric_value_set>] [[(<all>|<the>)] <light>] [brightness] [to] <brightness> <in_area_floor>"
- "[<numeric_value_set>] [(<all>|<the>)] <light> <in_area_floor> [brightness] [to] <brightness>"

- "[<numeric_value_set>] [the] brightness [of [(<all>|<the>)]] <in_area_floor> [<light>] [to] <brightness>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- "[<numeric_value_set>] [the] brightness [of [(<all>|<the>)]] <in_area_floor> [<light>] [to] <brightness>"
- "[<numeric_value_set>] [the] brightness [of [(<all>|<the>)]] <area_floor> [<light>] [to] <brightness>"

- "[<numeric_value_set>] [the] brightness [of [(<all>|<the>)]] <light> [to] <brightness> <in_area_floor>"
- "[<numeric_value_set>] [the] brightness [of [(<all>|<the>)]] <light> <in_area_floor> [to] <brightness>"

- "[<brightness_relative>] [(<all>|<the>)] <area_floor> [<light>] [to] <brightness>"
- "[<brightness_relative>] [[(<all>|<the>)] <light>] [to] <brightness> <in_area_floor>"
- "[<brightness_relative>] [(<all>|<the>)] <light> <in_area_floor> [to] <brightness>"
Comment on lines +36 to +38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With optional <brightness_relative>, these are the same sentences as above (with <numeric_value_set>. Remove the optional part.

response: "brightness"

# Set brightness in the current context
- 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"
- "[<numeric_value_set>] [the] brightness [of [(<all>|<the>)] <light>] [<here>] [to] <brightness>"
- "[<numeric_value_set>] [the] brightness [of [(<all>|<the>)] <light>] [to] <brightness> <here>"
- "[<numeric_value_set>] [(<all>|<the>)] <light> [brightness] [<here>] [to] <brightness>"
- "[<numeric_value_set>] [(<all>|<the>)] <light> [brightness] [to] <brightness> <here>"

- "[<brightness_relative>] [[(<all>|<the>)] <light>] [<here>] [to] <brightness>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch! "Hey Nabu... 70%" 😅 Definitely no!

- "[<brightness_relative>] [[(<all>|<the>)] <light>] [to] <brightness> <here>"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing, "70% here" is too vague.

response: "brightness"
requires_context:
area:
slot: true

# Floor support for brightness
- sentences:
- "[<numeric_value_set>] <floor> brightness [to] <brightness>"
response: "brightness"
###########
## COLOR ##
###########

# color
# Set device color
- sentences:
- "[<set>] <name> [color] [to] {color}"
- "[<set>] [[the] color of] <name> to {color}"
- "[<set>] [<area_floor>] <name> [color] [to] {color}"
- "[<set>] <name> [color] [to] {color} <in_area_floor>"
- "[<set>] <name> <in_area_floor> [color] [to] {color}"

- "[<set>] [the] color [of] [<area_floor>] <name> [to] {color}"
- "[<set>] [the] color [of] <name> [to] {color} <in_area_floor>"
- "[<set>] [the] color [of] <name> <in_area_floor> [to] {color}"
response: "color"
requires_context:
domain: light
response: "color"

# Set area/floor color
- sentences:
- "[<set>] [[the] color of] (<area> | [<all>] lights in <area> | [all] <area> lights) [to] {color}"
- "[<set>] (<area> | [all] lights in <area> | [all] <area> lights) [color] [to] {color}"
- "[<set>] <area_floor> [<light>] [color] [to] {color}"
- "[<set>] [[(<all>|<the>)] <light>] [color] [to] {color} <in_area_floor>"
- "[<set>] [(<all>|<the>)] <light> <in_area_floor> [color] [to] {color}"

- "[<set>] [the] color <in_area_floor> [<light>] [to] {color}"
- "[<set>] [the] color [of] [(<all>|<the>)] <light> [to] {color} <in_area_floor>"
- "[<set>] [the] color [of] [(<all>|<the>)] <light> <in_area_floor> [to] {color}"
response: "color"

# Set color in the current context
- sentences:
- "[<set>] [[the] color of] [(<all>|<the>)] <light> [to] {color}"
- "[<set>] [[the] color of] [(<all>|<the>)] <light> (<in_here>;[to] {color})"
expansion_rules:
in_here: "[in] here"
- "[<set>] [the] color [of [(<all>|<the>)] <light>] [<here>] [to] {color}"
- "[<set>] [the] color [of [(<all>|<the>)] <light>] [to] {color} <here>"
- "[<set>] [(<all>|<the>)] <light> [color] [<here>] [to] {color}"
- "[<set>] [(<all>|<the>)] <light> [color] [to] {color} <here>"
response: "color"
requires_context:
area:
slot: true

# Floor support for color
- sentences:
- "[<set>] <floor> [color] [to] {color}"
response: "color"
Loading
Loading