-
Notifications
You must be signed in to change notification settings - Fork 523
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DE] Add HassGetDate and HassGetTime (#2314)
* Add HassGetDate and HassGetTime * Apply suggestions from code review Co-authored-by: Michael <[email protected]> * add "wieviel" and update tests --------- Co-authored-by: Michael <[email protected]>
- Loading branch information
1 parent
59f60aa
commit a67a1e7
Showing
7 changed files
with
94 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
language: de | ||
responses: | ||
intents: | ||
HassGetCurrentDate: | ||
default: > | ||
{% set months = { | ||
1: 'Januar', | ||
2: 'Februar', | ||
3: 'März', | ||
4: 'April', | ||
5: 'Mai', | ||
6: 'Juni', | ||
7: 'Juli', | ||
8: 'August', | ||
9: 'September', | ||
10: 'Oktober', | ||
11: 'November', | ||
12: 'Dezember', | ||
} %} | ||
{% set weekday = [ | ||
'Montag', | ||
'Dienstag', | ||
'Mittwoch', | ||
'Donnerstag', | ||
'Freitag', | ||
'Samstag', | ||
'Sonntag' | ||
] %} | ||
Es ist {{ weekday[slots.date.weekday()] }} der {{ slots.date.day }}. {{ months[slots.date.month] }} {{ slots.date.year }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
language: de | ||
responses: | ||
intents: | ||
HassGetCurrentTime: | ||
# return both hours and minutes with padded zeros so it is pronounced correctly by TTS | ||
# "Es ist 1:02" results in spoken "Es ist eins null zwei" | ||
# "Es ist 01:02" results in spoken "Es ist ein Uhr zwei" | ||
default: > | ||
{% set hour_str = '{0:02d}'.format(slots.time.hour) %} | ||
{% set minute_str = '{0:02d}'.format(slots.time.minute) %} | ||
Es ist {{ hour_str }}:{{ minute_str }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
language: de | ||
intents: | ||
HassGetCurrentDate: | ||
data: | ||
- sentences: | ||
- "<welche> (tag|datum) (ist|haben wir) heute" | ||
- "(nenn[e]|gib|gebe) mir das[ (heutige|aktuelle)] datum" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
language: de | ||
intents: | ||
HassGetCurrentTime: | ||
data: | ||
- sentences: | ||
- "wie spät ist es" | ||
- "(wie viel|wieviel) uhr (ist es|haben wir)[ jetzt]" | ||
- "(nenn[e]|gib|gebe) mir die uhrzeit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
language: de | ||
tests: | ||
- sentences: | ||
- "welcher tag ist heute" | ||
- "welches datum ist heute" | ||
- "welchen tag haben wir heute" | ||
- "welches datum haben wir heute" | ||
- "was für ein datum ist heute" | ||
- "nenn mir das datum" | ||
- "nenne mir das datum" | ||
- "nenn mir das aktuelle datum" | ||
- "nenne mir das aktuelle datum" | ||
- "gib mir das datum" | ||
- "gebe mir das datum" | ||
- "gib mir das aktuelle datum" | ||
- "gebe mir das aktuelle datum" | ||
intent: | ||
name: HassGetCurrentDate | ||
response: Es ist Dienstag der 17. September 2013 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
language: de | ||
tests: | ||
- sentences: | ||
- "wie spät ist es" | ||
- "wie viel uhr ist es" | ||
- "wie viel uhr ist es jetzt" | ||
- "wie viel uhr haben wir" | ||
- "wie viel uhr haben wir jetzt" | ||
- "wieviel uhr ist es" | ||
- "wieviel uhr ist es jetzt" | ||
- "wieviel uhr haben wir" | ||
- "wieviel uhr haben wir jetzt" | ||
- "nenn mir die uhrzeit" | ||
- "nenne mir die uhrzeit" | ||
- "gib mir die uhrzeit" | ||
- "gebe mir die uhrzeit" | ||
intent: | ||
name: HassGetCurrentTime | ||
response: Es ist 01:02 |