diff --git a/setup.py b/setup.py index 19507c138e..ce624d6f53 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20190820.0", + version="20190820.1", description="The Home Assistant frontend", url="https://github.com/home-assistant/home-assistant-polymer", author="The Home Assistant Authors", diff --git a/src/data/config_flow.ts b/src/data/config_flow.ts index 45f401a91c..d415524d8d 100644 --- a/src/data/config_flow.ts +++ b/src/data/config_flow.ts @@ -1,7 +1,7 @@ import { HomeAssistant } from "../types"; import { DataEntryFlowStep, DataEntryFlowProgress } from "./data_entry_flow"; import { debounce } from "../common/util/debounce"; -import { createCollection } from "home-assistant-js-websocket"; +import { getCollection, Connection } from "home-assistant-js-websocket"; import { LocalizeFunc } from "../common/translations/localize"; export const createConfigFlow = (hass: HomeAssistant, handler: string) => @@ -29,9 +29,6 @@ export const handleConfigFlowStep = ( export const deleteConfigFlow = (hass: HomeAssistant, flowId: string) => hass.callApi("DELETE", `config/config_entries/flow/${flowId}`); -export const getConfigFlowsInProgress = (hass: HomeAssistant) => - hass.callApi("GET", "config/config_entries/flow"); - export const getConfigFlowHandlers = (hass: HomeAssistant) => hass.callApi("GET", "config/config_entries/flow_handlers"); @@ -53,17 +50,18 @@ const subscribeConfigFlowInProgressUpdates = (conn, store) => "config_entry_discovered" ); +export const getConfigFlowInProgressCollection = (conn: Connection) => + getCollection( + conn, + "_configFlowProgress", + fetchConfigFlowInProgress, + subscribeConfigFlowInProgressUpdates + ); + export const subscribeConfigFlowInProgress = ( hass: HomeAssistant, onChange: (flows: DataEntryFlowProgress[]) => void -) => - createCollection( - "_configFlowProgress", - fetchConfigFlowInProgress, - subscribeConfigFlowInProgressUpdates, - hass.connection, - onChange - ); +) => getConfigFlowInProgressCollection(hass.connection).subscribe(onChange); export const localizeConfigFlowTitle = ( localize: LocalizeFunc, diff --git a/src/onboarding/onboarding-integrations.ts b/src/onboarding/onboarding-integrations.ts index 1919b98d37..cd387b78a3 100644 --- a/src/onboarding/onboarding-integrations.ts +++ b/src/onboarding/onboarding-integrations.ts @@ -18,14 +18,14 @@ import { getConfigEntries, ConfigEntry } from "../data/config_entries"; import { compare } from "../common/string/compare"; import "./integration-badge"; import { LocalizeFunc } from "../common/translations/localize"; -import { debounce } from "../common/util/debounce"; import { fireEvent } from "../common/dom/fire_event"; import { onboardIntegrationStep } from "../data/onboarding"; import { genClientId } from "home-assistant-js-websocket"; import { DataEntryFlowProgress } from "../data/data_entry_flow"; import { localizeConfigFlowTitle, - getConfigFlowsInProgress, + subscribeConfigFlowInProgress, + getConfigFlowInProgressCollection, } from "../data/config_flow"; @customElement("onboarding-integrations") @@ -38,20 +38,16 @@ class OnboardingIntegrations extends LitElement { public connectedCallback() { super.connectedCallback(); - this.hass.connection - .subscribeEvents( - debounce(() => this._loadData(), 500), - "config_entry_discovered" - ) - .then((unsub) => { - this._unsubEvents = unsub; - }); + this._unsubEvents = subscribeConfigFlowInProgress(this.hass, (flows) => { + this._discovered = flows; + }); } public disconnectedCallback() { super.disconnectedCallback(); if (this._unsubEvents) { this._unsubEvents(); + this._unsubEvents = undefined; } } @@ -126,30 +122,32 @@ class OnboardingIntegrations extends LitElement { protected firstUpdated(changedProps: PropertyValues) { super.firstUpdated(changedProps); loadConfigFlowDialog(); - this._loadData(); + this._loadConfigEntries(); /* polyfill for paper-dropdown */ import(/* webpackChunkName: "polyfill-web-animations-next" */ "web-animations-js/web-animations-next-lite.min"); } private _createFlow() { showConfigFlowDialog(this, { - dialogClosedCallback: () => this._loadData(), + dialogClosedCallback: () => { + this._loadConfigEntries(); + getConfigFlowInProgressCollection(this.hass!.connection).refresh(); + }, }); } private _continueFlow(ev) { showConfigFlowDialog(this, { continueFlowId: ev.currentTarget.flowId, - dialogClosedCallback: () => this._loadData(), + dialogClosedCallback: () => { + this._loadConfigEntries(); + getConfigFlowInProgressCollection(this.hass!.connection).refresh(); + }, }); } - private async _loadData() { - const [discovered, entries] = await Promise.all([ - getConfigFlowsInProgress(this.hass!), - getConfigEntries(this.hass!), - ]); - this._discovered = discovered; + private async _loadConfigEntries() { + const entries = await getConfigEntries(this.hass!); // We filter out the config entry for the local weather. // It is one that we create automatically and it will confuse the user // if it starts showing up during onboarding. diff --git a/src/panels/config/integrations/ha-config-integrations.ts b/src/panels/config/integrations/ha-config-integrations.ts index 2af6ba4d69..39a240bbb3 100644 --- a/src/panels/config/integrations/ha-config-integrations.ts +++ b/src/panels/config/integrations/ha-config-integrations.ts @@ -24,7 +24,10 @@ import { } from "../../../data/device_registry"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { DataEntryFlowProgress } from "../../../data/data_entry_flow"; -import { subscribeConfigFlowInProgress } from "../../../data/config_flow"; +import { + subscribeConfigFlowInProgress, + getConfigFlowInProgressCollection, +} from "../../../data/config_flow"; declare global { interface HASSDomEvents { @@ -79,7 +82,10 @@ class HaConfigIntegrations extends HassRouterPage { protected firstUpdated(changedProps) { super.firstUpdated(changedProps); - this.addEventListener("hass-reload-entries", () => this._loadData()); + this.addEventListener("hass-reload-entries", () => { + this._loadData(); + getConfigFlowInProgressCollection(this.hass.connection).refresh(); + }); } protected updated(changedProps: PropertyValues) { diff --git a/translations/da.json b/translations/da.json index 7c2465b3bd..ad2301b4e3 100644 --- a/translations/da.json +++ b/translations/da.json @@ -747,7 +747,8 @@ "unavailable": "Denne enhed er ikke tilgængelig i øjeblikket.", "default_name": "Nyt område", "delete": "SLET", - "update": "OPDATER" + "update": "OPDATER", + "enabled_label": "Aktivér enhed" } }, "person": { @@ -1302,6 +1303,9 @@ "success": { "description": "Indstillingerne blev gemt." } + }, + "config_entry_system_options": { + "title": "Systemindstillinger" } }, "auth_store": { @@ -1397,5 +1401,11 @@ "system-admin": "Administratorer", "system-users": "Brugere", "system-read-only": "Read-Only-brugere" + }, + "config_entry": { + "disabled_by": { + "user": "Bruger", + "integration": "Integration" + } } } \ No newline at end of file diff --git a/translations/en.json b/translations/en.json index 9e5d996d18..a63d886387 100644 --- a/translations/en.json +++ b/translations/en.json @@ -747,7 +747,10 @@ "unavailable": "This entity is not currently available.", "default_name": "New Area", "delete": "DELETE", - "update": "UPDATE" + "update": "UPDATE", + "enabled_label": "Enable entity", + "enabled_cause": "Disabled by {cause}.", + "enabled_description": "Disabled entities will not be added to Home Assistant." } }, "person": { @@ -1302,6 +1305,11 @@ "success": { "description": "Options successfully saved." } + }, + "config_entry_system_options": { + "title": "System Options", + "enable_new_entities_label": "Enable newly added entities.", + "enable_new_entities_description": "If disabled, newly discovered entities will not be automatically added to Home Assistant." } }, "auth_store": { @@ -1397,5 +1405,12 @@ "system-admin": "Administrators", "system-users": "Users", "system-read-only": "Read-Only Users" + }, + "config_entry": { + "disabled_by": { + "user": "User", + "integration": "Integration", + "config_entry": "Config Entry" + } } } \ No newline at end of file diff --git a/translations/hu.json b/translations/hu.json index 31b8ad79d8..3e5c61db88 100644 --- a/translations/hu.json +++ b/translations/hu.json @@ -743,7 +743,10 @@ "unavailable": "Ez az entitás jelenleg nem elérhető.", "default_name": "Új Terület", "delete": "TÖRLÉS", - "update": "FRISSÍTÉS" + "update": "FRISSÍTÉS", + "enabled_label": "Entitás engedélyezése", + "enabled_cause": "Letiltva. ({cause})", + "enabled_description": "A letiltott entitások nem lesznek hozzáadva a Home Assistant-hoz." } }, "person": { @@ -773,7 +776,8 @@ "core": "Mag újratöltése", "group": "Csoportok újratöltése", "automation": "Automatizálások újratöltése", - "script": "Szkriptek újratöltése" + "script": "Szkriptek újratöltése", + "scene": "Jelenetek újratöltése" }, "server_management": { "heading": "Szerver menedzsment", @@ -1289,6 +1293,19 @@ "updater": { "title": "Frissítési Instrukciók" } + }, + "options_flow": { + "form": { + "header": "Opciók" + }, + "success": { + "description": "Beállítások sikeresen mentve." + } + }, + "config_entry_system_options": { + "title": "Rendszerbeállítások", + "enable_new_entities_label": "Az újonnan hozzáadott entitások engedélyezése.", + "enable_new_entities_description": "Ha le van tiltva, akkor az újonnan felfedezett entitások nem lesznek automatikusan hozzáadva a Home Assistant-hoz." } }, "auth_store": { @@ -1384,5 +1401,12 @@ "system-admin": "Adminisztrátorok", "system-users": "Felhasználók", "system-read-only": "Csak olvasható felhasználók" + }, + "config_entry": { + "disabled_by": { + "user": "Felhasználó", + "integration": "Integráció", + "config_entry": "Konfigurációs bejegyzés" + } } } \ No newline at end of file diff --git a/translations/lb.json b/translations/lb.json index 9405995cf2..1158676f35 100644 --- a/translations/lb.json +++ b/translations/lb.json @@ -747,7 +747,10 @@ "unavailable": "Dës Entitéit ass net erreechbar fir de Moment.", "default_name": "Neie Beräich", "delete": "Läschen", - "update": "Aktualiséieren" + "update": "Aktualiséieren", + "enabled_label": "Entitéit aktivéieren", + "enabled_cause": "Desaktivéiert duerch {cause}.", + "enabled_description": "Desaktivéiert Entitéiten ginn net am Home Assistant bäigesat." } }, "person": { @@ -1302,6 +1305,9 @@ "success": { "description": "Optiounen erfollegräich gespäichert." } + }, + "config_entry_system_options": { + "title": "System Optiounen" } }, "auth_store": { @@ -1397,5 +1403,11 @@ "system-admin": "Administrateuren", "system-users": "Benotzer", "system-read-only": "Benotzer mat nëmmen Lies Rechter" + }, + "config_entry": { + "disabled_by": { + "user": "Benotzer", + "integration": "Integratioun" + } } } \ No newline at end of file diff --git a/translations/nb.json b/translations/nb.json index 47a8df056c..2b5a8cf08d 100644 --- a/translations/nb.json +++ b/translations/nb.json @@ -747,7 +747,10 @@ "unavailable": "Denne enheten er ikke tilgjengelig for øyeblikket.", "default_name": "Nytt område", "delete": "SLETT", - "update": "OPPDATER" + "update": "OPPDATER", + "enabled_label": "Aktiver enhet", + "enabled_cause": "Deaktivert av {Cause}.", + "enabled_description": "Deaktiverte enheter vil ikke bli lagt til i Home Assistant." } }, "person": { @@ -1294,6 +1297,19 @@ "updater": { "title": "Oppdateringsanvisning" } + }, + "options_flow": { + "form": { + "header": "Alternativer" + }, + "success": { + "description": "Alternativene er lagret." + } + }, + "config_entry_system_options": { + "title": "Systemalternativer", + "enable_new_entities_label": "Aktiver enheter som nylig er lagt til.", + "enable_new_entities_description": "Hvis den er deaktivert, vil ikke nyoppdagede enheter automatisk bli lagt til i Home Assistant." } }, "auth_store": { @@ -1389,5 +1405,12 @@ "system-admin": "Administratorer", "system-users": "Brukere", "system-read-only": "Brukere med lesetilgang" + }, + "config_entry": { + "disabled_by": { + "user": "Bruker", + "integration": "Integrering", + "config_entry": "Konfigurer oppføring" + } } } \ No newline at end of file diff --git a/translations/nl.json b/translations/nl.json index 5a4ec37f02..42f7fe279e 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -349,7 +349,7 @@ "introduction": "Hier kun je je componenten en Home Assistant configureren. Het is nog niet mogelijk om alles te configureren vanuit de interface, maar we werken er aan.", "core": { "caption": "Algemeen", - "description": "Wijzig je algemene Home Assistant configuratie", + "description": "Wijzig je algemene Home Assistant-configuratie", "section": { "core": { "header": "Algemene Configuratie", @@ -408,7 +408,7 @@ "description": "Het maken en bewerken van automatiseringen", "picker": { "header": "Automatiseringsbewerker", - "introduction": "Met de automatiseringsbewerker kun je automatiseringen maken en bewerken. Lees [de instructies](https:\/\/home-assistant.io\/docs\/automation\/editor\/) om er zeker van te zijn dat je Home Assistant juist hebt geconfigureerd.", + "introduction": "Met de automatiseringsbewerker kun je automatiseringen maken en bewerken. Volg de link hieronder om er zeker van te zijn dat je Home Assistant juist hebt geconfigureerd.", "pick_automation": "Kies te bewerken automatisering", "no_automations": "We konden geen bewerkbare automatiseringen vinden", "add_automation": "Automatisering toevoegen", @@ -422,7 +422,7 @@ "alias": "Naam", "triggers": { "header": "", - "introduction": "Triggers starten de verwerking van een automatiseringsregel. Het is mogelijk om meerdere triggers voor dezelfde regel op te geven. Zodra een trigger start, valideert Home Assistant de eventuele voorwaarden en roept hij de actie aan. \n\n [Meer informatie over triggers.] (https:\/\/home-assistant.io\/docs\/automation\/trigger\/)", + "introduction": "Triggers starten de verwerking van een automatiseringsregel. Het is mogelijk om meerdere triggers voor dezelfde regel op te geven. Zodra een trigger start, valideert Home Assistant de eventuele voorwaarden en roept hij de actie aan.", "add": "Trigger toevoegen", "duplicate": "Dupliceren", "delete": "Verwijderen", @@ -504,7 +504,7 @@ }, "conditions": { "header": "Voorwaarden", - "introduction": "Voorwaarden zijn een optioneel onderdeel van een automatiseringsregel en kunnen worden gebruikt om te voorkomen dat een actie plaatsvindt wanneer deze wordt geactiveerd. Voorwaarden lijken erg op triggers, maar zijn verschillend. Een trigger zal kijken naar gebeurtenissen die in het systeem plaatsvinden, terwijl een voorwaarde alleen kijkt naar hoe het systeem er op dit moment uitziet. Een trigger kan waarnemen dat een schakelaar wordt ingeschakeld. Een voorwaarde kan alleen zien of een schakelaar aan of uit staat. \n\n [Meer informatie over voorwaarden.] (Https:\/\/home-assistant.io\/docs\/scripts\/conditions\/)", + "introduction": "Voorwaarden zijn een optioneel onderdeel van een automatiseringsregel en kunnen worden gebruikt om te voorkomen dat een actie plaatsvindt wanneer deze wordt geactiveerd. Voorwaarden lijken erg op triggers, maar zijn verschillend. Een trigger zal kijken naar gebeurtenissen die in het systeem plaatsvinden, terwijl een voorwaarde alleen kijkt naar hoe het systeem er op dit moment uitziet. Een trigger kan waarnemen dat een schakelaar wordt ingeschakeld. Een voorwaarde kan alleen zien of een schakelaar aan of uit staat.", "add": "Voorwaarde toevoegen", "duplicate": "Dupliceren", "delete": "Verwijderen", @@ -550,7 +550,7 @@ }, "actions": { "header": "Acties", - "introduction": "De acties zijn wat Home Assistant zal doen wanneer de automatisering wordt geactiveerd. \n\n [Lees meer over acties.] (https:\/\/home-assistant.io\/docs\/automation\/action\/)", + "introduction": "De acties zijn wat Home Assistant zal doen wanneer de automatisering wordt geactiveerd.", "add": "Actie toevoegen", "duplicate": "Dupliceer", "delete": "Verwijderen", @@ -602,7 +602,7 @@ "network_starting": "Z-Wave netwerk starten...", "network_starting_note": "Dit kan een tijdje duren, afhankelijk van de grootte van uw netwerk.", "network_started": "Z-Wave netwerk gestart", - "network_started_note_some_queried": "Alle actieve nodes zijn opgevraagd. Inactieve nodes worden opgevraagd wanneer ze actiefworden.", + "network_started_note_some_queried": "Alle actieve nodes zijn opgevraagd. Inactieve nodes worden opgevraagd wanneer ze actief worden.", "network_started_note_all_queried": "Alle nodes zijn opgevraagd." }, "services": { @@ -622,7 +622,7 @@ "instance": "Exemplaar", "index": "Index", "unknown": "onbekend", - "wakeup_interval": "Activerings interval" + "wakeup_interval": "Activeringsinterval" }, "values": { "header": "Knooppunt waarden" @@ -747,7 +747,10 @@ "unavailable": "Deze entiteit is momenteel niet beschikbaar.", "default_name": "Nieuw Gebied", "delete": "VERWIJDEREN", - "update": "BIJWERKEN" + "update": "BIJWERKEN", + "enabled_label": "Schakel entiteit in", + "enabled_cause": "Uitgeschakeld vanwege {cause}", + "enabled_description": "Uitgeschakelde entiteiten zullen niet aan Home Assistant worden toegevoegd" } }, "person": { @@ -951,7 +954,7 @@ }, "error": { "invalid_auth": "Ongeldige gebruikersnaam of wachtwoord", - "invalid_code": "Onjuiste authenticatie code" + "invalid_code": "Onjuiste authenticatiecode" }, "abort": { "login_expired": "Sessie verlopen, meldt u opnieuw aan." @@ -1302,6 +1305,11 @@ "success": { "description": "Instellingen succesvol opgeslagen." } + }, + "config_entry_system_options": { + "title": "Systeemopties", + "enable_new_entities_label": "Voeg nieuwe entiteiten automatisch toe", + "enable_new_entities_description": "Indien uitgeschakeld, zullen entiteiten niet aan Home Assistant worden toegevoegd" } }, "auth_store": { @@ -1397,5 +1405,12 @@ "system-admin": "Beheerders", "system-users": "Gebruikers", "system-read-only": "Alleen-lezen gebruikers" + }, + "config_entry": { + "disabled_by": { + "user": "Gebruiker", + "integration": "Integratie", + "config_entry": "Configuratie-item" + } } } \ No newline at end of file diff --git a/translations/ru.json b/translations/ru.json index 4041fa9473..5530b974be 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -1302,6 +1302,9 @@ "success": { "description": "Параметры успешно сохранены." } + }, + "config_entry_system_options": { + "title": "Системные настройки" } }, "auth_store": { @@ -1397,5 +1400,11 @@ "system-admin": "Администраторы", "system-users": "Пользователи", "system-read-only": "Системные пользователи" + }, + "config_entry": { + "disabled_by": { + "user": "Пользователь", + "integration": "Интеграция" + } } } \ No newline at end of file