Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
LaStrada authored Dec 4, 2023
2 parents 034066e + 27b602c commit 3be2315
Show file tree
Hide file tree
Showing 169 changed files with 3,587 additions and 177 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/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected].4
uses: actions/[email protected].5
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 }}
6 changes: 3 additions & 3 deletions 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 Expand Up @@ -165,7 +165,7 @@ HassShoppingListAddItem:
# -----------------------------------------------------------------------------

HassGetWeather:
supported: false
supported: true
domain: weather
description: "Gets the current weather"
slots:
Expand All @@ -178,7 +178,7 @@ HassGetWeather:
# -----------------------------------------------------------------------------

HassListAddItem:
supported: false
supported: true
domain: todo
description: "Adds an item to a todo list"
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
@@ -1,4 +1,4 @@
hassil==1.5.0
hassil==1.5.1
PyYAML==6.0.1
voluptuous==0.13.1
regex==2023.10.3
Expand All @@ -7,6 +7,6 @@ jinja2==3.1.2
black==23.11.0
flake8==6.1.0
isort==5.12.0
mypy==1.7.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') }}"
3 changes: 3 additions & 0 deletions responses/cs/HassGetState.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ responses:
one_light: |
Světlo {{ slots.name | capitalize }} je {{ state.state_with_unit }}
one_scene: |
Scéna {{ slots.name | capitalize }} je {{ state.state_with_unit }}
one_cover: |
{% set present_continuous = ('je', 'jí', 'rá') %}
{% set present_simple = ('no', 'ná', 'né') %}
Expand Down
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 }}"
1 change: 1 addition & 0 deletions responses/cs/HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ responses:
light: "Rozsvíceno"
cover: "Otevřeno"
garage: "Vrata otevřena"
scene: "Scéna aktivována"
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/de/HassGetWeather.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: de
responses:
intents:
HassGetWeather:
default: >
{% set weather_condition = {
'clear': 'und klar',
'clear-night': 'und klare Nacht',
'cloudy': 'und bewölkt',
'exceptional': 'und außergewöhnlich',
'fog': 'mit Nebel',
'hail': 'mit Hagel',
'lightning': 'mit Gewitter',
'lightning-rainy': 'mit Gewitter und Regen',
'partlycloudy': 'und teilweise bewölkt',
'pouring': 'und strömender Regen',
'rainy': 'und regnerisch',
'snowy': 'und verschneit',
'snowy-rainy': 'mit Schnee und Regen',
'sunny': 'und sonnig',
'windy': 'und windig',
'windy-variant': 'mit Wind und Wolken'
} %}
{{ state.attributes.get('temperature') }} {{ state.attributes.get('temperature_unit') }} {{ weather_condition.get((state.state | string).lower(), "") }}
5 changes: 5 additions & 0 deletions responses/de/HassListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: de
responses:
intents:
HassListAddItem:
item_added: "{{ slots.item }} hinzugefügt"
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) }} {{ '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 3be2315

Please sign in to comment.