Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aneisch committed May 8, 2024
1 parent 0d526ed commit 2c32ea6
Show file tree
Hide file tree
Showing 21 changed files with 136 additions and 130 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Build Status](https://github.com/aneisch/home-assistant-config/actions/workflows/check-ha-release-compatibility.yml/badge.svg)](https://github.com/aneisch/home-assistant-config/actions)
[![GitHub last commit](https://img.shields.io/github/last-commit/aneisch/home-assistant-config)](https://github.com/aneisch/home-assistant-config/commits/master)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/y/aneisch/home-assistant-config)](https://github.com/aneisch/home-assistant-config/graphs/commit-activity)
[![HA Version](https://img.shields.io/badge/Running%20Home%20Assistant-2024.5.1%20(Latest)-brightgreen)](https://github.com/home-assistant/home-assistant/releases/latest)
[![HA Version](https://img.shields.io/badge/Running%20Home%20Assistant-2024.5.2%20(Latest)-brightgreen)](https://github.com/home-assistant/home-assistant/releases/latest)
<br><a href="https://www.buymeacoffee.com/aneisch" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-black.png" width="150px" height="35px" alt="Buy Me A Coffee" style="height: 35px !important;width: 150px !important;" ></a>


Expand Down Expand Up @@ -57,15 +57,15 @@ Also using Grafana/Influx for graphing, both running in Docker containers on NUC
Description | value
-- | --
Lines of ESPHome YAML | 2802
Lines of Home Assistant YAML | 9055
Lines of Home Assistant YAML | 9088
[Integrations](https://www.home-assistant.io/integrations/) in use | 60
Zigbee devices in [`zha`](https://www.home-assistant.io/integrations/zha/) | 26
Z-Wave devices in [`zwave_js`](https://www.home-assistant.io/integrations/zwave_js/) | 37

Description | value
-- | --
Entities in the [`automation`](https://www.home-assistant.io/components/automation) domain | 121
Entities in the [`binary_sensor`](https://www.home-assistant.io/components/binary_sensor) domain | 137
Entities in the [`binary_sensor`](https://www.home-assistant.io/components/binary_sensor) domain | 140
Entities in the [`button`](https://www.home-assistant.io/components/button) domain | 15
Entities in the [`camera`](https://www.home-assistant.io/components/camera) domain | 15
Entities in the [`climate`](https://www.home-assistant.io/components/climate) domain | 1
Expand All @@ -90,17 +90,17 @@ Entities in the [`plant`](https://www.home-assistant.io/components/plant) domain
Entities in the [`remote`](https://www.home-assistant.io/components/remote) domain | 1
Entities in the [`script`](https://www.home-assistant.io/components/script) domain | 48
Entities in the [`select`](https://www.home-assistant.io/components/select) domain | 3
Entities in the [`sensor`](https://www.home-assistant.io/components/sensor) domain | 417
Entities in the [`sensor`](https://www.home-assistant.io/components/sensor) domain | 420
Entities in the [`siren`](https://www.home-assistant.io/components/siren) domain | 1
Entities in the [`sun`](https://www.home-assistant.io/components/sun) domain | 1
Entities in the [`switch`](https://www.home-assistant.io/components/switch) domain | 166
Entities in the [`switch`](https://www.home-assistant.io/components/switch) domain | 167
Entities in the [`timer`](https://www.home-assistant.io/components/timer) domain | 6
Entities in the [`tts`](https://www.home-assistant.io/components/tts) domain | 1
Entities in the [`update`](https://www.home-assistant.io/components/update) domain | 34
Entities in the [`vacuum`](https://www.home-assistant.io/components/vacuum) domain | 1
Entities in the [`weather`](https://www.home-assistant.io/components/weather) domain | 1
Entities in the [`zone`](https://www.home-assistant.io/components/zone) domain | 6
**Total state objects** | **1195**
**Total state objects** | **1202**
## The HACS integrations/plugins that I use:
**Appdaemon**:<br>
[aneisch/follow_me_appdaemon](https://github.com/aneisch/follow_me_appdaemon)<br>
Expand Down
12 changes: 5 additions & 7 deletions configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,26 +88,24 @@ monitor_docker:
rename:
adguard: "AdGuard"
appdaemon: "Appdaemon"
configurator: "VSCode"
bvst: "BVST"
codeproject: "CodeProject.AI"
esphome: "ESPHome"
frigate: "Frigate"
grafana: "Grafana"
influxdb: "InfluxDB"
librespeed: "Speedtest"
mariadb: "MariaDB"
mealie: "Recipes"
mosquitto: "Mosquitto"
nodered: "Node-RED"
plex: "Plex"
portainer: "Portainer"
sqliteweb: "SQLite Web"
thermopro_mqtt: "Grill Monitor"
thermostat_api_server: "Thermostat API Server"
vrs: "Virtual Radar Server"
vscode: "VSCode"
watchtower: "Watchtower"
zwavejs: "Zwave-JS"
vrs: "Virtual Radar Server"
github-runner-1: "Github Runner 1"
github-runner-2: "Github Runner 2"
codeproject: "CodeProject.AI"

frontend:
themes: !include_dir_merge_named themes
Expand Down
4 changes: 2 additions & 2 deletions custom_components/alexa_media/.translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"invalid_credentials": "Nieprawidłowe dane logowania",
"invalid_url": "URL jest nieprawidłowy: {message}",
"unable_to_connect_hass_url": "Nie można połączyć się z adresem URL Home Assistanta. Sprawdź wewnętrzny adres URL w sekcji Konfiguracja -> Ogólne",
"unknown_error": "Nieznany błąd, włącz zaawansowane debugowanie i zgłoś log z tego zdarzenia"
"unknown_error": "Nieznany błąd: {message}"
},
"step": {
"proxy_warning": {
Expand All @@ -32,7 +32,7 @@
"user": {
"data": {
"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)",
Expand Down
3 changes: 2 additions & 1 deletion custom_components/alexa_media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,8 @@ async def async_update_data() -> Optional[AlexaEntityData]:
)
if not entry_setup:
_LOGGER.debug("Loading config entry for %s", component)
hass.async_add_job(
config_entry.async_create_task(
hass,
hass.config_entries.async_forward_entry_setup(
config_entry, component
)
Expand Down
11 changes: 8 additions & 3 deletions custom_components/alexa_media/alexa_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ def is_light(appliance: dict[str, Any]) -> bool:
"""Is the given appliance a light controlled locally by an Echo."""
return (
is_local(appliance)
and "LIGHT" in appliance.get("applianceTypes", [])
and (
"LIGHT" in appliance.get("applianceTypes", [])
or ("SMARTPLUG" in appliance.get("applianceTypes", []) and appliance.get("customerDefinedDeviceType") == "LIGHT")
)
and has_capability(appliance, "Alexa.PowerController", "powerState")
)

Expand All @@ -131,8 +134,10 @@ def is_switch(appliance: dict[str, Any]) -> bool:
"""Is the given appliance a switch controlled locally by an Echo."""
return (
is_local(appliance)
and "SMARTPLUG" in appliance.get("applianceTypes", [])
and appliance["manufacturerName"] == "Amazon"
and (
"SMARTPLUG" in appliance.get("applianceTypes", [])
or "SWITCH" in appliance.get("applianceTypes", [])
)
and has_capability(appliance, "Alexa.PowerController", "powerState")
)

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 @@ -14,7 +14,7 @@
PERCENTAGE,
)

__version__ = "4.9.2"
__version__ = "4.10.0"
PROJECT_URL = "https://github.com/alandtse/alexa_media_player/"
ISSUE_URL = f"{PROJECT_URL}issues"
NOTIFY_URL = f"{PROJECT_URL}wiki/Configuration%3A-Notification-Component#use-the-notifyalexa_media-service"
Expand Down
3 changes: 2 additions & 1 deletion custom_components/alexa_media/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from homeassistant.const import CONF_EMAIL, CONF_URL
from homeassistant.exceptions import ConditionErrorMessage
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.instance_id import async_get as async_get_instance_id
import wrapt

from .const import DATA_ALEXAMEDIA, EXCEPTION_TEMPLATE
Expand Down Expand Up @@ -271,7 +272,7 @@ async def calculate_uuid(hass, email: str, url: str) -> dict:
if entry.data.get(CONF_EMAIL) == email and entry.data.get(CONF_URL) == url:
return_index = index
break
uuid = await hass.helpers.instance_id.async_get()
uuid = await async_get_instance_id(hass)
result["uuid"] = hex(
int(uuid, 16)
# increment uuid for second accounts
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alexa_media/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"issue_tracker": "https://github.com/alandtse/alexa_media_player/issues",
"loggers": ["alexapy", "authcaptureproxy"],
"requirements": ["alexapy==1.27.10", "packaging>=20.3", "wrapt>=1.14.0"],
"version": "4.9.2"
"version": "4.10.0"
}
3 changes: 2 additions & 1 deletion custom_components/alexa_media/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ async def async_setup_entry(hass, config_entry, async_add_devices):
_LOGGER.debug(
"%s: Loading config entry for %s", hide_email(account), component
)
hass.async_add_job(
config_entry.async_create_task(
hass,
hass.config_entries.async_forward_entry_setup(
config_entry, component
)
Expand Down
3 changes: 2 additions & 1 deletion custom_components/alexa_media/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
BaseNotificationService,
)
from homeassistant.const import CONF_EMAIL
from homeassistant.helpers.group import expand_entity_ids
import voluptuous as vol

from .const import (
Expand Down Expand Up @@ -237,7 +238,7 @@ async def async_send_message(self, message="", **kwargs):
_LOGGER.debug("Processed Target by string: %s", processed_targets)
entities = self.convert(processed_targets, type_="entities")
try:
entities.extend(self.hass.components.group.expand_entity_ids(entities))
entities.extend(expand_entity_ids(self.hass, entities))
except ValueError:
_LOGGER.debug("Invalid Home Assistant entity in %s", entities)
tasks = []
Expand Down
32 changes: 16 additions & 16 deletions custom_components/alexa_media/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"identifier_exists": "Correo electrónico para la URL de Alexa ya registrado",
"invalid_credentials": "Credenciales no válidas",
"invalid_url": "La URL no es válida: {message}",
"unable_to_connect_hass_url": "No se puede conectar con la URL de Home Assistant. Verifique la URL externa en Configuración - > General",
"unknown_error": "Error desconocido: {mensaje}"
"unable_to_connect_hass_url": "No se puede conectar con la URL de Home Assistant. Verifique la URL externa en Configuración -> General",
"unknown_error": "Error desconocido: {message}"
},
"step": {
"proxy_warning": {
Expand Down Expand Up @@ -60,38 +60,38 @@
},
"services": {
"clear_history": {
"description": "Clear last entries from Alexa Voice history for each Alexa account.",
"description": "Borrar las últimas entradas del historial de voz de Alexa para cada cuenta.",
"fields": {
"email": {
"description": "Accounts to clear. Empty will clear all.",
"name": "Email address"
"description": "Cuentas a borrar. Si se deja vacío se borraran todas.",
"name": "Dirección de correo electrónico"
},
"entries": {
"description": "Number of entries to clear from 1 to 50. If empty, clear 50.",
"name": "Number of Entries"
"description": "Número de entradas a borrar del 1 al 50. Si se deja vacío, se borraran 50.",
"name": "Número de entradas"
}
},
"name": "Clear Amazon Voice History"
"name": "Borrar el historial de voz de Amazon"
},
"force_logout": {
"description": "Force account to logout. Used mainly for debugging.",
"description": "Obligar el cierre de sesión de la cuenta. Usar principalmente para depuración.",
"fields": {
"email": {
"description": "Accounts to clear. Empty will clear all.",
"name": "Email address"
"description": "Cuentas a borrar. Si se deja vacío se borraran todas.",
"name": "Dirección de correo electrónico"
}
},
"name": "Force Logout"
"name": "Obligar cierre de sesión"
},
"update_last_called": {
"description": "Forces update of last_called echo device for each Alexa account.",
"description": "Obligar la actualización del último dispositivo Echo llamado para cada cuenta Alexa.",
"fields": {
"email": {
"description": "List of Alexa accounts to update. If empty, will update all known accounts.",
"name": "Email address"
"description": "Cuentas de Alexa para actualizar. Si se deja vacío, se actualizaran todas las cuentas.",
"name": "Dirección de correo electrónico"
}
},
"name": "Update Last Called Sensor"
"name": "Actualizar el último sensor utilizado"
}
}
}
4 changes: 2 additions & 2 deletions custom_components/alexa_media/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"invalid_credentials": "Nieprawidłowe dane logowania",
"invalid_url": "URL jest nieprawidłowy: {message}",
"unable_to_connect_hass_url": "Nie można połączyć się z adresem URL Home Assistanta. Sprawdź wewnętrzny adres URL w sekcji Konfiguracja -> Ogólne",
"unknown_error": "Nieznany błąd, włącz zaawansowane debugowanie i zgłoś log z tego zdarzenia"
"unknown_error": "Nieznany błąd: {message}"
},
"step": {
"proxy_warning": {
Expand All @@ -32,7 +32,7 @@
"user": {
"data": {
"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)",
Expand Down
Loading

0 comments on commit 2c32ea6

Please sign in to comment.