From 2694ead6c319b1303bce56c656072e0cca7dd520 Mon Sep 17 00:00:00 2001 From: eifinger Date: Tue, 19 Oct 2021 20:32:07 +0200 Subject: [PATCH] Update deps --- .../alexa_media/.translations/de.json | 14 +-- .../alexa_media/.translations/en.json | 14 +-- .../alexa_media/.translations/es.json | 14 +-- .../alexa_media/.translations/fr.json | 18 ++-- .../alexa_media/.translations/it.json | 36 +++---- .../alexa_media/.translations/nb.json | 14 +-- .../alexa_media/.translations/nl.json | 14 +-- .../alexa_media/.translations/pl.json | 22 ++--- .../alexa_media/.translations/pt_BR.json | 18 ++-- .../alexa_media/.translations/pt_PT.json | 14 +-- .../alexa_media/.translations/ru.json | 14 +-- .../alexa_media/.translations/zh-Hans.json | 18 ++-- custom_components/alexa_media/const.py | 2 +- custom_components/alexa_media/manifest.json | 4 +- custom_components/alexa_media/sensor.py | 2 +- custom_components/alexa_media/switch.py | 2 +- .../alexa_media/translations/de.json | 14 +-- .../alexa_media/translations/en.json | 14 +-- .../alexa_media/translations/es.json | 14 +-- .../alexa_media/translations/fr.json | 18 ++-- .../alexa_media/translations/it.json | 36 +++---- .../alexa_media/translations/nb.json | 14 +-- .../alexa_media/translations/nl.json | 14 +-- .../alexa_media/translations/pl.json | 22 ++--- .../alexa_media/translations/pt_BR.json | 18 ++-- .../alexa_media/translations/pt_PT.json | 14 +-- .../alexa_media/translations/ru.json | 14 +-- .../alexa_media/translations/zh-Hans.json | 18 ++-- custom_components/weenect/__init__.py | 8 +- custom_components/weenect/config_flow.py | 6 +- custom_components/weenect/const.py | 2 +- custom_components/weenect/device_tracker.py | 90 +++++++++++++++-- custom_components/weenect/sensor.py | 17 ++-- custom_components/weenect/services.py | 99 ++----------------- custom_components/weenect/services.yaml | 47 +++++---- custom_components/weenect/util.py | 2 +- 36 files changed, 350 insertions(+), 351 deletions(-) diff --git a/custom_components/alexa_media/.translations/de.json b/custom_components/alexa_media/.translations/de.json index 3127aa2..15a6073 100644 --- a/custom_components/alexa_media/.translations/de.json +++ b/custom_components/alexa_media/.translations/de.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}** \nDen Zwei Faktor Pin eingeben. \n{message}", "title": "Alexa Media Player - Zwei Faktor Authentifizierung" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Erweitertes debugging", "email": "Email Adresse", "exclude_devices": "Ausgeschlossene Geräte (komma getrennnt)", + "hass_url": "Url to access Home Assistant", "include_devices": "Eingebundene Geräte (komma getrennnt)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -77,16 +78,15 @@ "securitycode": "2FA Code (empfohlen, um Anmeldeprobleme zu vermeiden)", "url": "Amazon Region (z.B., amazon.de)" }, - "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "Bitte geben Sie ihre Informationen ein.", + "title": "Alexa Media Player - Konfiguration" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Erweitertes debugging", "email": "Email Adresse", "exclude_devices": "Ausgeschlossene Geräte (komma getrennnt)", - "hass_url": "Url to access Home Assistant", "include_devices": "Eingebundene Geräte (komma getrennnt)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -96,8 +96,8 @@ "securitycode": "2FA Code (empfohlen, um Anmeldeprobleme zu vermeiden)", "url": "Amazon Region (z.B., amazon.de)" }, - "description": "Bitte geben Sie ihre Informationen ein.", - "title": "Alexa Media Player - Konfiguration" + "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/.translations/en.json b/custom_components/alexa_media/.translations/en.json index 4b0ea68..f52044a 100644 --- a/custom_components/alexa_media/.translations/en.json +++ b/custom_components/alexa_media/.translations/en.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}** \nEnter the One Time Password (OTP). \n{message}", "title": "Alexa Media Player - Two Factor Authentication" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "Cookies.txt data", "debug": "Advanced debugging", "email": "Email Address", "exclude_devices": "Excluded device (comma separated)", + "hass_url": "Url to access Home Assistant", "include_devices": "Included device (comma separated)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -77,16 +78,15 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Amazon region domain (e.g., amazon.co.uk)" }, - "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "Please confirm the information below. For legacy configuration, disable `Use Login Proxy method` option.", + "title": "Alexa Media Player - Configuration" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "Cookies.txt data", "debug": "Advanced debugging", "email": "Email Address", "exclude_devices": "Excluded device (comma separated)", - "hass_url": "Url to access Home Assistant", "include_devices": "Included device (comma separated)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -96,8 +96,8 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Amazon region domain (e.g., amazon.co.uk)" }, - "description": "Please confirm the information below. For legacy configuration, disable `Use Login Proxy method` option.", - "title": "Alexa Media Player - Configuration" + "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/.translations/es.json b/custom_components/alexa_media/.translations/es.json index eabeb59..d1ddc7a 100644 --- a/custom_components/alexa_media/.translations/es.json +++ b/custom_components/alexa_media/.translations/es.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}** \nIngrese la contraseña de un solo uso (OTP). \n{message}", "title": "Alexa Media Player - Autenticación de dos factores" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "Datos de Cookies.txt", "debug": "Depuración avanzada", "email": "Dirección de correo electrónico", "exclude_devices": "Dispositivo excluido (separado por comas)", + "hass_url": "Url to access Home Assistant", "include_devices": "Dispositivo incluido (separado por comas)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -77,16 +78,15 @@ "securitycode": "Código 2FA (recomendado para evitar problemas de inicio de sesión)", "url": "Región del dominio de Amazon (por ejemplo, amazon.es)" }, - "description": "Por favor introduce tu [información](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **El método más rápido es [Importar cookies](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import).** \n**ADVERTENCIA: Amazon informará 'Introduce un correo electrónico o número de teléfono válido' si tu cuenta utiliza [códigos 2FA - Segundo Factor de Autenticación](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "Confirme la siguiente información. Para la configuración heredada, desactive la opción `Usar método de proxy de inicio de sesión`.", + "title": "Alexa Media Player - Configuración" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "Datos de Cookies.txt", "debug": "Depuración avanzada", "email": "Dirección de correo electrónico", "exclude_devices": "Dispositivo excluido (separado por comas)", - "hass_url": "Url to access Home Assistant", "include_devices": "Dispositivo incluido (separado por comas)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -96,8 +96,8 @@ "securitycode": "Código 2FA (recomendado para evitar problemas de inicio de sesión)", "url": "Región del dominio de Amazon (por ejemplo, amazon.es)" }, - "description": "Confirme la siguiente información. Para la configuración heredada, desactive la opción `Usar método de proxy de inicio de sesión`.", - "title": "Alexa Media Player - Configuración" + "description": "Por favor introduce tu [información](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **El método más rápido es [Importar cookies](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import).** \n**ADVERTENCIA: Amazon informará 'Introduce un correo electrónico o número de teléfono válido' si tu cuenta utiliza [códigos 2FA - Segundo Factor de Autenticación](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/.translations/fr.json b/custom_components/alexa_media/.translations/fr.json index 7bc3c14..6d73c4e 100644 --- a/custom_components/alexa_media/.translations/fr.json +++ b/custom_components/alexa_media/.translations/fr.json @@ -62,14 +62,15 @@ "description": "**{email} - alexa.{url}** \nEntrez le mot de passe unique (OTP). \n{message}", "title": "Alexa Media Player - Authentification à deux facteurs" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "Données cookies.txt", "debug": "Débogage avancé", "email": "Adresse Email", "exclude_devices": "Appareil exclu (séparé par des virgules)", + "hass_url": "Url to access Home Assistant", "include_devices": "Appareil inclus (séparé par des virgules)", - "oauth_login": "Activer la méthode d'application oauth-token", + "oauth_login": "Enable oauth-token app method", "otp_secret": "Clé d'application 2FA intégrée (génère automatiquement des codes 2FA)", "password": "Mot de passe", "proxy": "Use Login Proxy method (2FA not required)", @@ -77,18 +78,17 @@ "securitycode": "Code 2FA (recommandé pour éviter les problèmes de connexion)", "url": "Domaine de la région Amazon (exemple, amazon.fr)" }, - "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "Veuillez confirmer les informations ci-dessous. Pour la configuration héritée, désactivez l'option `Utiliser la méthode proxy de connexion`.", + "title": "Alexa Media Player - Configuration" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "Données cookies.txt", "debug": "Débogage avancé", "email": "Adresse Email", "exclude_devices": "Appareil exclu (séparé par des virgules)", - "hass_url": "Url to access Home Assistant", "include_devices": "Appareil inclus (séparé par des virgules)", - "oauth_login": "Enable oauth-token app method", + "oauth_login": "Activer la méthode d'application oauth-token", "otp_secret": "Clé d'application 2FA intégrée (génère automatiquement des codes 2FA)", "password": "Mot de passe", "proxy": "Use Login Proxy method (2FA not required)", @@ -96,8 +96,8 @@ "securitycode": "Code 2FA (recommandé pour éviter les problèmes de connexion)", "url": "Domaine de la région Amazon (exemple, amazon.fr)" }, - "description": "Veuillez confirmer les informations ci-dessous. Pour la configuration héritée, désactivez l'option `Utiliser la méthode proxy de connexion`.", - "title": "Alexa Media Player - Configuration" + "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/.translations/it.json b/custom_components/alexa_media/.translations/it.json index f7a88a2..8d0c899 100644 --- a/custom_components/alexa_media/.translations/it.json +++ b/custom_components/alexa_media/.translations/it.json @@ -62,24 +62,6 @@ "description": "**{email} - alexa.{url}** \nInserisci la password usa e getta (OTP). \n{message}", "title": "Alexa Media Player - Autenticazione a Due Fattori" }, - "user_legacy": { - "data": { - "cookies_txt": "config::step::user::data::cookies_txt", - "debug": "Debug avanzato", - "email": "Indirizzo email", - "exclude_devices": "Dispositivi da escludere (separati da virgola)", - "include_devices": "Dispositivi da includere (separati da virgola)", - "oauth_login": "Abilitare il metodo oauth-token app", - "otp_secret": "Chiave 2FA interna (genera automaticamente i codici 2FA)", - "password": "Password", - "proxy": "Usa il Proxy come metodo di login (2FA non richiesta)", - "scan_interval": "Tempo in secondi fra le scansioni", - "securitycode": "Codice 2FA (raccomandato per evitare problemi di login)", - "url": "Regione del dominio Amazon (e.g. amazon.it)" - }, - "description": "Prego inserisci le tue [informazioni](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) potrebbe essere più semplice!** \n**ATTENZIONE: Amazon risponde incorrettamente 'Inserire una mail valida o un numero di telefono' quando è richiesto il codice 2FA](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" - }, "user": { "data": { "cookies_txt": "Dati cookies.txt", @@ -98,6 +80,24 @@ }, "description": "Confermare le informazioni sottostanti. Per le vecchie configurazioni, disabilitare l'opzione `Usa Proxy come metodo di login`.", "title": "Alexa Media Player - Configurazione" + }, + "user_legacy": { + "data": { + "cookies_txt": "Dati cookies.txt", + "debug": "Debug avanzato", + "email": "Indirizzo email", + "exclude_devices": "Dispositivi da escludere (separati da virgola)", + "include_devices": "Dispositivi da includere (separati da virgola)", + "oauth_login": "Abilitare il metodo oauth-token app", + "otp_secret": "Chiave 2FA interna (genera automaticamente i codici 2FA)", + "password": "Password", + "proxy": "Usa il Proxy come metodo di login (2FA non richiesta)", + "scan_interval": "Tempo in secondi fra le scansioni", + "securitycode": "Codice 2FA (raccomandato per evitare problemi di login)", + "url": "Regione del dominio Amazon (e.g. amazon.it)" + }, + "description": "Prego inserisci le tue [informazioni](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) potrebbe essere più semplice!** \n**ATTENZIONE: Amazon risponde incorrettamente 'Inserire una mail valida o un numero di telefono' quando è richiesto il codice 2FA](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/.translations/nb.json b/custom_components/alexa_media/.translations/nb.json index 7aa9532..333797c 100644 --- a/custom_components/alexa_media/.translations/nb.json +++ b/custom_components/alexa_media/.translations/nb.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}** \nSkriv inn engangspassordet (OTP). \n>{message}", "title": "Alexa Media Player - Tofaktorautentisering" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Avansert feilsøking", "email": "Epostadresse", "exclude_devices": "Ekskludert enhet (kommaseparert)", + "hass_url": "Url to access Home Assistant", "include_devices": "Inkluder enhet (kommaseparert)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -77,16 +78,15 @@ "securitycode": "2FA-kode (anbefales for å unngå påloggingsproblemer)", "url": "Amazon-regiondomenet (f.eks. Amazon.co.uk)" }, - "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "Bekreft informasjonen nedenfor. For eldre konfigurasjon, deaktiver alternativet \"Bruk innlogging proxy-metode\".", + "title": "Alexa Media Player - Konfigurasjon" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Avansert feilsøking", "email": "Epostadresse", "exclude_devices": "Ekskludert enhet (kommaseparert)", - "hass_url": "Url to access Home Assistant", "include_devices": "Inkluder enhet (kommaseparert)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -96,8 +96,8 @@ "securitycode": "2FA-kode (anbefales for å unngå påloggingsproblemer)", "url": "Amazon-regiondomenet (f.eks. Amazon.co.uk)" }, - "description": "Bekreft informasjonen nedenfor. For eldre konfigurasjon, deaktiver alternativet \"Bruk innlogging proxy-metode\".", - "title": "Alexa Media Player - Konfigurasjon" + "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/.translations/nl.json b/custom_components/alexa_media/.translations/nl.json index 820662c..9a4afdb 100644 --- a/custom_components/alexa_media/.translations/nl.json +++ b/custom_components/alexa_media/.translations/nl.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}** \nGeef de verificatiecode in. \n{message}", "title": "Alexa Media Player - Tweestapsverificatie" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Geavanceerd debuggen", "email": "E-mailadres", "exclude_devices": "Apparaten uitsluiten (Scheiding: komma)", + "hass_url": "Url to access Home Assistant", "include_devices": "Apparaten toevoegen (Scheiding: komma)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -77,16 +78,15 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Domeinnaam van Amazon regio (bv.amazon.co.uk)" }, - "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "Vul je gegevens in a.u.b.", + "title": "Alexa Media Player - Configuratie" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Geavanceerd debuggen", "email": "E-mailadres", "exclude_devices": "Apparaten uitsluiten (Scheiding: komma)", - "hass_url": "Url to access Home Assistant", "include_devices": "Apparaten toevoegen (Scheiding: komma)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -96,8 +96,8 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Domeinnaam van Amazon regio (bv.amazon.co.uk)" }, - "description": "Vul je gegevens in a.u.b.", - "title": "Alexa Media Player - Configuratie" + "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/.translations/pl.json b/custom_components/alexa_media/.translations/pl.json index 32d7f3a..eb6a80e 100644 --- a/custom_components/alexa_media/.translations/pl.json +++ b/custom_components/alexa_media/.translations/pl.json @@ -62,42 +62,42 @@ "description": "**{email} - alexa.{url}** \nWprowadź hasło jednorazowe (OTP). \n{message}", "title": "Alexa Media Player — uwierzytelnianie dwuskładnikowe" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "zawartość pliku cookies.txt", "debug": "Zaawansowane debugowanie", - "email": "Adres e-mail", + "email": "Adres email", "exclude_devices": "Wykluczone urządzenia (oddzielone przecinkami)", + "hass_url": "URL dostępu do Home Assistanta", "include_devices": "Dodawane urządzenia (oddzielone przecinkami)", "oauth_login": "Włącz metodę tokena OAuth aplikacji", "otp_secret": "Wbudowana aplikacja kluczy uwierzytelniania dwuskładnikowego (automatycznie generuje kody uwierzytelniania dwuskładnikowego)", "password": "Hasło", "proxy": "Użyj metody logowania proxy (2FA nie jest wymagane)", "scan_interval": "Interwał skanowania (sekundy)", - "securitycode": "Kod uwierzytelniania dwuskładnikowego", + "securitycode": "Kod uwierzytelniania dwuskładnikowego (zalecany w celu uniknięcia problemów z logowaniem)", "url": "Region/domena Amazon (np. amazon.co.uk)" }, - "description": "Wprowadź [dane](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Import pliku Cookie](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) może być najłatwiejszą metodą!** \n**OSTRZEŻENIE: Amazon nieprawidłowo zgłasza 'Wprowadź prawidłowy adres e-mail lub numer telefonu komórkowego', gdy wymagany jest [kod uwierzytelniania dwuskładnikowego](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player — starsza konfiguracja" + "description": "Potwierdź poniższe informacje. W przypadku starszych konfiguracji wyłącz opcję 'Użyj metody logowania proxy'.", + "title": "Alexa Media Player — konfiguracja" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "zawartość pliku cookies.txt", "debug": "Zaawansowane debugowanie", - "email": "Adres email", + "email": "Adres e-mail", "exclude_devices": "Wykluczone urządzenia (oddzielone przecinkami)", - "hass_url": "URL dostępu do Home Assistanta", "include_devices": "Dodawane urządzenia (oddzielone przecinkami)", "oauth_login": "Włącz metodę tokena OAuth aplikacji", "otp_secret": "Wbudowana aplikacja kluczy uwierzytelniania dwuskładnikowego (automatycznie generuje kody uwierzytelniania dwuskładnikowego)", "password": "Hasło", "proxy": "Użyj metody logowania proxy (2FA nie jest wymagane)", "scan_interval": "Interwał skanowania (sekundy)", - "securitycode": "Kod uwierzytelniania dwuskładnikowego (zalecany w celu uniknięcia problemów z logowaniem)", + "securitycode": "Kod uwierzytelniania dwuskładnikowego", "url": "Region/domena Amazon (np. amazon.co.uk)" }, - "description": "Potwierdź poniższe informacje. W przypadku starszych konfiguracji wyłącz opcję 'Użyj metody logowania proxy'.", - "title": "Alexa Media Player — konfiguracja" + "description": "Wprowadź [dane](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Import pliku Cookie](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) może być najłatwiejszą metodą!** \n**OSTRZEŻENIE: Amazon nieprawidłowo zgłasza 'Wprowadź prawidłowy adres e-mail lub numer telefonu komórkowego', gdy wymagany jest [kod uwierzytelniania dwuskładnikowego](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player — starsza konfiguracja" } } }, diff --git a/custom_components/alexa_media/.translations/pt_BR.json b/custom_components/alexa_media/.translations/pt_BR.json index c519b55..2696cc2 100644 --- a/custom_components/alexa_media/.translations/pt_BR.json +++ b/custom_components/alexa_media/.translations/pt_BR.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}** \nInsira a senha de uso único (OTP).\n{message}", "title": "Alexa Media Player - Autenticação de dois fatores" }, - "user_legacy": { + "user": { "data": { - "cookies_txt": "Cookies.txt data", + "cookies_txt": "Dados de cookies.txt", "debug": "Depuração avançada", "email": "Endereço de email", "exclude_devices": "Dispositivos exclusos (separados por virgula)", + "hass_url": "Url para acesso ao Home Assistant", "include_devices": "Dispositivos inclusos (separados por vírgula)", "oauth_login": "Habilitar o aplicativo para método auth-token", "otp_secret": "Aplicativo integrado para chaves 2FA (Automaticamente gera códigos 2FA)", @@ -77,16 +78,15 @@ "securitycode": "Código 2FA (recomendado para evitar problemas de login)", "url": "Domínio regional da amazon (ex: amazon.co.uk)" }, - "description": "Por favor insira sua [informação](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) pode ser mais fácil!** \n**AVISO! A amazon reporta incorretamente 'Insira um email ou número de telefone válido' quando [Código de 2FA é requirido](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Configurações legado" + "description": "Por favor, confirme as informações abaixo. Para configuração legada, desative a opção `Usar método de proxy de login'.", + "title": "Alexa Media Player - Configurações" }, - "user": { + "user_legacy": { "data": { - "cookies_txt": "Dados de cookies.txt", + "cookies_txt": "Cookies.txt data", "debug": "Depuração avançada", "email": "Endereço de email", "exclude_devices": "Dispositivos exclusos (separados por virgula)", - "hass_url": "Url para acesso ao Home Assistant", "include_devices": "Dispositivos inclusos (separados por vírgula)", "oauth_login": "Habilitar o aplicativo para método auth-token", "otp_secret": "Aplicativo integrado para chaves 2FA (Automaticamente gera códigos 2FA)", @@ -96,8 +96,8 @@ "securitycode": "Código 2FA (recomendado para evitar problemas de login)", "url": "Domínio regional da amazon (ex: amazon.co.uk)" }, - "description": "Por favor, confirme as informações abaixo. Para configuração legada, desative a opção `Usar método de proxy de login'.", - "title": "Alexa Media Player - Configurações" + "description": "Por favor insira sua [informação](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) pode ser mais fácil!** \n**AVISO! A amazon reporta incorretamente 'Insira um email ou número de telefone válido' quando [Código de 2FA é requirido](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Configurações legado" } } }, diff --git a/custom_components/alexa_media/.translations/pt_PT.json b/custom_components/alexa_media/.translations/pt_PT.json index 1197e57..5cf76c7 100644 --- a/custom_components/alexa_media/.translations/pt_PT.json +++ b/custom_components/alexa_media/.translations/pt_PT.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}** \nDigite a senha de uso único (OTP). \n{message}", "title": "Alexa Media Player - autenticação de dois fatores" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "Dados de cookies.txt", "debug": "Depuração avançada", "email": "Endereço de e-mail", "exclude_devices": "Dispositivo excluído (separado por vírgula)", + "hass_url": "URL para aceder o Home Assistant", "include_devices": "Dispositivo incluído (separado por vírgula)", "oauth_login": "Habilitar método de aplicativo oauth-token", "otp_secret": "Chave de aplicativo 2FA integrada (gerar códigos 2FA automaticamente)", @@ -77,16 +78,15 @@ "securitycode": "Código 2FA (recomendado para evitar problemas de login)", "url": "Região do domínio Amazon (ex. amazon.com.br)" }, - "description": "Por favor, introduza a sua [informação](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) pode ser mais fácil!** \n**Aviso: a Amazon informa incorretamente 'Insira um e-mail ou número de celular válido' quando [2FA Code é necessário](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Configuração de Compatibilidade" + "description": "Por favor, confirme as informações abaixo. Para configuração de compatibilidade, desative a opção 'Usar método de proxy de login'.", + "title": "Alexa Media Player - Configuração" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "Dados de cookies.txt", "debug": "Depuração avançada", "email": "Endereço de e-mail", "exclude_devices": "Dispositivo excluído (separado por vírgula)", - "hass_url": "URL para aceder o Home Assistant", "include_devices": "Dispositivo incluído (separado por vírgula)", "oauth_login": "Habilitar método de aplicativo oauth-token", "otp_secret": "Chave de aplicativo 2FA integrada (gerar códigos 2FA automaticamente)", @@ -96,8 +96,8 @@ "securitycode": "Código 2FA (recomendado para evitar problemas de login)", "url": "Região do domínio Amazon (ex. amazon.com.br)" }, - "description": "Por favor, confirme as informações abaixo. Para configuração de compatibilidade, desative a opção 'Usar método de proxy de login'.", - "title": "Alexa Media Player - Configuração" + "description": "Por favor, introduza a sua [informação](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) pode ser mais fácil!** \n**Aviso: a Amazon informa incorretamente 'Insira um e-mail ou número de celular válido' quando [2FA Code é necessário](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Configuração de Compatibilidade" } } }, diff --git a/custom_components/alexa_media/.translations/ru.json b/custom_components/alexa_media/.translations/ru.json index b3519b5..ee10f82 100644 --- a/custom_components/alexa_media/.translations/ru.json +++ b/custom_components/alexa_media/.translations/ru.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}**\nВведите одноразовый пароль.\n{message}", "title": "Alexa Media Player - Двух факторная идентификация" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Расширенные возможности отладки", "email": "Адрес электронной почты", "exclude_devices": "Исключенные устройства (через запятую)", + "hass_url": "Url to access Home Assistant", "include_devices": "Включенные устройства (разделенное запятыми)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -77,16 +78,15 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Домен региона Amazon (например, amazon.co.uk)" }, - "description": "Пожалуйста, введите свои данные.{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "Пожалуйста, подтвердите информацию ниже. Для старой конфигурации отключите опцию `Use Login Proxy method`.", + "title": "Alexa Media Player - Конфигурация" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Расширенные возможности отладки", "email": "Адрес электронной почты", "exclude_devices": "Исключенные устройства (через запятую)", - "hass_url": "Url to access Home Assistant", "include_devices": "Включенные устройства (разделенное запятыми)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -96,8 +96,8 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Домен региона Amazon (например, amazon.co.uk)" }, - "description": "Пожалуйста, подтвердите информацию ниже. Для старой конфигурации отключите опцию `Use Login Proxy method`.", - "title": "Alexa Media Player - Конфигурация" + "description": "Пожалуйста, введите свои данные.{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/.translations/zh-Hans.json b/custom_components/alexa_media/.translations/zh-Hans.json index e848d77..4af369e 100644 --- a/custom_components/alexa_media/.translations/zh-Hans.json +++ b/custom_components/alexa_media/.translations/zh-Hans.json @@ -62,12 +62,13 @@ "description": "**{email} - Alexa.{url} ** \n输入一次性密码(OTP)。 \n {message}", "title": "Alexa Media Player - Two Factor Authentication" }, - "user_legacy": { + "user": { "data": { - "cookies_txt": "config::step::user::data::cookies_txt", + "cookies_txt": "Cookie.txt数据", "debug": "高级调试", "email": "电子邮件地址", "exclude_devices": "Excluded device (comma separated)", + "hass_url": "Url to access Home Assistant", "include_devices": "Included device (comma separated)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -77,16 +78,15 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Amazon region domain (e.g., amazon.co.uk)" }, - "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "请确认以下信息。对于旧版配置,请禁用“使用登录代理方法”选项。", + "title": "Alexa Media Player-配置" }, - "user": { + "user_legacy": { "data": { - "cookies_txt": "Cookie.txt数据", + "cookies_txt": "config::step::user::data::cookies_txt", "debug": "高级调试", "email": "电子邮件地址", "exclude_devices": "Excluded device (comma separated)", - "hass_url": "Url to access Home Assistant", "include_devices": "Included device (comma separated)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -96,8 +96,8 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Amazon region domain (e.g., amazon.co.uk)" }, - "description": "请确认以下信息。对于旧版配置,请禁用“使用登录代理方法”选项。", - "title": "Alexa Media Player-配置" + "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/const.py b/custom_components/alexa_media/const.py index c812ed3..2428967 100644 --- a/custom_components/alexa_media/const.py +++ b/custom_components/alexa_media/const.py @@ -8,7 +8,7 @@ """ from datetime import timedelta -__version__ = "3.10.8" +__version__ = "3.10.10" PROJECT_URL = "https://github.com/custom-components/alexa_media_player/" ISSUE_URL = f"{PROJECT_URL}issues" diff --git a/custom_components/alexa_media/manifest.json b/custom_components/alexa_media/manifest.json index c506a1d..4bed4f0 100644 --- a/custom_components/alexa_media/manifest.json +++ b/custom_components/alexa_media/manifest.json @@ -1,12 +1,12 @@ { "domain": "alexa_media", "name": "Alexa Media Player", - "version": "3.10.8", + "version": "3.10.10", "config_flow": true, "documentation": "https://github.com/custom-components/alexa_media_player/wiki", "issue_tracker": "https://github.com/custom-components/alexa_media_player/issues", "dependencies": ["persistent_notification", "http"], "codeowners": ["@keatontaylor", "@alandtse"], - "requirements": ["alexapy==1.25.1", "packaging~=20.3", "wrapt~=1.12.1"], + "requirements": ["alexapy==1.25.1", "packaging>=20.3", "wrapt~=1.12.1"], "iot_class": "cloud_polling" } diff --git a/custom_components/alexa_media/sensor.py b/custom_components/alexa_media/sensor.py index 7030e25..0b30f5f 100644 --- a/custom_components/alexa_media/sensor.py +++ b/custom_components/alexa_media/sensor.py @@ -500,7 +500,7 @@ async def async_update(self): account_dict = self.hass.data[DATA_ALEXAMEDIA]["accounts"][self._account] self._timestamp = account_dict["notifications"]["process_timestamp"] try: - self._n_dict = account_dict["notifications"][self._dev_id][self._type] + self._n_dict = account_dict["notifications"][self._client.device_serial_number][self._type] except KeyError: self._n_dict = None self._process_raw_notifications() diff --git a/custom_components/alexa_media/switch.py b/custom_components/alexa_media/switch.py index 21ab7c3..ebce7ec 100644 --- a/custom_components/alexa_media/switch.py +++ b/custom_components/alexa_media/switch.py @@ -309,7 +309,7 @@ def __init__(self, client): @property def icon(self): """Return the icon of the switch.""" - return super()._icon("mdi:do-not-disturb", "mdi:do-not-disturb-off") + return super()._icon("mdi:minus-circle", "mdi:minus-circle-off") def _handle_event(self, event): """Handle events.""" diff --git a/custom_components/alexa_media/translations/de.json b/custom_components/alexa_media/translations/de.json index 3127aa2..15a6073 100644 --- a/custom_components/alexa_media/translations/de.json +++ b/custom_components/alexa_media/translations/de.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}** \nDen Zwei Faktor Pin eingeben. \n{message}", "title": "Alexa Media Player - Zwei Faktor Authentifizierung" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Erweitertes debugging", "email": "Email Adresse", "exclude_devices": "Ausgeschlossene Geräte (komma getrennnt)", + "hass_url": "Url to access Home Assistant", "include_devices": "Eingebundene Geräte (komma getrennnt)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -77,16 +78,15 @@ "securitycode": "2FA Code (empfohlen, um Anmeldeprobleme zu vermeiden)", "url": "Amazon Region (z.B., amazon.de)" }, - "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "Bitte geben Sie ihre Informationen ein.", + "title": "Alexa Media Player - Konfiguration" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Erweitertes debugging", "email": "Email Adresse", "exclude_devices": "Ausgeschlossene Geräte (komma getrennnt)", - "hass_url": "Url to access Home Assistant", "include_devices": "Eingebundene Geräte (komma getrennnt)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -96,8 +96,8 @@ "securitycode": "2FA Code (empfohlen, um Anmeldeprobleme zu vermeiden)", "url": "Amazon Region (z.B., amazon.de)" }, - "description": "Bitte geben Sie ihre Informationen ein.", - "title": "Alexa Media Player - Konfiguration" + "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/translations/en.json b/custom_components/alexa_media/translations/en.json index 4b0ea68..f52044a 100644 --- a/custom_components/alexa_media/translations/en.json +++ b/custom_components/alexa_media/translations/en.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}** \nEnter the One Time Password (OTP). \n{message}", "title": "Alexa Media Player - Two Factor Authentication" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "Cookies.txt data", "debug": "Advanced debugging", "email": "Email Address", "exclude_devices": "Excluded device (comma separated)", + "hass_url": "Url to access Home Assistant", "include_devices": "Included device (comma separated)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -77,16 +78,15 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Amazon region domain (e.g., amazon.co.uk)" }, - "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "Please confirm the information below. For legacy configuration, disable `Use Login Proxy method` option.", + "title": "Alexa Media Player - Configuration" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "Cookies.txt data", "debug": "Advanced debugging", "email": "Email Address", "exclude_devices": "Excluded device (comma separated)", - "hass_url": "Url to access Home Assistant", "include_devices": "Included device (comma separated)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -96,8 +96,8 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Amazon region domain (e.g., amazon.co.uk)" }, - "description": "Please confirm the information below. For legacy configuration, disable `Use Login Proxy method` option.", - "title": "Alexa Media Player - Configuration" + "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/translations/es.json b/custom_components/alexa_media/translations/es.json index eabeb59..d1ddc7a 100644 --- a/custom_components/alexa_media/translations/es.json +++ b/custom_components/alexa_media/translations/es.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}** \nIngrese la contraseña de un solo uso (OTP). \n{message}", "title": "Alexa Media Player - Autenticación de dos factores" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "Datos de Cookies.txt", "debug": "Depuración avanzada", "email": "Dirección de correo electrónico", "exclude_devices": "Dispositivo excluido (separado por comas)", + "hass_url": "Url to access Home Assistant", "include_devices": "Dispositivo incluido (separado por comas)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -77,16 +78,15 @@ "securitycode": "Código 2FA (recomendado para evitar problemas de inicio de sesión)", "url": "Región del dominio de Amazon (por ejemplo, amazon.es)" }, - "description": "Por favor introduce tu [información](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **El método más rápido es [Importar cookies](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import).** \n**ADVERTENCIA: Amazon informará 'Introduce un correo electrónico o número de teléfono válido' si tu cuenta utiliza [códigos 2FA - Segundo Factor de Autenticación](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "Confirme la siguiente información. Para la configuración heredada, desactive la opción `Usar método de proxy de inicio de sesión`.", + "title": "Alexa Media Player - Configuración" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "Datos de Cookies.txt", "debug": "Depuración avanzada", "email": "Dirección de correo electrónico", "exclude_devices": "Dispositivo excluido (separado por comas)", - "hass_url": "Url to access Home Assistant", "include_devices": "Dispositivo incluido (separado por comas)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -96,8 +96,8 @@ "securitycode": "Código 2FA (recomendado para evitar problemas de inicio de sesión)", "url": "Región del dominio de Amazon (por ejemplo, amazon.es)" }, - "description": "Confirme la siguiente información. Para la configuración heredada, desactive la opción `Usar método de proxy de inicio de sesión`.", - "title": "Alexa Media Player - Configuración" + "description": "Por favor introduce tu [información](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **El método más rápido es [Importar cookies](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import).** \n**ADVERTENCIA: Amazon informará 'Introduce un correo electrónico o número de teléfono válido' si tu cuenta utiliza [códigos 2FA - Segundo Factor de Autenticación](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/translations/fr.json b/custom_components/alexa_media/translations/fr.json index 7bc3c14..6d73c4e 100644 --- a/custom_components/alexa_media/translations/fr.json +++ b/custom_components/alexa_media/translations/fr.json @@ -62,14 +62,15 @@ "description": "**{email} - alexa.{url}** \nEntrez le mot de passe unique (OTP). \n{message}", "title": "Alexa Media Player - Authentification à deux facteurs" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "Données cookies.txt", "debug": "Débogage avancé", "email": "Adresse Email", "exclude_devices": "Appareil exclu (séparé par des virgules)", + "hass_url": "Url to access Home Assistant", "include_devices": "Appareil inclus (séparé par des virgules)", - "oauth_login": "Activer la méthode d'application oauth-token", + "oauth_login": "Enable oauth-token app method", "otp_secret": "Clé d'application 2FA intégrée (génère automatiquement des codes 2FA)", "password": "Mot de passe", "proxy": "Use Login Proxy method (2FA not required)", @@ -77,18 +78,17 @@ "securitycode": "Code 2FA (recommandé pour éviter les problèmes de connexion)", "url": "Domaine de la région Amazon (exemple, amazon.fr)" }, - "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "Veuillez confirmer les informations ci-dessous. Pour la configuration héritée, désactivez l'option `Utiliser la méthode proxy de connexion`.", + "title": "Alexa Media Player - Configuration" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "Données cookies.txt", "debug": "Débogage avancé", "email": "Adresse Email", "exclude_devices": "Appareil exclu (séparé par des virgules)", - "hass_url": "Url to access Home Assistant", "include_devices": "Appareil inclus (séparé par des virgules)", - "oauth_login": "Enable oauth-token app method", + "oauth_login": "Activer la méthode d'application oauth-token", "otp_secret": "Clé d'application 2FA intégrée (génère automatiquement des codes 2FA)", "password": "Mot de passe", "proxy": "Use Login Proxy method (2FA not required)", @@ -96,8 +96,8 @@ "securitycode": "Code 2FA (recommandé pour éviter les problèmes de connexion)", "url": "Domaine de la région Amazon (exemple, amazon.fr)" }, - "description": "Veuillez confirmer les informations ci-dessous. Pour la configuration héritée, désactivez l'option `Utiliser la méthode proxy de connexion`.", - "title": "Alexa Media Player - Configuration" + "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/translations/it.json b/custom_components/alexa_media/translations/it.json index f7a88a2..8d0c899 100644 --- a/custom_components/alexa_media/translations/it.json +++ b/custom_components/alexa_media/translations/it.json @@ -62,24 +62,6 @@ "description": "**{email} - alexa.{url}** \nInserisci la password usa e getta (OTP). \n{message}", "title": "Alexa Media Player - Autenticazione a Due Fattori" }, - "user_legacy": { - "data": { - "cookies_txt": "config::step::user::data::cookies_txt", - "debug": "Debug avanzato", - "email": "Indirizzo email", - "exclude_devices": "Dispositivi da escludere (separati da virgola)", - "include_devices": "Dispositivi da includere (separati da virgola)", - "oauth_login": "Abilitare il metodo oauth-token app", - "otp_secret": "Chiave 2FA interna (genera automaticamente i codici 2FA)", - "password": "Password", - "proxy": "Usa il Proxy come metodo di login (2FA non richiesta)", - "scan_interval": "Tempo in secondi fra le scansioni", - "securitycode": "Codice 2FA (raccomandato per evitare problemi di login)", - "url": "Regione del dominio Amazon (e.g. amazon.it)" - }, - "description": "Prego inserisci le tue [informazioni](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) potrebbe essere più semplice!** \n**ATTENZIONE: Amazon risponde incorrettamente 'Inserire una mail valida o un numero di telefono' quando è richiesto il codice 2FA](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" - }, "user": { "data": { "cookies_txt": "Dati cookies.txt", @@ -98,6 +80,24 @@ }, "description": "Confermare le informazioni sottostanti. Per le vecchie configurazioni, disabilitare l'opzione `Usa Proxy come metodo di login`.", "title": "Alexa Media Player - Configurazione" + }, + "user_legacy": { + "data": { + "cookies_txt": "Dati cookies.txt", + "debug": "Debug avanzato", + "email": "Indirizzo email", + "exclude_devices": "Dispositivi da escludere (separati da virgola)", + "include_devices": "Dispositivi da includere (separati da virgola)", + "oauth_login": "Abilitare il metodo oauth-token app", + "otp_secret": "Chiave 2FA interna (genera automaticamente i codici 2FA)", + "password": "Password", + "proxy": "Usa il Proxy come metodo di login (2FA non richiesta)", + "scan_interval": "Tempo in secondi fra le scansioni", + "securitycode": "Codice 2FA (raccomandato per evitare problemi di login)", + "url": "Regione del dominio Amazon (e.g. amazon.it)" + }, + "description": "Prego inserisci le tue [informazioni](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) potrebbe essere più semplice!** \n**ATTENZIONE: Amazon risponde incorrettamente 'Inserire una mail valida o un numero di telefono' quando è richiesto il codice 2FA](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/translations/nb.json b/custom_components/alexa_media/translations/nb.json index 7aa9532..333797c 100644 --- a/custom_components/alexa_media/translations/nb.json +++ b/custom_components/alexa_media/translations/nb.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}** \nSkriv inn engangspassordet (OTP). \n>{message}", "title": "Alexa Media Player - Tofaktorautentisering" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Avansert feilsøking", "email": "Epostadresse", "exclude_devices": "Ekskludert enhet (kommaseparert)", + "hass_url": "Url to access Home Assistant", "include_devices": "Inkluder enhet (kommaseparert)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -77,16 +78,15 @@ "securitycode": "2FA-kode (anbefales for å unngå påloggingsproblemer)", "url": "Amazon-regiondomenet (f.eks. Amazon.co.uk)" }, - "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "Bekreft informasjonen nedenfor. For eldre konfigurasjon, deaktiver alternativet \"Bruk innlogging proxy-metode\".", + "title": "Alexa Media Player - Konfigurasjon" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Avansert feilsøking", "email": "Epostadresse", "exclude_devices": "Ekskludert enhet (kommaseparert)", - "hass_url": "Url to access Home Assistant", "include_devices": "Inkluder enhet (kommaseparert)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -96,8 +96,8 @@ "securitycode": "2FA-kode (anbefales for å unngå påloggingsproblemer)", "url": "Amazon-regiondomenet (f.eks. Amazon.co.uk)" }, - "description": "Bekreft informasjonen nedenfor. For eldre konfigurasjon, deaktiver alternativet \"Bruk innlogging proxy-metode\".", - "title": "Alexa Media Player - Konfigurasjon" + "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/translations/nl.json b/custom_components/alexa_media/translations/nl.json index 820662c..9a4afdb 100644 --- a/custom_components/alexa_media/translations/nl.json +++ b/custom_components/alexa_media/translations/nl.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}** \nGeef de verificatiecode in. \n{message}", "title": "Alexa Media Player - Tweestapsverificatie" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Geavanceerd debuggen", "email": "E-mailadres", "exclude_devices": "Apparaten uitsluiten (Scheiding: komma)", + "hass_url": "Url to access Home Assistant", "include_devices": "Apparaten toevoegen (Scheiding: komma)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -77,16 +78,15 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Domeinnaam van Amazon regio (bv.amazon.co.uk)" }, - "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "Vul je gegevens in a.u.b.", + "title": "Alexa Media Player - Configuratie" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Geavanceerd debuggen", "email": "E-mailadres", "exclude_devices": "Apparaten uitsluiten (Scheiding: komma)", - "hass_url": "Url to access Home Assistant", "include_devices": "Apparaten toevoegen (Scheiding: komma)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -96,8 +96,8 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Domeinnaam van Amazon regio (bv.amazon.co.uk)" }, - "description": "Vul je gegevens in a.u.b.", - "title": "Alexa Media Player - Configuratie" + "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/translations/pl.json b/custom_components/alexa_media/translations/pl.json index 32d7f3a..eb6a80e 100644 --- a/custom_components/alexa_media/translations/pl.json +++ b/custom_components/alexa_media/translations/pl.json @@ -62,42 +62,42 @@ "description": "**{email} - alexa.{url}** \nWprowadź hasło jednorazowe (OTP). \n{message}", "title": "Alexa Media Player — uwierzytelnianie dwuskładnikowe" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "zawartość pliku cookies.txt", "debug": "Zaawansowane debugowanie", - "email": "Adres e-mail", + "email": "Adres email", "exclude_devices": "Wykluczone urządzenia (oddzielone przecinkami)", + "hass_url": "URL dostępu do Home Assistanta", "include_devices": "Dodawane urządzenia (oddzielone przecinkami)", "oauth_login": "Włącz metodę tokena OAuth aplikacji", "otp_secret": "Wbudowana aplikacja kluczy uwierzytelniania dwuskładnikowego (automatycznie generuje kody uwierzytelniania dwuskładnikowego)", "password": "Hasło", "proxy": "Użyj metody logowania proxy (2FA nie jest wymagane)", "scan_interval": "Interwał skanowania (sekundy)", - "securitycode": "Kod uwierzytelniania dwuskładnikowego", + "securitycode": "Kod uwierzytelniania dwuskładnikowego (zalecany w celu uniknięcia problemów z logowaniem)", "url": "Region/domena Amazon (np. amazon.co.uk)" }, - "description": "Wprowadź [dane](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Import pliku Cookie](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) może być najłatwiejszą metodą!** \n**OSTRZEŻENIE: Amazon nieprawidłowo zgłasza 'Wprowadź prawidłowy adres e-mail lub numer telefonu komórkowego', gdy wymagany jest [kod uwierzytelniania dwuskładnikowego](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player — starsza konfiguracja" + "description": "Potwierdź poniższe informacje. W przypadku starszych konfiguracji wyłącz opcję 'Użyj metody logowania proxy'.", + "title": "Alexa Media Player — konfiguracja" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "zawartość pliku cookies.txt", "debug": "Zaawansowane debugowanie", - "email": "Adres email", + "email": "Adres e-mail", "exclude_devices": "Wykluczone urządzenia (oddzielone przecinkami)", - "hass_url": "URL dostępu do Home Assistanta", "include_devices": "Dodawane urządzenia (oddzielone przecinkami)", "oauth_login": "Włącz metodę tokena OAuth aplikacji", "otp_secret": "Wbudowana aplikacja kluczy uwierzytelniania dwuskładnikowego (automatycznie generuje kody uwierzytelniania dwuskładnikowego)", "password": "Hasło", "proxy": "Użyj metody logowania proxy (2FA nie jest wymagane)", "scan_interval": "Interwał skanowania (sekundy)", - "securitycode": "Kod uwierzytelniania dwuskładnikowego (zalecany w celu uniknięcia problemów z logowaniem)", + "securitycode": "Kod uwierzytelniania dwuskładnikowego", "url": "Region/domena Amazon (np. amazon.co.uk)" }, - "description": "Potwierdź poniższe informacje. W przypadku starszych konfiguracji wyłącz opcję 'Użyj metody logowania proxy'.", - "title": "Alexa Media Player — konfiguracja" + "description": "Wprowadź [dane](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Import pliku Cookie](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) może być najłatwiejszą metodą!** \n**OSTRZEŻENIE: Amazon nieprawidłowo zgłasza 'Wprowadź prawidłowy adres e-mail lub numer telefonu komórkowego', gdy wymagany jest [kod uwierzytelniania dwuskładnikowego](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player — starsza konfiguracja" } } }, diff --git a/custom_components/alexa_media/translations/pt_BR.json b/custom_components/alexa_media/translations/pt_BR.json index c519b55..2696cc2 100644 --- a/custom_components/alexa_media/translations/pt_BR.json +++ b/custom_components/alexa_media/translations/pt_BR.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}** \nInsira a senha de uso único (OTP).\n{message}", "title": "Alexa Media Player - Autenticação de dois fatores" }, - "user_legacy": { + "user": { "data": { - "cookies_txt": "Cookies.txt data", + "cookies_txt": "Dados de cookies.txt", "debug": "Depuração avançada", "email": "Endereço de email", "exclude_devices": "Dispositivos exclusos (separados por virgula)", + "hass_url": "Url para acesso ao Home Assistant", "include_devices": "Dispositivos inclusos (separados por vírgula)", "oauth_login": "Habilitar o aplicativo para método auth-token", "otp_secret": "Aplicativo integrado para chaves 2FA (Automaticamente gera códigos 2FA)", @@ -77,16 +78,15 @@ "securitycode": "Código 2FA (recomendado para evitar problemas de login)", "url": "Domínio regional da amazon (ex: amazon.co.uk)" }, - "description": "Por favor insira sua [informação](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) pode ser mais fácil!** \n**AVISO! A amazon reporta incorretamente 'Insira um email ou número de telefone válido' quando [Código de 2FA é requirido](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Configurações legado" + "description": "Por favor, confirme as informações abaixo. Para configuração legada, desative a opção `Usar método de proxy de login'.", + "title": "Alexa Media Player - Configurações" }, - "user": { + "user_legacy": { "data": { - "cookies_txt": "Dados de cookies.txt", + "cookies_txt": "Cookies.txt data", "debug": "Depuração avançada", "email": "Endereço de email", "exclude_devices": "Dispositivos exclusos (separados por virgula)", - "hass_url": "Url para acesso ao Home Assistant", "include_devices": "Dispositivos inclusos (separados por vírgula)", "oauth_login": "Habilitar o aplicativo para método auth-token", "otp_secret": "Aplicativo integrado para chaves 2FA (Automaticamente gera códigos 2FA)", @@ -96,8 +96,8 @@ "securitycode": "Código 2FA (recomendado para evitar problemas de login)", "url": "Domínio regional da amazon (ex: amazon.co.uk)" }, - "description": "Por favor, confirme as informações abaixo. Para configuração legada, desative a opção `Usar método de proxy de login'.", - "title": "Alexa Media Player - Configurações" + "description": "Por favor insira sua [informação](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) pode ser mais fácil!** \n**AVISO! A amazon reporta incorretamente 'Insira um email ou número de telefone válido' quando [Código de 2FA é requirido](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Configurações legado" } } }, diff --git a/custom_components/alexa_media/translations/pt_PT.json b/custom_components/alexa_media/translations/pt_PT.json index 1197e57..5cf76c7 100644 --- a/custom_components/alexa_media/translations/pt_PT.json +++ b/custom_components/alexa_media/translations/pt_PT.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}** \nDigite a senha de uso único (OTP). \n{message}", "title": "Alexa Media Player - autenticação de dois fatores" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "Dados de cookies.txt", "debug": "Depuração avançada", "email": "Endereço de e-mail", "exclude_devices": "Dispositivo excluído (separado por vírgula)", + "hass_url": "URL para aceder o Home Assistant", "include_devices": "Dispositivo incluído (separado por vírgula)", "oauth_login": "Habilitar método de aplicativo oauth-token", "otp_secret": "Chave de aplicativo 2FA integrada (gerar códigos 2FA automaticamente)", @@ -77,16 +78,15 @@ "securitycode": "Código 2FA (recomendado para evitar problemas de login)", "url": "Região do domínio Amazon (ex. amazon.com.br)" }, - "description": "Por favor, introduza a sua [informação](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) pode ser mais fácil!** \n**Aviso: a Amazon informa incorretamente 'Insira um e-mail ou número de celular válido' quando [2FA Code é necessário](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Configuração de Compatibilidade" + "description": "Por favor, confirme as informações abaixo. Para configuração de compatibilidade, desative a opção 'Usar método de proxy de login'.", + "title": "Alexa Media Player - Configuração" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "Dados de cookies.txt", "debug": "Depuração avançada", "email": "Endereço de e-mail", "exclude_devices": "Dispositivo excluído (separado por vírgula)", - "hass_url": "URL para aceder o Home Assistant", "include_devices": "Dispositivo incluído (separado por vírgula)", "oauth_login": "Habilitar método de aplicativo oauth-token", "otp_secret": "Chave de aplicativo 2FA integrada (gerar códigos 2FA automaticamente)", @@ -96,8 +96,8 @@ "securitycode": "Código 2FA (recomendado para evitar problemas de login)", "url": "Região do domínio Amazon (ex. amazon.com.br)" }, - "description": "Por favor, confirme as informações abaixo. Para configuração de compatibilidade, desative a opção 'Usar método de proxy de login'.", - "title": "Alexa Media Player - Configuração" + "description": "Por favor, introduza a sua [informação](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) pode ser mais fácil!** \n**Aviso: a Amazon informa incorretamente 'Insira um e-mail ou número de celular válido' quando [2FA Code é necessário](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Configuração de Compatibilidade" } } }, diff --git a/custom_components/alexa_media/translations/ru.json b/custom_components/alexa_media/translations/ru.json index b3519b5..ee10f82 100644 --- a/custom_components/alexa_media/translations/ru.json +++ b/custom_components/alexa_media/translations/ru.json @@ -62,12 +62,13 @@ "description": "**{email} - alexa.{url}**\nВведите одноразовый пароль.\n{message}", "title": "Alexa Media Player - Двух факторная идентификация" }, - "user_legacy": { + "user": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Расширенные возможности отладки", "email": "Адрес электронной почты", "exclude_devices": "Исключенные устройства (через запятую)", + "hass_url": "Url to access Home Assistant", "include_devices": "Включенные устройства (разделенное запятыми)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -77,16 +78,15 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Домен региона Amazon (например, amazon.co.uk)" }, - "description": "Пожалуйста, введите свои данные.{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "Пожалуйста, подтвердите информацию ниже. Для старой конфигурации отключите опцию `Use Login Proxy method`.", + "title": "Alexa Media Player - Конфигурация" }, - "user": { + "user_legacy": { "data": { "cookies_txt": "config::step::user::data::cookies_txt", "debug": "Расширенные возможности отладки", "email": "Адрес электронной почты", "exclude_devices": "Исключенные устройства (через запятую)", - "hass_url": "Url to access Home Assistant", "include_devices": "Включенные устройства (разделенное запятыми)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -96,8 +96,8 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Домен региона Amazon (например, amazon.co.uk)" }, - "description": "Пожалуйста, подтвердите информацию ниже. Для старой конфигурации отключите опцию `Use Login Proxy method`.", - "title": "Alexa Media Player - Конфигурация" + "description": "Пожалуйста, введите свои данные.{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/alexa_media/translations/zh-Hans.json b/custom_components/alexa_media/translations/zh-Hans.json index e848d77..4af369e 100644 --- a/custom_components/alexa_media/translations/zh-Hans.json +++ b/custom_components/alexa_media/translations/zh-Hans.json @@ -62,12 +62,13 @@ "description": "**{email} - Alexa.{url} ** \n输入一次性密码(OTP)。 \n {message}", "title": "Alexa Media Player - Two Factor Authentication" }, - "user_legacy": { + "user": { "data": { - "cookies_txt": "config::step::user::data::cookies_txt", + "cookies_txt": "Cookie.txt数据", "debug": "高级调试", "email": "电子邮件地址", "exclude_devices": "Excluded device (comma separated)", + "hass_url": "Url to access Home Assistant", "include_devices": "Included device (comma separated)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -77,16 +78,15 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Amazon region domain (e.g., amazon.co.uk)" }, - "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", - "title": "Alexa Media Player - Legacy Configuration" + "description": "请确认以下信息。对于旧版配置,请禁用“使用登录代理方法”选项。", + "title": "Alexa Media Player-配置" }, - "user": { + "user_legacy": { "data": { - "cookies_txt": "Cookie.txt数据", + "cookies_txt": "config::step::user::data::cookies_txt", "debug": "高级调试", "email": "电子邮件地址", "exclude_devices": "Excluded device (comma separated)", - "hass_url": "Url to access Home Assistant", "include_devices": "Included device (comma separated)", "oauth_login": "Enable oauth-token app method", "otp_secret": "Built-in 2FA App Key (automatically generate 2FA Codes)", @@ -96,8 +96,8 @@ "securitycode": "2FA Code (recommended to avoid login issues)", "url": "Amazon region domain (e.g., amazon.co.uk)" }, - "description": "请确认以下信息。对于旧版配置,请禁用“使用登录代理方法”选项。", - "title": "Alexa Media Player-配置" + "description": "Please enter your [information](https://github.com/custom-components/alexa_media_player/wiki/Configuration#integrations-page). **[Cookie import](https://github.com/custom-components/alexa_media_player/wiki/Configuration#cookie-import) may be easiest!** \n**WARNING: Amazon incorrectly reports 'Enter a valid email or mobile number' when [2FA Code is required](https://github.com/custom-components/alexa_media_player/wiki/Configuration#enable-two-factor-authentication-for-your-amazon-account).** \n>{message}", + "title": "Alexa Media Player - Legacy Configuration" } } }, diff --git a/custom_components/weenect/__init__.py b/custom_components/weenect/__init__.py index 2277980..f827f58 100644 --- a/custom_components/weenect/__init__.py +++ b/custom_components/weenect/__init__.py @@ -16,11 +16,9 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.helpers.dispatcher import async_dispatcher_send from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed -from .util import parse_duration from .const import ( CONF_PASSWORD, - CONF_UPDATE_RATE, CONF_USERNAME, DEFAULT_UPDATE_RATE, DOMAIN, @@ -28,7 +26,7 @@ STARTUP_MESSAGE, TRACKER_ADDED, ) -from .services import async_setup_services, async_unload_services +from .util import parse_duration _LOGGER: logging.Logger = logging.getLogger(__package__) @@ -37,7 +35,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): """Set up this integration using UI.""" if hass.data.get(DOMAIN) is None: hass.data.setdefault(DOMAIN, {}) - await async_setup_services(hass) _LOGGER.info(STARTUP_MESSAGE) username = entry.data.get(CONF_USERNAME) @@ -133,9 +130,6 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: if unloaded: hass.data[DOMAIN].pop(entry.entry_id) - # If there is no instance of this integration registered anymore - if not hass.data[DOMAIN]: - await async_unload_services(hass) return unloaded diff --git a/custom_components/weenect/config_flow.py b/custom_components/weenect/config_flow.py index 69272e3..83a2757 100644 --- a/custom_components/weenect/config_flow.py +++ b/custom_components/weenect/config_flow.py @@ -6,11 +6,7 @@ from homeassistant.helpers.aiohttp_client import async_create_clientsession import voluptuous as vol -from .const import ( - CONF_PASSWORD, - CONF_USERNAME, - DOMAIN, -) +from .const import CONF_PASSWORD, CONF_USERNAME, DOMAIN _LOGGER: logging.Logger = logging.getLogger(__package__) diff --git a/custom_components/weenect/const.py b/custom_components/weenect/const.py index 7ee68ad..df11966 100644 --- a/custom_components/weenect/const.py +++ b/custom_components/weenect/const.py @@ -12,7 +12,7 @@ NAME = "Weenect" DOMAIN = "weenect" DOMAIN_DATA = f"{DOMAIN}_data" -VERSION = "1.3.0" +VERSION = "2.0.2" ATTRIBUTION = "Data provided by https://my.weenect.com/" ISSUE_URL = "https://github.com/eifinger/hass-weenect/issues" diff --git a/custom_components/weenect/device_tracker.py b/custom_components/weenect/device_tracker.py index f6f2b12..c969ff3 100644 --- a/custom_components/weenect/device_tracker.py +++ b/custom_components/weenect/device_tracker.py @@ -1,22 +1,44 @@ """Device tracker platform for weenect.""" -import logging from typing import List from homeassistant.components.device_tracker import SOURCE_TYPE_GPS from homeassistant.components.device_tracker.config_entry import TrackerEntity -from homeassistant.core import callback +from homeassistant.config_entries import ConfigEntry +from homeassistant.core import HomeAssistant, ServiceCall, callback +from homeassistant.helpers import entity_platform from homeassistant.helpers.dispatcher import async_dispatcher_connect +from homeassistant.helpers.entity_platform import AddEntitiesCallback + +from custom_components.weenect.services import ( + SERVICE_ACTIVATE_SUPER_LIVE, + SERVICE_REFRESH_LOCATION, + SERVICE_RING, + SERVICE_SCHEMA, + SERVICE_SET_UPDATE_INTERVAL, + SERVICE_SET_UPDATE_INTERVAL_SCHEMA, + SERVICE_VIBRATE, + UPDATE_INTERVAL, + async_activate_super_live, + async_refresh_location, + async_ring, + async_set_update_interval, + async_vibrate, +) from .const import DOMAIN, TRACKER_ADDED from .entity import WeenectEntity -_LOGGER = logging.getLogger(__name__) - -async def async_setup_entry(hass, config_entry, async_add_entities): +async def async_setup_entry( + hass: HomeAssistant, + entry: ConfigEntry, + async_add_entities: AddEntitiesCallback, +) -> None: """Set up the weenect device_trackers.""" - coordinator = hass.data[DOMAIN][config_entry.entry_id] + platform = entity_platform.async_get_current_platform() + + coordinator = hass.data[DOMAIN][entry.entry_id] @callback def async_add_device_trackers( @@ -37,13 +59,67 @@ def async_add_device_trackers( unsub_dispatcher = async_dispatcher_connect( hass, - f"{config_entry.entry_id}_{TRACKER_ADDED}", + f"{entry.entry_id}_{TRACKER_ADDED}", async_add_device_trackers, ) coordinator.unsub_dispatchers.append(unsub_dispatcher) if len(coordinator.data) > 0: async_add_device_trackers(coordinator.data.keys()) + async def async_call_service(service_call: ServiceCall) -> None: + """Handle dispatched services.""" + assert platform is not None + entities = await platform.async_extract_from_service(service_call) + + tracker_ids = [] + for entity in entities: + assert isinstance(entity, WeenectEntity) + tracker_ids.append(entity.id) + for tracker_id in set(tracker_ids): + if service_call.service == SERVICE_SET_UPDATE_INTERVAL: + await async_set_update_interval( + hass, tracker_id, service_call.data[UPDATE_INTERVAL] + ) + if service_call.service == SERVICE_ACTIVATE_SUPER_LIVE: + await async_activate_super_live(hass, tracker_id) + if service_call.service == SERVICE_REFRESH_LOCATION: + await async_refresh_location(hass, tracker_id) + if service_call.service == SERVICE_RING: + await async_ring(hass, tracker_id) + if service_call.service == SERVICE_VIBRATE: + await async_vibrate(hass, tracker_id) + + hass.services.async_register( + DOMAIN, + SERVICE_SET_UPDATE_INTERVAL, + async_call_service, + schema=SERVICE_SET_UPDATE_INTERVAL_SCHEMA, + ) + hass.services.async_register( + DOMAIN, + SERVICE_ACTIVATE_SUPER_LIVE, + async_call_service, + schema=SERVICE_SCHEMA, + ) + hass.services.async_register( + DOMAIN, + SERVICE_REFRESH_LOCATION, + async_call_service, + schema=SERVICE_SCHEMA, + ) + hass.services.async_register( + DOMAIN, + SERVICE_RING, + async_call_service, + schema=SERVICE_SCHEMA, + ) + hass.services.async_register( + DOMAIN, + SERVICE_VIBRATE, + async_call_service, + schema=SERVICE_SCHEMA, + ) + class WeenectDeviceTracker(WeenectEntity, TrackerEntity): """weenect device tracker.""" diff --git a/custom_components/weenect/sensor.py b/custom_components/weenect/sensor.py index 2b6b473..5bf0c11 100644 --- a/custom_components/weenect/sensor.py +++ b/custom_components/weenect/sensor.py @@ -1,21 +1,24 @@ """Sensor platform for weenect.""" -import logging from typing import Any, Dict, List -from homeassistant.core import callback +from homeassistant.config_entries import ConfigEntry +from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.dispatcher import async_dispatcher_connect +from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.update_coordinator import DataUpdateCoordinator from .const import DOMAIN, LOCATION_SENSOR_TYPES, SENSOR_TYPES, TRACKER_ADDED from .entity import WeenectEntity -_LOGGER = logging.getLogger(__name__) - -async def async_setup_entry(hass, config_entry, async_add_entities): +async def async_setup_entry( + hass: HomeAssistant, + entry: ConfigEntry, + async_add_entities: AddEntitiesCallback, +) -> None: """Set up the weenect sensors.""" - coordinator = hass.data[DOMAIN][config_entry.entry_id] + coordinator = hass.data[DOMAIN][entry.entry_id] @callback def async_add_sensors( @@ -36,7 +39,7 @@ def async_add_sensors( unsub_dispatcher = async_dispatcher_connect( hass, - f"{config_entry.entry_id}_{TRACKER_ADDED}", + f"{entry.entry_id}_{TRACKER_ADDED}", async_add_sensors, ) coordinator.unsub_dispatchers.append(unsub_dispatcher) diff --git a/custom_components/weenect/services.py b/custom_components/weenect/services.py index 4335de6..4bbe79c 100644 --- a/custom_components/weenect/services.py +++ b/custom_components/weenect/services.py @@ -1,6 +1,7 @@ """weenect services.""" import logging +from homeassistant.core import HomeAssistant from homeassistant.helpers import config_validation as cv import voluptuous as vol @@ -8,13 +9,11 @@ DOMAIN_SERVICES = f"{DOMAIN}_services" -TRACKER_ID = "tracker_id" UPDATE_INTERVAL = "update_interval" SERVICE_SET_UPDATE_INTERVAL = "set_update_interval" -SERVICE_SET_UPDATE_INTERVAL_SCHEMA = vol.Schema( +SERVICE_SET_UPDATE_INTERVAL_SCHEMA = cv.make_entity_service_schema( { - vol.Required(TRACKER_ID): cv.string, vol.Optional(UPDATE_INTERVAL, default="30M"): cv.string, } ) @@ -23,86 +22,16 @@ SERVICE_REFRESH_LOCATION = "refresh_location" SERVICE_RING = "ring" SERVICE_VIBRATE = "vibrate" -SERVICE_SCHEMA = vol.Schema({vol.Required(TRACKER_ID): cv.string}) +SERVICE_SCHEMA = cv.make_entity_service_schema({}) _LOGGER: logging.Logger = logging.getLogger(__package__) -async def async_setup_services(hass): - """Set up services for weenect integration.""" - if hass.data.get(DOMAIN_SERVICES, False): - return - - hass.data[DOMAIN_SERVICES] = True - - async def async_call_service(service_call): - """Call correct weenect service.""" - service = service_call.service - service_data = service_call.data - - if service == SERVICE_SET_UPDATE_INTERVAL: - await async_set_update_interval(hass, service_data) - if service == SERVICE_ACTIVATE_SUPER_LIVE: - await async_activate_super_live(hass, service_data) - if service == SERVICE_REFRESH_LOCATION: - await async_refresh_location(hass, service_data) - if service == SERVICE_RING: - await async_ring(hass, service_data) - if service == SERVICE_VIBRATE: - await async_vibrate(hass, service_data) - - hass.services.async_register( - DOMAIN, - SERVICE_SET_UPDATE_INTERVAL, - async_call_service, - schema=SERVICE_SET_UPDATE_INTERVAL_SCHEMA, - ) - hass.services.async_register( - DOMAIN, - SERVICE_ACTIVATE_SUPER_LIVE, - async_call_service, - schema=SERVICE_SCHEMA, - ) - hass.services.async_register( - DOMAIN, - SERVICE_REFRESH_LOCATION, - async_call_service, - schema=SERVICE_SCHEMA, - ) - hass.services.async_register( - DOMAIN, - SERVICE_RING, - async_call_service, - schema=SERVICE_SCHEMA, - ) - hass.services.async_register( - DOMAIN, - SERVICE_VIBRATE, - async_call_service, - schema=SERVICE_SCHEMA, - ) - - -async def async_unload_services(hass): - """Unload weenect services.""" - if not hass.data.get(DOMAIN_SERVICES): - return - - hass.data[DOMAIN_SERVICES] = False - - hass.services.async_remove(DOMAIN, SERVICE_SET_UPDATE_INTERVAL) - hass.services.async_remove(DOMAIN, SERVICE_ACTIVATE_SUPER_LIVE) - hass.services.async_remove(DOMAIN, SERVICE_REFRESH_LOCATION) - hass.services.async_remove(DOMAIN, SERVICE_RING) - hass.services.async_remove(DOMAIN, SERVICE_VIBRATE) - - -async def async_set_update_interval(hass, data): +async def async_set_update_interval( + hass: HomeAssistant, tracker_id: int, update_interval: str +): """Set the update interval for this tracker id.""" - tracker_id = int(data[TRACKER_ID]) - update_interval = data[UPDATE_INTERVAL] - for config_entry in hass.data[DOMAIN]: if tracker_id in hass.data[DOMAIN][config_entry].data.keys(): await hass.data[DOMAIN][config_entry].client.set_update_interval( @@ -114,11 +43,9 @@ async def async_set_update_interval(hass, data): ) -async def async_activate_super_live(hass, data): +async def async_activate_super_live(hass: HomeAssistant, tracker_id: int): """Activate the super live mode for this tracker id""" - tracker_id = int(data[TRACKER_ID]) - for config_entry in hass.data[DOMAIN]: if tracker_id in hass.data[DOMAIN][config_entry].data.keys(): await hass.data[DOMAIN][config_entry].client.activate_super_live(tracker_id) @@ -128,11 +55,9 @@ async def async_activate_super_live(hass, data): ) -async def async_refresh_location(hass, data): +async def async_refresh_location(hass: HomeAssistant, tracker_id: int): """Request a position refresh for this tracker id""" - tracker_id = int(data[TRACKER_ID]) - for config_entry in hass.data[DOMAIN]: if tracker_id in hass.data[DOMAIN][config_entry].data.keys(): await hass.data[DOMAIN][config_entry].client.refresh_location(tracker_id) @@ -142,11 +67,9 @@ async def async_refresh_location(hass, data): ) -async def async_ring(hass, data): +async def async_ring(hass: HomeAssistant, tracker_id: int): """Send a ring command for this tracker id""" - tracker_id = int(data[TRACKER_ID]) - for config_entry in hass.data[DOMAIN]: if tracker_id in hass.data[DOMAIN][config_entry].data.keys(): await hass.data[DOMAIN][config_entry].client.ring(tracker_id) @@ -156,11 +79,9 @@ async def async_ring(hass, data): ) -async def async_vibrate(hass, data): +async def async_vibrate(hass: HomeAssistant, tracker_id: int): """Send a vibrate command for this tracker id""" - tracker_id = int(data[TRACKER_ID]) - for config_entry in hass.data[DOMAIN]: if tracker_id in hass.data[DOMAIN][config_entry].data.keys(): await hass.data[DOMAIN][config_entry].client.vibrate(tracker_id) diff --git a/custom_components/weenect/services.yaml b/custom_components/weenect/services.yaml index f79cf5e..76c7284 100644 --- a/custom_components/weenect/services.yaml +++ b/custom_components/weenect/services.yaml @@ -1,37 +1,46 @@ set_update_interval: description: Set the tracker update interval. + target: + entity: + integration: weenect + device: + integration: weenect fields: - tracker_id: - description: The tracker id. - example: '10000' update_interval: description: The update interval. Possible values are 30S 1M 5M 10M 30M 1H + required: true example: "30M" + selector: + text: activate_super_live: description: Activate the super live mode. - fields: - tracker_id: - description: The tracker id. - example: '10000' + target: + entity: + integration: weenect + device: + integration: weenect refresh_location: description: Request a location update. - fields: - tracker_id: - description: The tracker id. - example: '10000' + target: + entity: + integration: weenect + device: + integration: weenect ring: description: Let the tracker ring. - fields: - tracker_id: - description: The tracker id. - example: '10000' + target: + entity: + integration: weenect + device: + integration: weenect vibrate: description: Let the tracker vibrate. - fields: - tracker_id: - description: The tracker id. - example: '10000' + target: + entity: + integration: weenect + device: + integration: weenect diff --git a/custom_components/weenect/util.py b/custom_components/weenect/util.py index 0053a1a..65092dc 100644 --- a/custom_components/weenect/util.py +++ b/custom_components/weenect/util.py @@ -1,7 +1,7 @@ """Utility methods for weenect.""" -import re from datetime import timedelta +import re from typing import Optional