Skip to content

Commit

Permalink
Merge branch 'home-assistant:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
BCorbeek authored Dec 14, 2023
2 parents f51b3e9 + d5da814 commit 119dfac
Show file tree
Hide file tree
Showing 254 changed files with 6,484 additions and 1,841 deletions.
19 changes: 19 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
categories:
- title: "Breaking Changes"
labels:
- "breaking change"
- title: "Intent Updates"
labels:
- "intent"
- title: "Sentence Updates"
collapse-after: 1
labels:
- "sentence"
- title: "Dependencies"
collapse-after: 1
labels:
- "dependencies"
template: |
## What's Changed
$CHANGES
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v4
- name: Set up Node ${{ env.NODE_VERSION }}
uses: actions/[email protected]
with:
node-version: ${{ env.NODE_VERSION }}
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
Expand All @@ -59,4 +59,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2.0.4
uses: actions/deploy-pages@v3.0.1
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Release Drafter

on:
push:
branches:
- main

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion intents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ HassClimateSetTemperature:
required: false

HassClimateGetTemperature:
supported: false
supported: true
domain: climate
description: "Gets the current temperature of a climate device or entity"
slots:
Expand Down
88 changes: 88 additions & 0 deletions package/home_assistant_intents/domains.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,63 @@
DOMAINS_AND_LANGUAGES = {
"climate": [
"af",
"ar",
"bg",
"bn",
"ca",
"cs",
"da",
"de",
"de-CH",
"el",
"en",
"es",
"eu",
"fa",
"fi",
"fr",
"fr-CA",
"gl",
"gu",
"he",
"hi",
"hr",
"hu",
"id",
"is",
"it",
"ka",
"kn",
"ko",
"lb",
"lt",
"lv",
"ml",
"mn",
"ms",
"nb",
"nl",
"pl",
"pt",
"pt-br",
"ro",
"ru",
"sk",
"sl",
"sr",
"sv",
"sw",
"te",
"tr",
"uk",
"ur",
"vi",
"zh-cn",
"zh-hk",
"zh-tw",
],
"homeassistant": [
"af",
"ar",
"bg",
"bn",
Expand All @@ -11,6 +69,8 @@
"el",
"en",
"es",
"et",
"eu",
"fa",
"fi",
"fr",
Expand All @@ -26,6 +86,7 @@
"it",
"ka",
"kn",
"ko",
"lb",
"lt",
"lv",
Expand Down Expand Up @@ -54,6 +115,7 @@
"zh-tw",
],
"light": [
"af",
"ar",
"bg",
"bn",
Expand All @@ -65,6 +127,7 @@
"el",
"en",
"es",
"eu",
"fa",
"fi",
"fr",
Expand All @@ -80,6 +143,7 @@
"it",
"ka",
"kn",
"ko",
"lb",
"lt",
"lv",
Expand Down Expand Up @@ -107,4 +171,28 @@
"zh-hk",
"zh-tw",
],
"shopping_list": [
"ca",
"cs",
"de",
"de-CH",
"el",
"en",
"es",
"fr",
"hr",
"ko",
"nb",
"nl",
"pl",
"pt",
"ro",
"ru",
"sk",
"sr",
"sv",
"uk",
],
"todo": ["de", "en", "es", "fr", "nl", "ro"],
"weather": ["de", "en", "es", "fr", "nl", "ro"],
}
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jinja2==3.1.2

black==23.11.0
flake8==6.1.0
isort==5.12.0
mypy==1.7.0
isort==5.13.0
mypy==1.7.1
pylint==3.0.2
pytest==7.4.3
2 changes: 1 addition & 1 deletion responses/af/HassClimateGetTemperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: af
responses:
intents:
HassClimateGetTemperature:
default: "{{ state.state_with_unit }}"
default: "{{ state_attr(state.entity_id, 'current_temperature') }}"
2 changes: 1 addition & 1 deletion responses/ar/HassClimateGetTemperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: ar
responses:
intents:
HassClimateGetTemperature:
default: "{{ state.state_with_unit }}"
default: "{{ state_attr(state.entity_id, 'current_temperature') }}"
2 changes: 1 addition & 1 deletion responses/cs/HassClimateGetTemperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: cs
responses:
intents:
HassClimateGetTemperature:
default: "{{ state.state_with_unit }}"
default: "{{ state_attr(state.entity_id, 'current_temperature') }}"
5 changes: 5 additions & 0 deletions responses/cs/HassListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: "cs"
responses:
intents:
HassListAddItem:
item_added: "Přidáno: {{ slots.item }}"
24 changes: 24 additions & 0 deletions responses/de-CH/HassGetWeather.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: de-CH
responses:
intents:
HassGetWeather:
default: >
{% set weather_condition = {
'clear': 'u klar',
'clear-night': 'u e klari Nacht',
'cloudy': 'u bewöukt',
'exceptional': 'u ussergewöhnlech',
'fog': 'mit Näbu',
'hail': 'mit Hageu',
'lightning': 'mit Gewitter',
'lightning-rainy': 'mit Gewitter u Räge',
'partlycloudy': 'u teilweyys bewöukt',
'pouring': 'und strömende Räge',
'rainy': 'und rägnerisch',
'snowy': 'u verschneit',
'snowy-rainy': 'mit Schnee u Räge',
'sunny': 'u sunnig',
'windy': 'u windig',
'windy-variant': 'mit Wind u Wouke'
} %}
Es isch {{ state.attributes.get('temperature') }} {{ state.attributes.get('temperature_unit') }} {{ weather_condition.get((state.state | string).lower(), "") }}
5 changes: 5 additions & 0 deletions responses/de-CH/HassListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: de-CH
responses:
intents:
HassListAddItem:
item_added: "Ha {{ slots.item }} uf d Lyschte {{ slots.name }} gsetzt"
2 changes: 1 addition & 1 deletion responses/de-CH/HassShoppingListAddItem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: de-CH
responses:
intents:
HassShoppingListAddItem:
item_added: "Ha {{ slots.item }} uf d Lyschte gsetzt"
item_added: "Ha {{ slots.item }} uf d Yychoufslyschte gsetzt"
2 changes: 1 addition & 1 deletion responses/de/HassClimateGetTemperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: de
responses:
intents:
HassClimateGetTemperature:
default: "{{ state.state_with_unit }}"
default: "{{ state_attr(state.entity_id, 'current_temperature') }}"
24 changes: 24 additions & 0 deletions responses/el/HassGetWeather.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: el
responses:
intents:
HassGetWeather:
default: >
{% set weather_condition = {
'clear': 'και καθαρός',
'clear-night': 'και με ξαστεριά',
'cloudy': 'και νεφελώδης',
'exceptional': 'και εξαιρετικός',
'fog': 'με ομίχλη',
'hail': 'με χαλάζι',
'lightning': 'με καταιγίδα',
'lightning-rainy': 'με καταιγίδες και βροχή',
'partlycloudy': 'και μερικώς νεφελώδης',
'pouring': 'και καταρρακτώδης βροχή',
'rainy': 'και βροχερός',
'snowy': 'και χιονισμένος',
'snowy-rainy': 'με χιόνι και βροχή',
'sunny': 'και ηλιόλουστος',
'windy': 'και θυελλώδης',
'windy-variant': 'με άνεμο και σύννεφα'
} %}
{{ state.attributes.get('temperature') }} {{ state.attributes.get('temperature_unit') }} {{ weather_condition.get((state.attributes.get('untranslated_state') | string).lower(), "") }}
5 changes: 5 additions & 0 deletions responses/el/HassListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: "el"
responses:
intents:
HassListAddItem:
item_added: "Προστέθηκε το προϊόν {{ slots.item }}"
2 changes: 1 addition & 1 deletion responses/el/HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: el
responses:
intents:
HassTurnOff:
default: "Έκλεισαν τα φώτα στο {{ slots.name }}"
default: "Έκλεισε"
lights_area: "Έκλεισαν τα φώτα"
fans_area: "Έκλεισαν οι ανεμιστήρες"
cover: "{{ slots.name }} έκλεισε"
Expand Down
2 changes: 1 addition & 1 deletion responses/el/HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: el
responses:
intents:
HassTurnOn:
default: "Άνοιξαν τα φώτα στο {{ slots.name }}"
default: "Άνοιξε"
lights_area: "Άνοιξαν τα φώτα"
fans_area: "Άνοιξαν οι ανεμιστήρες"
cover: "{{ slots.name }} άνοιξε"
Expand Down
8 changes: 7 additions & 1 deletion responses/en/HassClimateGetTemperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@ language: en
responses:
intents:
HassClimateGetTemperature:
default: "{{ state.state_with_unit }}"
default: >
{% set temperature = state_attr(state.entity_id, 'current_temperature') %}
{% if temperature == 1: %}
{{ temperature }} degree
{% else: %}
{{ temperature }} degrees
{% endif %}
4 changes: 3 additions & 1 deletion responses/es/HassClimateGetTemperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ language: es
responses:
intents:
HassClimateGetTemperature:
default: "{{ state.state | float | abs | round(2) }} {{ 'grado' if state.state | float | abs == 1 else 'grados' }} {{ 'bajo cero' if state.state | float < 0 else '' }}"
default: >
{% set temperature = state_attr(state.entity_id, 'current_temperature') %}
{{ temperature | float | abs | round(1) | replace('.0', '') | replace('.',',') }} {{ 'grado' if temperature | float | abs == 1 else 'grados' }} {{ 'bajo cero' if temperature | float < 0 else '' }}
2 changes: 1 addition & 1 deletion responses/et/HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: et
responses:
intents:
HassTurnOff:
default: "Turned off {{ slots.name }}"
default: "{{ slots.name }} lülitatud välja"
2 changes: 1 addition & 1 deletion responses/et/HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: et
responses:
intents:
HassTurnOn:
default: "Turned on {{ slots.name }}"
default: "{{ slots.name }} lülitatud sisse"
2 changes: 1 addition & 1 deletion responses/eu/HassClimateGetTemperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: eu
responses:
intents:
HassClimateGetTemperature:
default: "TODO: {{ state.state_with_unit }}"
default: "TODO: {{ state_attr(state.entity_id, 'current_temperature') }}"
2 changes: 1 addition & 1 deletion responses/fi/HassClimateGetTemperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: fi
responses:
intents:
HassClimateGetTemperature:
default: "{{ state.state_with_unit }}"
default: "{{ state_attr(state.entity_id, 'current_temperature') }}"
2 changes: 1 addition & 1 deletion responses/fr/HassClimateGetTemperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: fr
responses:
intents:
HassClimateGetTemperature:
default: "{{ state.state_with_unit }}"
default: "{{ state_attr(state.entity_id, 'current_temperature') }}"
Loading

0 comments on commit 119dfac

Please sign in to comment.