Skip to content

Commit

Permalink
[en] Add previous_track intent (#2080)
Browse files Browse the repository at this point in the history
* Add stop, previous, clear playlist intents

* suggested edits

* Update for 2024.6.0

* Remove stop and clear playlist intents

* Update intents.yaml

* Tweak sentences

* Tweaked space placement

* Update sentences/en/media_player_HassMediaPrevious.yaml

Co-authored-by: Tudor Sandu <[email protected]>

* Address comments

* Address forgotten comments

---------

Co-authored-by: Tudor Sandu <[email protected]>
  • Loading branch information
OzGav and tetele authored Jun 24, 2024
1 parent cddd885 commit f61d615
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 0 deletions.
12 changes: 12 additions & 0 deletions intents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,18 @@ HassSetVolume:
description: "Volume level from 0 to 100"
required: true

HassMediaPrevious:
supported: false
domain: media_player
description: "Skips a media player back to the previous item"
slots:
name:
description: "Name of a device or entity"
required: false
area:
description: "Name of an area"
required: false

# -----------------------------------------------------------------------------
# timers
# -----------------------------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions responses/en/HassMediaPrevious.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: en
responses:
intents:
HassMediaPrevious:
default: "Playing previous"
21 changes: 21 additions & 0 deletions sentences/en/media_player_HassMediaPrevious.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: en
intents:
HassMediaPrevious:
data:
- sentences:
- "(go back[ to the (previous|last) (song|track)];[on ]<name>)"
- "replay [the (previous|last) (song|track) ]on <name>"
- "<name> (play|replay) [the ](previous|last)[ (song|track)][ again]"
requires_context:
domain: media_player
- sentences:
- "go back[ to the (previous|last) (song|track)]"
- "replay[ the (previous|last) (song|track)][ again]"
- "play [the ](previous|last)[ (song|track)][ again]"
requires_context:
area:
slot: true
- sentences:
- "go back[ to the (previous|last) (song|track)] [in ]<area>"
- "(replay[ the (previous|last) (song|track)][ again];[in ]<area>)"
- "(play[ the] (previous|last) [(song|track) ][again];[in ]<area>)"
45 changes: 45 additions & 0 deletions tests/en/media_player_HassMediaPrevious.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
language: en
tests:
- sentences:
- "go back on TV"
- "go back to the previous song on the TV"
- "go back to the last track on the TV"
- "replay the last track on the TV"
- "TV go back to the previous track"
- "TV go back to the last song"
- "TV play the last track"
- "TV play the previous song"
- "TV play the previous song again"
- "TV replay the last track"
intent:
name: HassMediaPrevious
slots:
name: "TV"
response: "Playing previous"
- sentences:
- "go back"
- "go back to the previous song"
- "go back to the last track"
- "replay the last track"
- "play the last song again"
- "replay"
intent:
name: HassMediaPrevious
slots:
area: "Living Room"
context:
area: Living Room
response: "Playing previous"
- sentences:
- "go back in the living room"
- "go back to the previous song in the living room"
- "go back to the last track in the living room"
- "replay the last track in the living room"
- "in the living room play the last song again"
intent:
name: HassMediaPrevious
slots:
area: "Living Room"
context:
area: Living Room
response: "Playing previous"

0 comments on commit f61d615

Please sign in to comment.