From 7cfdc24a8c838a57a6d541fb2554635ab8b1bfdf Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 10 Jul 2019 08:17:41 -0700 Subject: [PATCH 1/8] Fix test translations (#3339) --- build-scripts/gulp/clean.js | 15 ++++++++++++-- build-scripts/gulp/translations.js | 32 ++++++++++++++++++++---------- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/build-scripts/gulp/clean.js b/build-scripts/gulp/clean.js index d1226c198e..fa26682819 100644 --- a/build-scripts/gulp/clean.js +++ b/build-scripts/gulp/clean.js @@ -1,6 +1,17 @@ const del = require("del"); const gulp = require("gulp"); const config = require("../paths"); +require("./translations"); -gulp.task("clean", () => del([config.root, config.build_dir])); -gulp.task("clean-demo", () => del([config.demo_root, config.build_dir])); +gulp.task( + "clean", + gulp.parallel("clean-translations", function cleanOutputAndBuildDir() { + return del([config.root, config.build_dir]); + }) +); +gulp.task( + "clean-demo", + gulp.parallel("clean-translations", function cleanOutputAndBuildDir() { + return del([config.demo_root, config.build_dir]); + }) +); diff --git a/build-scripts/gulp/translations.js b/build-scripts/gulp/translations.js index a393f71479..cda82a6c01 100755 --- a/build-scripts/gulp/translations.js +++ b/build-scripts/gulp/translations.js @@ -124,18 +124,28 @@ gulp.task(taskName, function() { }); tasks.push(taskName); -taskName = "create-test-metadata"; -gulp.task(taskName, function(cb) { - fs.writeFile( - workDir + "/testMetadata.json", - JSON.stringify({ - test: { - nativeName: "Test", - }, - }), - cb - ); +gulp.task("ensure-translations-build-dir", (done) => { + if (!fs.existsSync(workDir)) { + fs.mkdirSync(workDir); + } + done(); }); + +taskName = "create-test-metadata"; +gulp.task( + taskName, + gulp.series("ensure-translations-build-dir", function writeTestMetaData(cb) { + fs.writeFile( + workDir + "/testMetadata.json", + JSON.stringify({ + test: { + nativeName: "Test", + }, + }), + cb + ); + }) +); tasks.push(taskName); taskName = "create-test-translation"; From 628692b2e9d0d2e25c91494e51a329ce26aa3e8b Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 10 Jul 2019 08:17:51 -0700 Subject: [PATCH 2/8] Do not cache onboarding page (#3337) --- src/entrypoints/service-worker-hass.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/entrypoints/service-worker-hass.js b/src/entrypoints/service-worker-hass.js index dc0afcf39a..8a0225d17b 100644 --- a/src/entrypoints/service-worker-hass.js +++ b/src/entrypoints/service-worker-hass.js @@ -19,9 +19,11 @@ function initRouting() { new workbox.strategies.NetworkOnly() ); - // Get manifest and service worker from network. + // Get manifest, service worker, onboarding from network. workbox.routing.registerRoute( - new RegExp(`${location.host}/(service_worker.js|manifest.json)`), + new RegExp( + `${location.host}/(service_worker.js|manifest.json|onboarding.html)` + ), new workbox.strategies.NetworkOnly() ); From 2929db5ba4c64cbcb24ebf308afbf3e4affa0169 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 10 Jul 2019 08:18:04 -0700 Subject: [PATCH 3/8] Fix fonts precaching (#3338) * Fix font urls * Don't zopfli nonexisting fonts --- build-scripts/gulp/gather-static.js | 6 +----- src/html/authorize.html.template | 4 ++-- src/html/onboarding.html.template | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/build-scripts/gulp/gather-static.js b/build-scripts/gulp/gather-static.js index 274581f322..2bdfda5f75 100644 --- a/build-scripts/gulp/gather-static.js +++ b/build-scripts/gulp/gather-static.js @@ -69,10 +69,6 @@ function copyMapPanel(staticDir) { function compressStatic(staticDir) { const staticPath = genStaticPath(staticDir); - const fonts = gulp - .src(staticPath("fonts/**/*.ttf")) - .pipe(zopfli()) - .pipe(gulp.dest(staticPath("fonts"))); const polyfills = gulp .src(staticPath("polyfills/*.js")) .pipe(zopfli()) @@ -82,7 +78,7 @@ function compressStatic(staticDir) { .pipe(zopfli()) .pipe(gulp.dest(staticPath("translations"))); - return merge(fonts, polyfills, translations); + return merge(polyfills, translations); } gulp.task("copy-static", (done) => { diff --git a/src/html/authorize.html.template b/src/html/authorize.html.template index 6833ede06e..9b057978f9 100644 --- a/src/html/authorize.html.template +++ b/src/html/authorize.html.template @@ -5,13 +5,13 @@ diff --git a/src/html/onboarding.html.template b/src/html/onboarding.html.template index c63949ae87..8f98f28290 100644 --- a/src/html/onboarding.html.template +++ b/src/html/onboarding.html.template @@ -5,13 +5,13 @@ From cdd007cc542ccf8690676b70740b00e640db0e04 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 10 Jul 2019 09:27:25 -0700 Subject: [PATCH 4/8] Ensure load order (#3346) --- src/html/_js_base.html.template | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/html/_js_base.html.template b/src/html/_js_base.html.template index f9fac27261..e92b64036c 100644 --- a/src/html/_js_base.html.template +++ b/src/html/_js_base.html.template @@ -5,7 +5,7 @@ document.createElement("script"), doc.lastChild ); - script.type = "text/javascript"; + script.defer = true; script.src = src; } window.Polymer = { @@ -15,11 +15,9 @@ suppressTemplateNotifications: true, suppressBindingNotifications: true, }; - var webComponentsSupported = - "customElements" in window && - "content" in document.createElement("template"); - if (!webComponentsSupported) { - _ls("/static/polyfills/webcomponents-bundle.js"); + if (!("customElements" in window && + "content" in document.createElement("template"))) { + document.write(" From 4ae347949a7260767498dd109e1aea3aad0287f3 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 10 Jul 2019 09:36:35 -0700 Subject: [PATCH 5/8] Update translations --- translations/ca.json | 16 ++++++++-- translations/de.json | 16 ++++++++-- translations/en.json | 16 ++++++++-- translations/hu.json | 12 ++++++- translations/it.json | 11 ++++++- translations/ko.json | 20 +++++++++--- translations/nb.json | 18 +++++++++-- translations/nl.json | 16 ++++++++-- translations/pl.json | 16 ++++++++-- translations/ru.json | 16 ++++++++-- translations/sk.json | 67 +++++++++++++++++++++++++++++++++++---- translations/sl.json | 16 ++++++++-- translations/zh-Hans.json | 56 ++++++++++++++++++++++---------- translations/zh-Hant.json | 22 ++++++++++--- 14 files changed, 268 insertions(+), 50 deletions(-) diff --git a/translations/ca.json b/translations/ca.json index fbab8e7f6d..a610f92500 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -145,7 +145,8 @@ "high_demand": "Alta potència", "heat_pump": "Bomba de calor", "gas": "Gas", - "manual": "Manual" + "manual": "Manual", + "heat_cool": "Automàtic" }, "configurator": { "configure": "Configurar", @@ -1122,7 +1123,8 @@ "fan_mode": "Mode ventilació", "swing_mode": "Mode oscil·lació", "away_mode": "Mode absent", - "aux_heat": "Calefactor auxiliar" + "aux_heat": "Calefactor auxiliar", + "preset_mode": "Programat" }, "lock": { "code": "Codi", @@ -1267,6 +1269,16 @@ "off": "Desactivat", "on": "Activat", "auto": "Automàtic" + }, + "preset_mode": { + "none": "Cap", + "eco": "Econòmic", + "away": "Absent", + "boost": "Incrementat", + "comfort": "Confort", + "home": "A casa", + "sleep": "Dormint", + "activity": "Activitat" } } }, diff --git a/translations/de.json b/translations/de.json index 239c767609..bce922b430 100644 --- a/translations/de.json +++ b/translations/de.json @@ -145,7 +145,8 @@ "high_demand": "Hoher Verbrauch", "heat_pump": "Wärmepumpe", "gas": "Gas", - "manual": "Manuell" + "manual": "Manuell", + "heat_cool": "Automatisch" }, "configurator": { "configure": "Konfigurieren", @@ -1122,7 +1123,8 @@ "fan_mode": "Ventilator-Modus", "swing_mode": "Schwenk-Modus", "away_mode": "Abwesenheitsmodus", - "aux_heat": "Hilfswärme" + "aux_heat": "Hilfswärme", + "preset_mode": "Voreinstellung" }, "lock": { "code": "Code", @@ -1267,6 +1269,16 @@ "off": "Aus", "on": "An", "auto": "Auto" + }, + "preset_mode": { + "none": "Keine", + "eco": "Sparmodus", + "away": "Abwesend", + "boost": "Maximal", + "comfort": "Komfort", + "home": "Zuhause", + "sleep": "Schlafen", + "activity": "Aktivität" } } }, diff --git a/translations/en.json b/translations/en.json index c64b518534..3786632a20 100644 --- a/translations/en.json +++ b/translations/en.json @@ -145,7 +145,8 @@ "high_demand": "High demand", "heat_pump": "Heat pump", "gas": "Gas", - "manual": "Manual" + "manual": "Manual", + "heat_cool": "Auto" }, "configurator": { "configure": "Configure", @@ -1122,7 +1123,8 @@ "fan_mode": "Fan mode", "swing_mode": "Swing mode", "away_mode": "Away mode", - "aux_heat": "Aux heat" + "aux_heat": "Aux heat", + "preset_mode": "Preset" }, "lock": { "code": "Code", @@ -1267,6 +1269,16 @@ "off": "Off", "on": "On", "auto": "Auto" + }, + "preset_mode": { + "none": "None", + "eco": "Eco", + "away": "Away", + "boost": "Boost", + "comfort": "Comfort", + "home": "Home", + "sleep": "Sleep", + "activity": "Activity" } } }, diff --git a/translations/hu.json b/translations/hu.json index 04e8f63140..43067963a9 100644 --- a/translations/hu.json +++ b/translations/hu.json @@ -145,7 +145,8 @@ "high_demand": "Magas igénybevétel", "heat_pump": "Hőszivattyú", "gas": "Gáz", - "manual": "Manuális" + "manual": "Manuális", + "heat_cool": "Automatikus" }, "configurator": { "configure": "Beállítás", @@ -1267,6 +1268,15 @@ "off": "Ki", "on": "Be", "auto": "Automatikus" + }, + "preset_mode": { + "none": "Nincs", + "eco": "Takarékos", + "away": "Távol", + "comfort": "Komfort", + "home": "Otthon", + "sleep": "Alvás", + "activity": "Tevékenység" } } }, diff --git a/translations/it.json b/translations/it.json index 3f5adbf8de..46962c8965 100644 --- a/translations/it.json +++ b/translations/it.json @@ -145,7 +145,8 @@ "high_demand": "Forte richiesta", "heat_pump": "Pompa di calore", "gas": "Gas", - "manual": "Manuale" + "manual": "Manuale", + "heat_cool": "Auto" }, "configurator": { "configure": "Configura", @@ -1267,6 +1268,14 @@ "off": "Off", "on": "On", "auto": "Auto" + }, + "preset_mode": { + "none": "Nessuna", + "eco": "Eco", + "comfort": "Comfort", + "home": "Casa", + "sleep": "Sleep", + "activity": "Attività" } } }, diff --git a/translations/ko.json b/translations/ko.json index e4f2663c63..708c88ce36 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -139,13 +139,14 @@ "auto": "자동", "dry": "제습", "fan_only": "송풍", - "eco": "절약", + "eco": "절전", "electric": "전기", "performance": "고효율", "high_demand": "고성능", "heat_pump": "순환펌프", "gas": "가스", - "manual": "수동" + "manual": "수동", + "heat_cool": "자동" }, "configurator": { "configure": "설정", @@ -986,7 +987,7 @@ "names": { "upstairs": "위층", "family_room": "가족실", - "kitchen": "부엌", + "kitchen": "주방", "patio": "마당", "hallway": "현관", "master_bedroom": "안방", @@ -1122,7 +1123,8 @@ "fan_mode": "송풍 모드", "swing_mode": "회전 모드", "away_mode": "외출 모드", - "aux_heat": "보조 히터" + "aux_heat": "보조 히터", + "preset_mode": "프리셋" }, "lock": { "code": "비밀번호", @@ -1267,6 +1269,16 @@ "off": "꺼짐", "on": "켜짐", "auto": "자동" + }, + "preset_mode": { + "none": "없음", + "eco": "절전", + "away": "외출", + "boost": "부스트", + "comfort": "안락", + "home": "재실", + "sleep": "수면", + "activity": "활동" } } }, diff --git a/translations/nb.json b/translations/nb.json index 33b7d4d08f..ebc38b3287 100644 --- a/translations/nb.json +++ b/translations/nb.json @@ -145,7 +145,8 @@ "high_demand": "Høy etterspørsel", "heat_pump": "Varmepumpe", "gas": "Gass", - "manual": "Manuell" + "manual": "Manuell", + "heat_cool": "Auto" }, "configurator": { "configure": "Konfigurer", @@ -483,7 +484,7 @@ }, "conditions": { "header": "Betingelser", - "introduction": "Betingelser er en valgfri del av en automatiseringsregel og kan brukes til å forhindre at en handling skjer når den blir aktivert. \nBetingelsene ser veldig ut som utløsere, men er veldig forskjellige. \nEn utløser vil se på hendelser som skjer i systemet, mens en betingelse bare ser på hvordan systemet ser ut akkurat nå. En utløser kan observere at en bryter er slått på. En betingelse kan bare se om en bryter for øyeblikket er på eller av. \n\n[Lær mer om betingelser.](https:\/\/home-assistant.io\/docs\/scripts\/conditions\/)", + "introduction": "Betingelser er en valgfri del av en automatiseringsregel og kan brukes til å forhindre at en handling skjer når den blir aktivert. \nBetingelsene ser veldig ut som utløsere, men er veldig forskjellige. \nEn utløser vil se på hendelser som skjer i systemet, mens en betingelse bare ser på hvordan systemet ser ut akkurat nå. En utløser kan observere at en bryter er slått på. En betingelse kan bare se om en bryter for øyeblikket er på eller av.", "add": "Legg til betingelse", "duplicate": "Dupliser", "delete": "Slett", @@ -1122,7 +1123,8 @@ "fan_mode": "Viftemodus", "swing_mode": "Svingmodus", "away_mode": "Bortemodus", - "aux_heat": "Aux varme" + "aux_heat": "Aux varme", + "preset_mode": "Preset" }, "lock": { "code": "Kode", @@ -1267,6 +1269,16 @@ "off": "Av", "on": "På", "auto": "Auto" + }, + "preset_mode": { + "none": "Ingen", + "eco": "Øko", + "away": "Borte", + "boost": "Turbo", + "comfort": "Komfort", + "home": "Hjem", + "sleep": "Sove", + "activity": "Aktivitet" } } }, diff --git a/translations/nl.json b/translations/nl.json index 99c44929ca..901fe5e902 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -145,7 +145,8 @@ "high_demand": "Hoge vraag", "heat_pump": "Warmtepomp", "gas": "Gas", - "manual": "Handmatig" + "manual": "Handmatig", + "heat_cool": "Auto" }, "configurator": { "configure": "Configureer", @@ -1122,7 +1123,8 @@ "fan_mode": "Ventilatormodus", "swing_mode": "Swingmodus", "away_mode": "Afwezigheidsmodus", - "aux_heat": "Extra warmte" + "aux_heat": "Extra warmte", + "preset_mode": "Vooraf ingesteld" }, "lock": { "code": "Code", @@ -1267,6 +1269,16 @@ "off": "Uit", "on": "Aan", "auto": "Auto" + }, + "preset_mode": { + "none": "Geen", + "eco": "Eco", + "away": "Afwezig", + "boost": "Boost", + "comfort": "Comfort", + "home": "Thuis", + "sleep": "Slapen", + "activity": "Activiteit" } } }, diff --git a/translations/pl.json b/translations/pl.json index 31141e0fc6..3312959568 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -145,7 +145,8 @@ "high_demand": "duży rozbiór", "heat_pump": "pompa ciepła", "gas": "gaz", - "manual": "manualnie" + "manual": "manualnie", + "heat_cool": "automatycznie" }, "configurator": { "configure": "Skonfiguruj", @@ -1122,7 +1123,8 @@ "fan_mode": "Tryb pracy wentylatora", "swing_mode": "Tryb ruchu łopatek", "away_mode": "Tryb poza domem", - "aux_heat": "Dodatkowe źródło ciepła" + "aux_heat": "Dodatkowe źródło ciepła", + "preset_mode": "Ustawienia" }, "lock": { "code": "Kod", @@ -1267,6 +1269,16 @@ "off": "wyłączony", "on": "włączony", "auto": "automatyczny" + }, + "preset_mode": { + "none": "brak", + "eco": "ekonomicznie", + "away": "poza domem", + "boost": "wzmocnienie", + "comfort": "komfort", + "home": "w domu", + "sleep": "sen", + "activity": "aktywność" } } }, diff --git a/translations/ru.json b/translations/ru.json index 937cd379b5..f8b44f6102 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -145,7 +145,8 @@ "high_demand": "Большая нагрузка", "heat_pump": "Тепловой насос", "gas": "Газовый", - "manual": "Ручной режим" + "manual": "Ручной режим", + "heat_cool": "Авто" }, "configurator": { "configure": "Настроить", @@ -1122,7 +1123,8 @@ "fan_mode": "Режим вентилятора", "swing_mode": "Режим качания", "away_mode": "Режим ожидания", - "aux_heat": "Дополнительный нагрев" + "aux_heat": "Дополнительный нагрев", + "preset_mode": "Режим" }, "lock": { "code": "Код", @@ -1267,6 +1269,16 @@ "off": "Выкл", "on": "Вкл", "auto": "Авто" + }, + "preset_mode": { + "none": "Не выбран", + "eco": "Экономия", + "away": "Не дома", + "boost": "Турбо", + "comfort": "Комфорт", + "home": "Дома", + "sleep": "Сон", + "activity": "Активность" } } }, diff --git a/translations/sk.json b/translations/sk.json index c9ca69a3c2..6e7488b87a 100644 --- a/translations/sk.json +++ b/translations/sk.json @@ -145,7 +145,8 @@ "high_demand": "Vysoký výkon", "heat_pump": "Tepelné čerpadlo", "gas": "Plyn", - "manual": "Ručne" + "manual": "Ručne", + "heat_cool": "Auto" }, "configurator": { "configure": "Konfigurovať", @@ -359,8 +360,8 @@ "core_config": { "edit_requires_storage": "Editor je zablokovaný, pretože konfigurácia je uložená v configuration.yaml", "location_name": "Názov vašej Home Assistant inštalácie", - "latitude": "zemepisná šírka", - "longitude": "zemepisná dĺžka", + "latitude": "Zemepisná šírka", + "longitude": "Zemepisná dĺžka", "elevation": "Nadmorská výška", "elevation_meters": "metrov", "time_zone": "Časové pásmo", @@ -909,9 +910,9 @@ "picture-elements": { "hold": "Držať:", "tap": "Ťuknite:", - "navigate_to": "Navigovať do {Location}", + "navigate_to": "Navigovať do {location}", "toggle": "Prepnúť {name}", - "call_service": "Zavolať službu", + "call_service": "Zavolať službu {name}", "more_info": "Zobraziť viac informácií: {name}" } }, @@ -971,6 +972,49 @@ "refresh": "Obnoviť" }, "reload_lovelace": "Znovu načítať Lovelace" + }, + "page-demo": { + "cards": { + "demo": { + "demo_by": "podľa {name}", + "next_demo": "Ďalšie demo", + "introduction": "Vitaj ! Dostali ste sa na demo Home Assistanta, kde prezentujeme najlepšie používateľské rozhrania vytvorené našou komunitou.", + "learn_more": "Získajte viac informácií o Home asistentovi" + } + }, + "config": { + "arsaboo": { + "names": { + "upstairs": "Poschodie", + "family_room": "Obývacia izba", + "kitchen": "Kuchyňa", + "patio": "Terasa", + "hallway": "Chodba", + "master_bedroom": "Spálňa", + "left": "Vľavo", + "right": "Vpravo", + "mirror": "Zrkadlenie" + }, + "labels": { + "lights": "Svetlá", + "information": "Informácie", + "morning_commute": "Ranné dochádzanie", + "commute_home": "Dochádzanie domov", + "entertainment": "Zábava", + "activity": "Aktivita", + "hdmi_input": "Vstup HDMI", + "hdmi_switcher": "HDMI prepínač", + "volume": "Hlasitosť", + "total_tv_time": "Celkový čas sledovanie TV", + "turn_tv_off": "Vypnúť TV", + "air": "Vzduch" + }, + "unit": { + "watching": "Sledovanie", + "minutes_abbr": "Min" + } + } + } } }, "sidebar": { @@ -1079,7 +1123,8 @@ "fan_mode": "Režim ventilátora", "swing_mode": "Vejárový režim", "away_mode": "Režim neprítomnosti", - "aux_heat": "Prídavné kúrenie" + "aux_heat": "Prídavné kúrenie", + "preset_mode": "Predvoľba" }, "lock": { "code": "Kód", @@ -1224,6 +1269,16 @@ "off": "Vypnutý", "on": "Zapnutý", "auto": "Auto" + }, + "preset_mode": { + "none": "None", + "eco": "Eko", + "away": "Preč", + "boost": "Turbo", + "comfort": "Komfort", + "home": "Doma", + "sleep": "Pohotovostný režim", + "activity": "Aktívny" } } }, diff --git a/translations/sl.json b/translations/sl.json index b045d19f21..74c6bf0a56 100644 --- a/translations/sl.json +++ b/translations/sl.json @@ -145,7 +145,8 @@ "high_demand": "Visoka poraba", "heat_pump": "Toplotna črpalka", "gas": "Plin", - "manual": "Ročno" + "manual": "Ročno", + "heat_cool": "Samodejno" }, "configurator": { "configure": "Konfiguriraj", @@ -1122,7 +1123,8 @@ "fan_mode": "Način ventilatorja", "swing_mode": "Način Swing", "away_mode": "Način odsotnosti", - "aux_heat": "Dodatna toplota" + "aux_heat": "Dodatna toplota", + "preset_mode": "Prednastavitev" }, "lock": { "code": "Koda", @@ -1267,6 +1269,16 @@ "off": "Izključen", "on": "Vklopljen", "auto": "Samodejno" + }, + "preset_mode": { + "none": "Noben", + "eco": "Eko", + "away": "Odsoten", + "boost": "Povečanje", + "comfort": "Udobje", + "home": "Doma", + "sleep": "Spanje", + "activity": "Dejavnost" } } }, diff --git a/translations/zh-Hans.json b/translations/zh-Hans.json index ee8a092a69..c3d196ef6a 100644 --- a/translations/zh-Hans.json +++ b/translations/zh-Hans.json @@ -132,7 +132,7 @@ }, "climate": { "off": "关", - "on": "开启", + "on": "开", "heat": "制热", "cool": "制冷", "idle": "待机", @@ -145,7 +145,8 @@ "high_demand": "高需求", "heat_pump": "热泵", "gas": "燃气", - "manual": "手动" + "manual": "手动", + "heat_cool": "自动" }, "configurator": { "configure": "设置", @@ -163,8 +164,8 @@ "not_home": "离开" }, "fan": { - "off": "关闭", - "on": "开启" + "off": "关", + "on": "开" }, "group": { "off": "关闭", @@ -182,8 +183,8 @@ "problem": "异常" }, "input_boolean": { - "off": "关闭", - "on": "开启" + "off": "关", + "on": "开" }, "light": { "off": "关", @@ -194,8 +195,8 @@ "unlocked": "解锁" }, "media_player": { - "off": "关闭", - "on": "开启", + "off": "关", + "on": "开", "playing": "正在播放", "paused": "已暂停", "idle": "空闲", @@ -206,19 +207,19 @@ "problem": "异常" }, "remote": { - "off": "关闭", - "on": "开启" + "off": "关", + "on": "开" }, "scene": { "scening": "场景启用中" }, "script": { - "off": "关闭", - "on": "开启" + "off": "关", + "on": "开" }, "sensor": { - "off": "关闭", - "on": "开启" + "off": "关", + "on": "开" }, "sun": { "above_horizon": "日出", @@ -984,6 +985,7 @@ "config": { "arsaboo": { "names": { + "upstairs": "二楼", "family_room": "客厅", "kitchen": "厨房", "patio": "露台", @@ -998,7 +1000,18 @@ "information": "信息", "morning_commute": "上班", "commute_home": "下班", - "entertainment": "娱乐" + "entertainment": "娱乐", + "activity": "活动", + "hdmi_input": "HDMI输入", + "hdmi_switcher": "HDMI切换", + "volume": "音量", + "total_tv_time": "观看总时长", + "turn_tv_off": "关闭电视", + "air": "换气" + }, + "unit": { + "watching": "观看", + "minutes_abbr": "分" } } } @@ -1110,7 +1123,8 @@ "fan_mode": "风速", "swing_mode": "扫风模式", "away_mode": "离开模式", - "aux_heat": "辅热" + "aux_heat": "辅热", + "preset_mode": "预设" }, "lock": { "code": "密码", @@ -1255,6 +1269,16 @@ "off": "关", "on": "开", "auto": "自动" + }, + "preset_mode": { + "none": "无", + "eco": "节能", + "away": "离家", + "boost": "强力", + "comfort": "舒适", + "home": "在家", + "sleep": "睡眠", + "activity": "活动" } } }, diff --git a/translations/zh-Hant.json b/translations/zh-Hant.json index eb64c98eb7..8d24ca4c25 100644 --- a/translations/zh-Hant.json +++ b/translations/zh-Hant.json @@ -136,7 +136,7 @@ "heat": "暖氣", "cool": "冷氣", "idle": "待命", - "auto": "自動模式", + "auto": "自動", "dry": "除濕模式", "fan_only": "僅送風", "eco": "節能模式", @@ -145,7 +145,8 @@ "high_demand": "高用量", "heat_pump": "暖氣", "gas": "瓦斯模式", - "manual": "手動" + "manual": "手動", + "heat_cool": "自動" }, "configurator": { "configure": "設定", @@ -1000,7 +1001,7 @@ "morning_commute": "晨間通勤", "commute_home": "返家通勤", "entertainment": "視聽室", - "activity": "活動", + "activity": "模式", "hdmi_input": "HDMI 輸入", "hdmi_switcher": "HDMI 切換器", "volume": "音量", @@ -1122,7 +1123,8 @@ "fan_mode": "風速模式", "swing_mode": "擺動模式", "away_mode": "外出模式", - "aux_heat": "輔助暖氣" + "aux_heat": "輔助暖氣", + "preset_mode": "預置" }, "lock": { "code": "密碼", @@ -1266,7 +1268,17 @@ "fan_mode": { "off": "關閉", "on": "開啟", - "auto": "自動模式" + "auto": "自動" + }, + "preset_mode": { + "none": "無", + "eco": "節能", + "away": "離家", + "boost": "全速", + "comfort": "舒適", + "home": "在家", + "sleep": "睡眠", + "activity": "活動" } } }, From 14a430a059096f074bb218aa0a79d2a1411f0d20 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 10 Jul 2019 09:36:44 -0700 Subject: [PATCH 6/8] Bumped version to 20190710.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 44c83bb9e0..d90b10390c 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20190705.0", + version="20190710.0", description="The Home Assistant frontend", url="https://github.com/home-assistant/home-assistant-polymer", author="The Home Assistant Authors", From 5d8e34e8bec654baf9a2dcbff092040de29dbcf2 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 10 Jul 2019 10:10:56 -0700 Subject: [PATCH 7/8] Show menu button when Hassio supervisor UI runs on old HA (#3347) --- src/components/ha-menu-button.ts | 16 +++++++++++++++- src/entrypoints/app.ts | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/ha-menu-button.ts b/src/components/ha-menu-button.ts index 1930eb608e..15a5887adb 100644 --- a/src/components/ha-menu-button.ts +++ b/src/components/ha-menu-button.ts @@ -21,6 +21,7 @@ class HaMenuButton extends LitElement { @property() public narrow!: boolean; @property() public hass!: HomeAssistant; @property() private _hasNotifications = false; + private _alwaysVisible = false; private _attachNotifOnConnect = false; private _unsubNotifications?: UnsubscribeFunc; @@ -62,6 +63,18 @@ class HaMenuButton extends LitElement { `; } + protected firstUpdated(changedProps) { + super.firstUpdated(changedProps); + if (!this.hassio) { + return; + } + // This component is used on Hass.io too, but Hass.io might run the UI + // on older frontends too, that don't have an always visible menu button + // in the sidebar. + this._alwaysVisible = + (Number((window.parent as any).frontendVersion) || 0) >= 20190710; + } + protected updated(changedProps) { super.updated(changedProps); @@ -69,7 +82,8 @@ class HaMenuButton extends LitElement { return; } - this.style.visibility = this.narrow ? "initial" : "hidden"; + this.style.visibility = + this.narrow || this._alwaysVisible ? "initial" : "hidden"; if (!this.narrow) { this._hasNotifications = false; diff --git a/src/entrypoints/app.ts b/src/entrypoints/app.ts index c73fc24187..47147e49e0 100644 --- a/src/entrypoints/app.ts +++ b/src/entrypoints/app.ts @@ -16,3 +16,5 @@ import "../layouts/home-assistant"; setPassiveTouchGestures(true); /* LastPass createElement workaround. See #428 */ document.createElement = Document.prototype.createElement; + +(window as any).frontendVersion = __VERSION__; From 60c2bcc4831f481c31df1180fc9b6be699df5b19 Mon Sep 17 00:00:00 2001 From: Charles Garwood Date: Wed, 10 Jul 2019 13:26:17 -0400 Subject: [PATCH 8/8] Convert Z-Wave panel to TS/Lit (#3345) * Convert zwave-network to typescript/lit * Convert zwave-network to ts/lit * Updates per code review * missed one (hass? => hass!) * Remove constructor --- .../{zwave-network.js => zwave-network.ts} | 379 +++++++++--------- 1 file changed, 198 insertions(+), 181 deletions(-) rename src/panels/config/zwave/{zwave-network.js => zwave-network.ts} (69%) diff --git a/src/panels/config/zwave/zwave-network.js b/src/panels/config/zwave/zwave-network.ts similarity index 69% rename from src/panels/config/zwave/zwave-network.js rename to src/panels/config/zwave/zwave-network.ts index 65c0b076ad..aeed3c23c0 100644 --- a/src/panels/config/zwave/zwave-network.js +++ b/src/panels/config/zwave/zwave-network.ts @@ -1,6 +1,17 @@ import "@polymer/paper-icon-button/paper-icon-button"; -import { html } from "@polymer/polymer/lib/utils/html-tag"; -import { PolymerElement } from "@polymer/polymer/polymer-element"; + +import { + css, + CSSResult, + customElement, + html, + LitElement, + property, + TemplateResult, +} from "lit-element"; + +import { haStyle } from "../../../resources/styles"; +import { HomeAssistant } from "../../../types"; import "../../../components/buttons/ha-call-api-button"; import "../../../components/buttons/ha-call-service-button"; @@ -8,10 +19,184 @@ import "../../../components/ha-service-description"; import "../../../components/ha-card"; import "../ha-config-section"; -class ZwaveNetwork extends PolymerElement { - static get template() { +@customElement("zwave-network") +export class ZwaveNetwork extends LitElement { + @property() public hass!: HomeAssistant; + @property() public isWide!: boolean; + @property() private _showHelp = false; + + protected render(): TemplateResult | void { return html` - - -
- Z-Wave Network Management - -
- - Run commands that affect the Z-Wave network. You won't get feedback on - whether the command succeeded, but you can look in the OZW Log to try - to figure out. - - - -
- - Add Node Secure - - - - - - Add Node - - - - - - Remove Node - - - -
-
- - Cancel Command - - - -
-
- - Heal Network - - - - Start Network - - - - - - Stop Network - - - - - - Soft Reset - - - - - - Test Network - - - - - - Save Config - -
-
-
- `; - } - - static get properties() { - return { - hass: Object, - - isWide: { - type: Boolean, - value: false, - }, - - showDescription: { - type: Boolean, - value: false, - }, - }; - } - - helpTap() { - this.showDescription = !this.showDescription; + `, + ]; } } -customElements.define("zwave-network", ZwaveNetwork); +declare global { + interface HTMLElementTagNameMap { + "zwave-network": ZwaveNetwork; + } +}