Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
eifinger committed May 16, 2021
1 parent 6bdb1c1 commit 674f878
Show file tree
Hide file tree
Showing 24 changed files with 45 additions and 33 deletions.
2 changes: 1 addition & 1 deletion custom_components/alexa_media/.translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Invalid Built-In 2FA key",
"connection_error": "Verbindungsfehler; Netzwerk prüfen und erneut versuchen",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the Internal Url under Configuration -> General",
"hass_url_invalid": "Es kann keine Verbindung zur Home Assistant-URL hergestellt werden. Bitte überprüfen Sie die externe URL unter Konfiguration - > Allgemein",
"identifier_exists": "Diese Email ist bereits registriert",
"invalid_credentials": "Falsche Zugangsdaten",
"unknown_error": "Unbekannter Fehler, bitte Log-Info melden"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/.translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Invalid Built-In 2FA key",
"connection_error": "Error connecting; check network and retry",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the Internal Url under Configuration -> General",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the External Url under Configuration -> General",
"identifier_exists": "Email for Alexa URL already registered",
"invalid_credentials": "Invalid credentials",
"unknown_error": "Unknown error, please enable advanced debugging and report log info"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/.translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Invalid Built-In 2FA key",
"connection_error": "Error al conectar, verifique la red y vuelva a intentarlo",
"hass_url_invalid": "No se puede conectar a la url de Home Assistant. Compruebe la dirección URL interna en Configuración -> General",
"hass_url_invalid": "No se puede conectar a la url de Home Assistant. Compruebe la dirección URL externa en Configuración -> General",
"identifier_exists": "Correo electrónico para la URL de Alexa ya registrado",
"invalid_credentials": "Credenciales no válidas",
"unknown_error": "Error desconocido, por favor revisa los registros en Home Assistant y reporta el error si es necesario."
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/.translations/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Invalid Built-In 2FA key",
"connection_error": "Feil ved tilkobling; sjekk nettverket og prøv på nytt",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the Internal Url under Configuration -> General",
"hass_url_invalid": "Kan ikke koble til nettadressen til hjemmeassistenten. Vennligst sjekk den eksterne nettadressen under Konfigurasjon - > Generelt",
"identifier_exists": "E-post for Alexa URL allerede registrert",
"invalid_credentials": "ugyldige legitimasjon",
"unknown_error": "Ukjent feil, vennligst rapporter logginfo"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/.translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Invalid Built-In 2FA key",
"connection_error": "Fout bij verbinden; controleer netwerk en probeer opnieuw",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the Internal Url under Configuration -> General",
"hass_url_invalid": "Kan geen verbinding maken met de Home Assistant-URL. Controleer de externe URL onder Configuratie - > Algemeen",
"identifier_exists": "Dit e-mailadres is reeds geregistreerd",
"invalid_credentials": "Ongeldige inloggegevens",
"unknown_error": "Onbekende fout, meld de loggegevens"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/.translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Nieprawidłowy klucz z wbudowanej aplikacji uwierzytelniania dwuskładnikowego",
"connection_error": "Błąd podczas łączenia; sprawdź sieć i spróbuj ponownie",
"hass_url_invalid": "Nie można połączyć się z adresem URL Home Assistanta. Sprawdź wewnętrzny adres URL w sekcji Konfiguracja -> Ogólne",
"hass_url_invalid": "Nie można połączyć się z adresem URL Home Assistanta. Sprawdź publiczny adres URL w sekcji Konfiguracja -> Ogólne",
"identifier_exists": "Adres e-mail dla Alexy już jest zarejestrowany",
"invalid_credentials": "Nieprawidłowe dane logowania",
"unknown_error": "Nieznany błąd, zgłoś log z tego zdarzenia"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/.translations/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Chave integrada 2FA inválida",
"connection_error": "Erro de conexão; Verifique a sua conexão e tente novamente",
"hass_url_invalid": "Não foi possível conectar a URL do Home Assistant. Por favor verifique a URL interna em Configuração -> Geral",
"hass_url_invalid": "Não foi possível conectar a URL do Home Assistant. Por favor verifique a URL externa em Configuração -> Geral",
"identifier_exists": "Email para URL Alexa já registrado",
"invalid_credentials": "Credenciais inválidas",
"unknown_error": "Erro desconhecido, favor habilitar a depuração avançada e reporte as informações de registro"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/.translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Invalid Built-In 2FA key",
"connection_error": "Ошибка подключения; проверьте сеть и повторите попытку",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the Internal Url under Configuration -> General",
"hass_url_invalid": "Невозможно подключиться к URL-адресу Home Assistant. Пожалуйста, проверьте внешний URL-адрес в разделе \"Конфигурация\" - > Общие\".",
"identifier_exists": "Электронная почта для Alexa уже зарегистрирована",
"invalid_credentials": "Неверные учетные данные",
"unknown_error": "Неизвестная ошибка, пожалуйста, сообщите информацию журнала"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/.translations/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Invalid Built-In 2FA key",
"connection_error": "连接错误;检查网络并重试",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the Internal Url under Configuration -> General",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the External Url under Configuration -> General",
"identifier_exists": "Alexa URL的电子邮件已注册",
"invalid_credentials": "Invalid credentials",
"unknown_error": "Unknown error, please report log info"
Expand Down
14 changes: 13 additions & 1 deletion custom_components/alexa_media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ async def async_update_data() -> Optional[AlexaEntityData]:
should_get_network = hass.data[DATA_ALEXAMEDIA]["accounts"][email][
"should_get_network"
]
extended_entity_discovery = hass.data[DATA_ALEXAMEDIA]["accounts"][email][
"options"
].get(CONF_EXTENDED_ENTITY_DISCOVERY)

devices = {}
bluetooth = {}
Expand Down Expand Up @@ -434,7 +437,16 @@ async def async_update_data() -> Optional[AlexaEntityData]:
"should_get_network"
] = False

if entities_to_monitor:
# First run is a special case. Get the state of all entities(including disabled)
# This ensures all entities have state during startup without needing to request coordinator refresh
for typeOfEntity, entities in alexa_entities.items():
if typeOfEntity == "guard" or extended_entity_discovery:
for entity in entities:
entities_to_monitor.add(entity.get("id"))
entity_state = await get_entity_data(
login_obj, list(entities_to_monitor)
)
elif entities_to_monitor:
entity_state = optional_task_results.pop()

if new_devices:
Expand Down
20 changes: 12 additions & 8 deletions custom_components/alexa_media/alexa_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,19 @@ async def get_entity_data(
login_obj: AlexaLogin, entity_ids: List[Text]
) -> AlexaEntityData:
"""Get and process the entity data into a more usable format."""
raw = await AlexaAPI.get_entity_state(login_obj, entity_ids=entity_ids)

entities = {}
device_states = raw.get("deviceStates")
if device_states:
for device_state in device_states:
entity_id = device_state["entity"]["entityId"]
entities[entity_id] = []
for cap_state in device_state["capabilityStates"]:
entities[entity_id].append(json.loads(cap_state))
if entity_ids:
raw = await AlexaAPI.get_entity_state(login_obj, entity_ids=entity_ids)
device_states = raw.get("deviceStates", []) if isinstance(raw, dict) else None
if device_states:
for device_state in device_states:
entity_id = device_state.get("entity", {}).get("entityId")
if entity_id:
entities[entity_id] = []
cap_states = device_state.get("capabilityStates", [])
for cap_state in cap_states:
entities[entity_id].append(json.loads(cap_state))
return entities


Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
from datetime import timedelta

__version__ = "3.10.2"
__version__ = "3.10.4"
PROJECT_URL = "https://github.com/custom-components/alexa_media_player/"
ISSUE_URL = f"{PROJECT_URL}issues"

Expand Down
3 changes: 0 additions & 3 deletions custom_components/alexa_media/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ async def async_setup_platform(hass, config, add_devices_callback, discovery_inf
le["name"],
)

if devices:
await coordinator.async_refresh()

return await add_devices(
hide_email(account),
devices,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "alexa_media",
"name": "Alexa Media Player",
"version": "3.10.2",
"version": "3.10.4",
"config_flow": true,
"documentation": "https://github.com/custom-components/alexa_media_player/wiki",
"issue_tracker": "https://github.com/custom-components/alexa_media_player/issues",
Expand Down
1 change: 0 additions & 1 deletion custom_components/alexa_media/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ async def create_temperature_sensors(account_dict, temperature_entities):
account_dict["entities"]["sensor"].setdefault(serial, {})
account_dict["entities"]["sensor"][serial]["Temperature"] = sensor
devices.append(sensor)
await coordinator.async_request_refresh()
return devices


Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Invalid Built-In 2FA key",
"connection_error": "Verbindungsfehler; Netzwerk prüfen und erneut versuchen",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the Internal Url under Configuration -> General",
"hass_url_invalid": "Es kann keine Verbindung zur Home Assistant-URL hergestellt werden. Bitte überprüfen Sie die externe URL unter Konfiguration - > Allgemein",
"identifier_exists": "Diese Email ist bereits registriert",
"invalid_credentials": "Falsche Zugangsdaten",
"unknown_error": "Unbekannter Fehler, bitte Log-Info melden"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Invalid Built-In 2FA key",
"connection_error": "Error connecting; check network and retry",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the Internal Url under Configuration -> General",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the External Url under Configuration -> General",
"identifier_exists": "Email for Alexa URL already registered",
"invalid_credentials": "Invalid credentials",
"unknown_error": "Unknown error, please enable advanced debugging and report log info"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Invalid Built-In 2FA key",
"connection_error": "Error al conectar, verifique la red y vuelva a intentarlo",
"hass_url_invalid": "No se puede conectar a la url de Home Assistant. Compruebe la dirección URL interna en Configuración -> General",
"hass_url_invalid": "No se puede conectar a la url de Home Assistant. Compruebe la dirección URL externa en Configuración -> General",
"identifier_exists": "Correo electrónico para la URL de Alexa ya registrado",
"invalid_credentials": "Credenciales no válidas",
"unknown_error": "Error desconocido, por favor revisa los registros en Home Assistant y reporta el error si es necesario."
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/translations/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Invalid Built-In 2FA key",
"connection_error": "Feil ved tilkobling; sjekk nettverket og prøv på nytt",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the Internal Url under Configuration -> General",
"hass_url_invalid": "Kan ikke koble til nettadressen til hjemmeassistenten. Vennligst sjekk den eksterne nettadressen under Konfigurasjon - > Generelt",
"identifier_exists": "E-post for Alexa URL allerede registrert",
"invalid_credentials": "ugyldige legitimasjon",
"unknown_error": "Ukjent feil, vennligst rapporter logginfo"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Invalid Built-In 2FA key",
"connection_error": "Fout bij verbinden; controleer netwerk en probeer opnieuw",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the Internal Url under Configuration -> General",
"hass_url_invalid": "Kan geen verbinding maken met de Home Assistant-URL. Controleer de externe URL onder Configuratie - > Algemeen",
"identifier_exists": "Dit e-mailadres is reeds geregistreerd",
"invalid_credentials": "Ongeldige inloggegevens",
"unknown_error": "Onbekende fout, meld de loggegevens"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Nieprawidłowy klucz z wbudowanej aplikacji uwierzytelniania dwuskładnikowego",
"connection_error": "Błąd podczas łączenia; sprawdź sieć i spróbuj ponownie",
"hass_url_invalid": "Nie można połączyć się z adresem URL Home Assistanta. Sprawdź wewnętrzny adres URL w sekcji Konfiguracja -> Ogólne",
"hass_url_invalid": "Nie można połączyć się z adresem URL Home Assistanta. Sprawdź publiczny adres URL w sekcji Konfiguracja -> Ogólne",
"identifier_exists": "Adres e-mail dla Alexy już jest zarejestrowany",
"invalid_credentials": "Nieprawidłowe dane logowania",
"unknown_error": "Nieznany błąd, zgłoś log z tego zdarzenia"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/translations/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Chave integrada 2FA inválida",
"connection_error": "Erro de conexão; Verifique a sua conexão e tente novamente",
"hass_url_invalid": "Não foi possível conectar a URL do Home Assistant. Por favor verifique a URL interna em Configuração -> Geral",
"hass_url_invalid": "Não foi possível conectar a URL do Home Assistant. Por favor verifique a URL externa em Configuração -> Geral",
"identifier_exists": "Email para URL Alexa já registrado",
"invalid_credentials": "Credenciais inválidas",
"unknown_error": "Erro desconhecido, favor habilitar a depuração avançada e reporte as informações de registro"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Invalid Built-In 2FA key",
"connection_error": "Ошибка подключения; проверьте сеть и повторите попытку",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the Internal Url under Configuration -> General",
"hass_url_invalid": "Невозможно подключиться к URL-адресу Home Assistant. Пожалуйста, проверьте внешний URL-адрес в разделе \"Конфигурация\" - > Общие\".",
"identifier_exists": "Электронная почта для Alexa уже зарегистрирована",
"invalid_credentials": "Неверные учетные данные",
"unknown_error": "Неизвестная ошибка, пожалуйста, сообщите информацию журнала"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/translations/zh-Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"error": {
"2fa_key_invalid": "Invalid Built-In 2FA key",
"connection_error": "连接错误;检查网络并重试",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the Internal Url under Configuration -> General",
"hass_url_invalid": "Unable to connect to Home Assistant url. Please check the External Url under Configuration -> General",
"identifier_exists": "Alexa URL的电子邮件已注册",
"invalid_credentials": "Invalid credentials",
"unknown_error": "Unknown error, please report log info"
Expand Down

0 comments on commit 674f878

Please sign in to comment.