Skip to content
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

[DE] Add HassGetDate and HassGetTime #2314

Merged
merged 3 commits into from
Jul 13, 2024
Merged
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
29 changes: 29 additions & 0 deletions responses/de/HassGetCurrentDate.yaml
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 }}
11 changes: 11 additions & 0 deletions responses/de/HassGetCurrentTime.yaml
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 }}
2 changes: 1 addition & 1 deletion sentences/de/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ expansion_rules:
batterie: "<artikel> (Batterie[n]|Akku[s])"
irgend: "(irgend(<artikel_unbestimmt>[s]|welche[s]|wo)|(einige|manche)[s]|<artikel_unbestimmt>[s]) <artikel_bestimmt>"
etwas: "[irgend][et]was"
welche: "(welche[r|s]|was für[ <artikel_unbestimmt>[s]]) <artikel_bestimmt>"
welche: "(welche[r|s|n]|was für[ <artikel_unbestimmt>[s]]) <artikel_bestimmt>"
wieviel: "(wie[ ]viel[e]|welche Anzahl[ (an|von)])"
ladestand: "<artikel>[ Lade][zu]Stand"
co: "Kohlen[stoff]monoxid"
Expand Down
7 changes: 7 additions & 0 deletions sentences/de/homeassistant_HassGetCurrentDate.yaml
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"
8 changes: 8 additions & 0 deletions sentences/de/homeassistant_HassGetCurrentTime.yaml
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"
19 changes: 19 additions & 0 deletions tests/de/homeassistant_HassGetCurrentDate.yaml
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
19 changes: 19 additions & 0 deletions tests/de/homeassistant_HassGetCurrentTime.yaml
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