-
Notifications
You must be signed in to change notification settings - Fork 529
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
[EN] Enhanced get state sentences for media_player
#2230
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -128,6 +128,16 @@ lists: | |||||
out: "locked" | ||||||
- in: "unlocked" | ||||||
out: "unlocked" | ||||||
media_player_states: | ||||||
values: | ||||||
- in: "[turned ]off" | ||||||
out: "off" | ||||||
- in: "(idle|standing by)" | ||||||
out: ["on", "idle", "standby", "buffering"] | ||||||
- in: "(playing|[turned ]on)" | ||||||
out: "playing" | ||||||
- in: "paused" | ||||||
out: "paused" | ||||||
|
||||||
# binary_sensor | ||||||
bs_battery_states: | ||||||
|
@@ -372,6 +382,7 @@ expansion_rules: | |||||
in: "(in|on|at|of)" | ||||||
position: "{position}[[ ]%| percent]" | ||||||
volume: "{volume:volume_level}[[ ]%| percent]" | ||||||
media_players: "([media ]player[s]|speaker[s]stereo[s]|tv[s])" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing a
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed regarding |
||||||
|
||||||
# Context awareness expansion rules | ||||||
all: "(all|all of|every|every single|each|each and every)" | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
language: en | ||
intents: | ||
HassGetState: | ||
data: | ||
- sentences: | ||
- is [the ][state of ]<name> [turned ]on[ in <area>] | ||
slots: | ||
actual_state: "on" | ||
alternate_state: | ||
"on": "in an unknown state" | ||
idle: "not playing" | ||
standby: "in standby" | ||
Comment on lines
+8
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe these should actually be |
||
response: alternate_state | ||
requires_context: | ||
domain: media_player | ||
excludes_context: | ||
state: | ||
- "playing" | ||
- "off" | ||
|
||
- sentences: | ||
- is [the ][state of ]<name> [turned ]off[ in <area>] | ||
slots: | ||
state: | ||
- "on" | ||
- "idle" | ||
- "paused" | ||
- "standby" | ||
- "buffering" | ||
actual_state: "not off" | ||
alternate_state: | ||
"on": "in an unknown state" | ||
idle: "not playing anything" | ||
standby: "in standby" | ||
response: alternate_state | ||
requires_context: | ||
domain: media_player | ||
|
||
- sentences: | ||
- is [the] [state of] <name> {media_player_states:state} [in <area>] | ||
response: one_yesno | ||
requires_context: | ||
domain: media_player | ||
|
||
- sentences: | ||
- (is|are) [there] any <media_players> {media_player_states:state} [in <area>] | ||
- (do you know|tell me) if there are any <media_players> {media_player_states:state} [in <area>] | ||
slots: | ||
domain: media_player | ||
response: any | ||
- sentences: | ||
- (is|are) [there] any <media_players> {media_player_states:state} [in <area>] | ||
- (do you know|tell me) if there are any <media_players> {media_player_states:state} [in <area>] | ||
slots: | ||
domain: media_player | ||
response: any | ||
|
||
- sentences: | ||
- are all [the] <media_players> {media_player_states:state} [in <area>] | ||
- are all [the] <media_players> in <area> {media_player_states:state} | ||
slots: | ||
domain: media_player | ||
response: all | ||
|
||
- sentences: | ||
- "[do you know] (which|what) <media_players> (is|are) {media_player_states:state} [in <area>]" | ||
slots: | ||
domain: media_player | ||
response: which | ||
|
||
- sentences: | ||
- "[tell me] how many <media_players> (is|are) {media_player_states:state} [in <area>]" | ||
slots: | ||
domain: media_player | ||
response: how_many |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
language: en | ||
Check failure on line 1 in tests/en/media_player_HassGetState.yaml GitHub Actions / build
|
||
tests: | ||
- sentences: | ||
- "is the TV on?" | ||
intent: | ||
name: HassGetState | ||
slots: | ||
name: "TV" | ||
actual_state: "on" | ||
alternate_state: | ||
"on": "in an unknown state" | ||
idle: "not playing" | ||
standby: "in standby" | ||
context: | ||
domain: media_player | ||
volume_level: "50" | ||
response: "Tv is on, but it is not playing" | ||
|
||
- sentences: | ||
- "is the TV off?" | ||
intent: | ||
name: HassGetState | ||
slots: | ||
name: "TV" | ||
state: | ||
- "on" | ||
- "idle" | ||
- "paused" | ||
- "standby" | ||
- "buffering" | ||
actual_state: "not off" | ||
alternate_state: | ||
"on": "in an unknown state" | ||
idle: "not playing anything" | ||
standby: "in standby" | ||
context: | ||
domain: media_player | ||
volume_level: "50" | ||
response: "Tv is not off, but it is not playing anything" | ||
|
||
- sentences: | ||
- "is the TV playing?" | ||
intent: | ||
name: HassGetState | ||
slots: | ||
name: "TV" | ||
state: "playing" | ||
context: | ||
domain: media_player | ||
volume_level: "50" | ||
response: "No, idle" | ||
|
||
- sentences: | ||
- "is the TV standing by?" | ||
intent: | ||
name: HassGetState | ||
slots: | ||
name: "TV" | ||
state: | ||
- "on" | ||
- "idle" | ||
- "standby" | ||
- "buffering" | ||
context: | ||
domain: media_player | ||
volume_level: "50" | ||
response: "Yes" | ||
|
||
- sentences: | ||
- "are any media players on in the kitchen?" | ||
intent: | ||
name: HassGetState | ||
slots: | ||
area: "Kitchen" | ||
domain: "media_player" | ||
state: "playing" | ||
response: "No" | ||
|
||
- sentences: | ||
- "are all media players on?" | ||
intent: | ||
name: HassGetState | ||
slots: | ||
domain: "media_player" | ||
state: "playing" | ||
response: "No, TV is not on" | ||
|
||
- sentences: | ||
- "are all media players off?" | ||
intent: | ||
name: HassGetState | ||
slots: | ||
domain: "media_player" | ||
state: "off" | ||
response: "No, TV is not off" | ||
|
||
- sentences: | ||
- "which media players are on?" | ||
intent: | ||
name: HassGetState | ||
slots: | ||
domain: "media_player" | ||
state: "playing" | ||
response: "Not any" | ||
|
||
- sentences: | ||
- "how many media players are on?" | ||
intent: | ||
name: HassGetState | ||
slots: | ||
domain: "media_player" | ||
state: "playing" | ||
response: "0" | ||
|
||
- sentences: | ||
- "are all the media players on in the living room" | ||
- "are all media players on in the living room?" | ||
- "are all media players in the living room on?" | ||
intent: | ||
name: HassGetState | ||
slots: | ||
domain: "media_player" | ||
state: "playing" | ||
area: "Living Room" | ||
response: "No, TV is not on" | ||
Comment on lines
+1
to
+125
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test scenarios are well-designed but there's an issue with the format of - alternate_state:
- "on": "in an unknown state"
- idle: "not playing"
- standby: "in standby"
+ alternate_state: "in an unknown state"
ToolsGitHub Check: build
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
alternate_state
response template enhances descriptive accuracy but may have an issue with theactual_state
attribute.Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a slot being passed from
sentences/en/media_player_HassGetState.yaml
, so first of all it's not an attribute and second of all it is not a problem.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tetele Thank you for the clarification on the
actual_state
slot usage. I appreciate your insight and understanding of the implementation details. If there's anything else you need assistance with regarding this PR, feel free to let me know!