Skip to content

Commit

Permalink
Merge branch 'main' of github.com:home-assistant/intents into basque
Browse files Browse the repository at this point in the history
  • Loading branch information
urtzai committed Nov 13, 2024
2 parents a7c4e7f + 5304ecb commit 73f51cb
Show file tree
Hide file tree
Showing 543 changed files with 11,234 additions and 4,028 deletions.
7 changes: 5 additions & 2 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "home-assistant/intents",
"image": "mcr.microsoft.com/devcontainers/python:3.12",
"features": {
"ghcr.io/devcontainers/features/node:1": {}
},
"containerEnv": {
"DEVCONTAINER": "1"
},
Expand All @@ -21,6 +24,6 @@
}
}
},
"postCreateCommand": "script/setup",
"postCreateCommand": "script/setup && website/script/setup",
"remoteUser": "vscode"
}
}
44 changes: 43 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

permissions:
contents: read
pull-requests: read

concurrency:
# yamllint disable-line rule:line-length
Expand All @@ -32,6 +33,47 @@ jobs:
run: |
echo "::add-matcher::.github/workflows/matchers/intentfest.json"
- run: script/lint
- run: script/test
- name: Get changed files
if: github.event_name == 'pull_request'
id: changed-files
uses: tj-actions/changed-files@v45
with:
json: true
escape_json: false

- name: Extract affected languages
if: github.event_name == 'pull_request'
id: extract-languages
env:
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "::group::Get changed files"
echo $CHANGED_FILES
echo "::endgroup::"
# Check if any files outside language directories were changed
if echo "$CHANGED_FILES" | jq -r '.[]' | grep -qvE '^(sentences|responses|tests)/'; then
echo "Running full tests due to changes outside language directories"
exit 0
fi
# Get unique language codes from changed files
LANGUAGES=$(echo "$CHANGED_FILES" | jq -r '.[]' | \
grep -oE '^(sentences|responses|tests)/([^/ ]+)/' | \
cut -d'/' -f2 | sort -u | tr '\n' ',' | sed 's/,$//')
if [ -n "$LANGUAGES" ]; then
echo "languages=$LANGUAGES" | tee -a $GITHUB_OUTPUT
fi
- name: Run tests
env:
is_pr: ${{ github.event_name == 'pull_request' }}
run: |
if [ "$is_pr" = "true" ] && [ -n "${{ steps.extract-languages.outputs.languages }}" ]; then
script/test --language ${{ steps.extract-languages.outputs.languages }}
else
script/test
fi
- run: python3 -m script.intentfest parse --language en --sentence 'turn on the lights in the kitchen'
- run: python3 -m script.intentfest codeowners --check
10 changes: 3 additions & 7 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ sentences/de-CH/ @dontinelli
responses/de-CH/ @dontinelli
tests/de-CH/ @dontinelli

sentences/en/ @tetele
responses/en/ @tetele
tests/en/ @tetele
sentences/en/ @mrdarrengriffin @tetele @vividboarder
responses/en/ @mrdarrengriffin @tetele @vividboarder
tests/en/ @mrdarrengriffin @tetele @vividboarder

sentences/es/ @davefx
responses/es/ @davefx
Expand All @@ -42,10 +42,6 @@ sentences/fr/ @jlpouffier @piitaya
responses/fr/ @jlpouffier @piitaya
tests/fr/ @jlpouffier @piitaya

sentences/fr-CA/ @charlesdagenais
responses/fr-CA/ @charlesdagenais
tests/fr-CA/ @charlesdagenais

sentences/gl/ @cibernox
responses/gl/ @cibernox
tests/gl/ @cibernox
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ See the [documentation](docs/README.md) for more information.

# Development

Checkout the repository and get a development environment with `script/setup`. This will create a new virtual environment in the `venv` directory of the repository, and install all necessary requirements.

Before developing, always activate your virtual environment with `source venv/bin/activate`.
The easiest way to start contributing is by using [devcontainers](https://containers.dev/).
The repository is configured for devcontainer support.
Please, check how you can use devcontainers with your favourite IDE.

## Run tests

Expand Down
5 changes: 5 additions & 0 deletions intents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ HassNevermind:
domain: homeassistant
description: "Does nothing. Used to cancel a request"

HassRespond:
supported: true
domain: homeassistant
description: "Returns response but takes no action."

HassSetPosition:
supported: true
domain: homeassistant
Expand Down
6 changes: 2 additions & 4 deletions languages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ el:
en:
nativeName: English
leaders:
- mrdarrengriffin
- tetele
- vividboarder
es:
nativeName: Español
leaders:
Expand All @@ -62,10 +64,6 @@ fr:
leaders:
- jlpouffier
- piitaya
fr-CA:
nativeName: Français (Canada)
leaders:
- charlesdagenais
gl:
nativeName: Galician
leaders:
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
hassil==1.7.4
hassil==2.0.0
PyYAML==6.0.2
voluptuous==0.15.2
regex==2024.9.11
regex==2024.11.6
jinja2==3.1.4

black==24.10.0
flake8==7.1.1
isort==5.13.2
mypy==1.12.1
mypy==1.13.0
pylint==3.3.1
pytest==8.3.3
pytest-xdist[psutil]==3.6.1
53 changes: 53 additions & 0 deletions responses/ar/HassGetCurrentDate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
language: ar
responses:
intents:
HassGetCurrentDate:
default: >
{% set months = {
1: 'يناير',
2: 'فبراير',
3: 'مارس',
4: 'أبريل',
5: 'مايو',
6: 'يونيو',
7: 'يوليو',
8: 'أغسطس',
9: 'سبتمبر',
10: 'أكتوبر',
11: 'نوفمبر',
12: 'ديسمبر'
} %}
{% set ordinal = {
1: 'الأول',
2: 'الثاني',
3: 'الثالث',
4: 'الرابع',
5: 'الخامس',
6: 'السادس',
7: 'السابع',
8: 'الثامن',
9: 'التاسع',
10: 'العاشر',
11: 'الحادي عشر',
12: 'الثاني عشر',
13: 'الثالث عشر',
14: 'الرابع عشر',
15: 'الخامس عشر',
16: 'السادس عشر',
17: 'السابع عشر',
18: 'الثامن عشر',
19: 'التاسع عشر',
20: 'العشرون',
21: 'الواحد والعشرون',
22: 'الثاني والعشرون',
23: 'الثالث والعشرون',
24: 'الرابع والعشرون',
25: 'الخامس والعشرون',
26: 'السادس والعشرون',
27: 'السابع والعشرون',
28: 'الثامن والعشرون',
29: 'التاسع والعشرون',
30: 'الثلاثون',
31: 'الواحد والثلاثون'
} %}
{{ ordinal[slots.date.day] }} من {{ months[slots.date.month] }} {{ slots.date.year }}
12 changes: 12 additions & 0 deletions responses/ar/HassGetCurrentTime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: ar
responses:
intents:
HassGetCurrentTime:
default: >
{% set minute_str = '{0:02d}'.format(slots.time.minute) %}
{% if slots.time.hour <= 12: %}
{{ slots.time.hour }}:{{ minute_str }} صباحا
{% else: %}
{{ slots.time.hour - 12 }}:{{ minute_str }} مساءا
{% endif %}
9 changes: 9 additions & 0 deletions responses/ar/HassRespond.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: ar
responses:
intents:
HassRespond:
hello: "اهلا وسهلا"
listening: "لا، فقط في حال قلت كلمة التنشيط"
data: "بياناتك الخاصة يتم ارسالها فقط إلى خادم البيت الذكي الخاص بك"
commands: "لمعرفة ما يمكنك السؤال عنه، قم بزيارة موقعنا الإلكتروني"
creator: "لقد تم إنشائي من قبل المجتمع الرائع للبيت الذكي، والذي يتكون من عباقرة في جميع أنحاء العالم"
5 changes: 5 additions & 0 deletions responses/ar/HassSetPosition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: ar
responses:
intents:
HassSetPosition:
default: "تم التحريك"
5 changes: 5 additions & 0 deletions responses/ar/HassShoppingListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: ar
responses:
intents:
HassShoppingListAddItem:
item_added: "تم اضافة {{ slots.item }}"
54 changes: 54 additions & 0 deletions responses/bg/HassGetCurrentDate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
language: bg
responses:
intents:
HassGetCurrentDate:
default: >
{% set months = {
1: 'Януари',
2: 'Февруари',
3: 'Март',
4: 'Април',
5: 'Май',
6: 'Юни',
7: 'Юли',
8: 'Август',
9: 'Септември',
10: 'Октомври',
11: 'Ноември',
12: 'Декември',
} %}
{% set ordinal = {
1: 'първи',
2: 'втори',
3: 'трети',
4: 'четвърти',
5: 'пети',
6: 'шести',
7: 'седми',
8: 'осми',
9: 'девети',
10: 'десети',
11: 'единадесети',
12: 'дванадесети',
13: 'тринадесети',
14: 'четиринадесети',
15: 'петнадесети',
16: 'шестнадесети',
17: 'седемнадесети',
18: 'осемнадесети',
19: 'деветнадесети',
20: 'двадесети',
21: 'двадесет и първи',
22: 'двадесет и втори',
23: 'двадесет и трети',
24: 'двадесет и четвърти',
25: 'двадесет и пети',
26: 'двадесет и шести',
27: 'двадесет и седми',
28: 'двадесет и осми',
29: 'двадесет и девети',
30: 'тридесети',
31: 'тридесет и първи',
} %}
{% set weekday = [ 'понеделник', 'вторник', 'сряда', 'четвъртък', 'петък', 'събота', 'неделя' ] %}
{{ weekday[slots.date.weekday()] }}, {{ ordinal[slots.date.day] }} {{ months[slots.date.month] }} {{ slots.date.year }}-та
10 changes: 10 additions & 0 deletions responses/bg/HassGetCurrentTime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: bg
responses:
intents:
HassGetCurrentTime:
default: >
{{ slots.time.hour }} часа
{% if slots.time.minute > 0: %}
и
{{ slots.time.minute }} {{ 'минута' if slots.time.minute == 1 else 'минути' }}
{% endif %}
5 changes: 5 additions & 0 deletions responses/bg/HassShoppingListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: bg
responses:
intents:
HassShoppingListAddItem:
item_added: "Добавих {{ slots.item }}"
6 changes: 6 additions & 0 deletions responses/ca/HassCancelTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
language: ca
responses:
intents:
HassCancelTimer:
default: "Temporitzador cancel·lat"
4 changes: 3 additions & 1 deletion responses/ca/HassClimateGetTemperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ language: ca
responses:
intents:
HassClimateGetTemperature:
default: "{{ state.state | float | abs | round(2) }} {{ 'grau' if state.state | float | abs == 1 else 'graus' }} {{ 'sota zero' if state.state | float < 0 else '' }}"
default: >
{% set temperature = state_attr(state.entity_id, 'current_temperature') %}
{{ temperature | float | abs | round(1) | replace('.0', '') | replace('.',',') }} {{ 'grau' if temperature | float | abs == 1 else 'graus' }} {{ 'sota zero' if temperature | float < 0 else '' }}
6 changes: 6 additions & 0 deletions responses/ca/HassDecreaseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
language: ca
responses:
intents:
HassDecreaseTimer:
default: Canvio el temporitzador
27 changes: 27 additions & 0 deletions responses/ca/HassGetCurrentDate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
language: ca
responses:
intents:
HassGetCurrentDate:
default: >
{% set months = {
1: 'gener',
2: 'febrer',
3: 'març',
4: 'abril',
5: 'maig',
6: 'juny',
7: 'juliol',
8: 'agost',
9: 'setembre',
10: 'octubre',
11: 'novembre',
12: 'desembre',
} %}
{% set weekday = [ 'dilluns', 'dimarts', 'dimecres', 'dijous', 'divendres', 'dissabte', 'diumenge' ] %}
És {{ weekday[slots.date.weekday()] }}, {{slots.date.day}}
{% if slots.date.month in [4,8,10]: %}
d'{{ months[slots.date.month] }}
{% else %}
de {{ months[slots.date.month] }}
{% endif %}
del {{ slots.date.year }}
Loading

0 comments on commit 73f51cb

Please sign in to comment.