diff --git a/custom_components/alexa_media/__pycache__/__init__.cpython-314.pyc b/custom_components/alexa_media/__pycache__/__init__.cpython-314.pyc deleted file mode 100644 index 4fc6f84e..00000000 Binary files a/custom_components/alexa_media/__pycache__/__init__.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/alarm_control_panel.cpython-314.pyc b/custom_components/alexa_media/__pycache__/alarm_control_panel.cpython-314.pyc deleted file mode 100644 index ba54f625..00000000 Binary files a/custom_components/alexa_media/__pycache__/alarm_control_panel.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/alexa_entity.cpython-314.pyc b/custom_components/alexa_media/__pycache__/alexa_entity.cpython-314.pyc deleted file mode 100644 index 45b331a5..00000000 Binary files a/custom_components/alexa_media/__pycache__/alexa_entity.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/alexa_media.cpython-314.pyc b/custom_components/alexa_media/__pycache__/alexa_media.cpython-314.pyc deleted file mode 100644 index 9a541b8e..00000000 Binary files a/custom_components/alexa_media/__pycache__/alexa_media.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/config_flow.cpython-314.pyc b/custom_components/alexa_media/__pycache__/config_flow.cpython-314.pyc deleted file mode 100644 index a373ce0d..00000000 Binary files a/custom_components/alexa_media/__pycache__/config_flow.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/const.cpython-314.pyc b/custom_components/alexa_media/__pycache__/const.cpython-314.pyc deleted file mode 100644 index 11065b00..00000000 Binary files a/custom_components/alexa_media/__pycache__/const.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/coordinator.cpython-314.pyc b/custom_components/alexa_media/__pycache__/coordinator.cpython-314.pyc deleted file mode 100644 index 500e665d..00000000 Binary files a/custom_components/alexa_media/__pycache__/coordinator.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/diagnostics.cpython-314.pyc b/custom_components/alexa_media/__pycache__/diagnostics.cpython-314.pyc deleted file mode 100644 index 240fd97d..00000000 Binary files a/custom_components/alexa_media/__pycache__/diagnostics.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/exceptions.cpython-314.pyc b/custom_components/alexa_media/__pycache__/exceptions.cpython-314.pyc deleted file mode 100644 index f408fda1..00000000 Binary files a/custom_components/alexa_media/__pycache__/exceptions.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/helpers.cpython-314.pyc b/custom_components/alexa_media/__pycache__/helpers.cpython-314.pyc deleted file mode 100644 index 9daf9ec4..00000000 Binary files a/custom_components/alexa_media/__pycache__/helpers.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/light.cpython-314.pyc b/custom_components/alexa_media/__pycache__/light.cpython-314.pyc deleted file mode 100644 index d28c777a..00000000 Binary files a/custom_components/alexa_media/__pycache__/light.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/media_player.cpython-314.pyc b/custom_components/alexa_media/__pycache__/media_player.cpython-314.pyc deleted file mode 100644 index 6f7f7274..00000000 Binary files a/custom_components/alexa_media/__pycache__/media_player.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/metrics.cpython-314.pyc b/custom_components/alexa_media/__pycache__/metrics.cpython-314.pyc deleted file mode 100644 index 23f4f380..00000000 Binary files a/custom_components/alexa_media/__pycache__/metrics.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/notify.cpython-314.pyc b/custom_components/alexa_media/__pycache__/notify.cpython-314.pyc deleted file mode 100644 index b08430fc..00000000 Binary files a/custom_components/alexa_media/__pycache__/notify.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/runtime_data.cpython-314.pyc b/custom_components/alexa_media/__pycache__/runtime_data.cpython-314.pyc deleted file mode 100644 index 93badbfc..00000000 Binary files a/custom_components/alexa_media/__pycache__/runtime_data.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/sensor.cpython-314.pyc b/custom_components/alexa_media/__pycache__/sensor.cpython-314.pyc deleted file mode 100644 index bc4af512..00000000 Binary files a/custom_components/alexa_media/__pycache__/sensor.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/services.cpython-314.pyc b/custom_components/alexa_media/__pycache__/services.cpython-314.pyc deleted file mode 100644 index aa871fe0..00000000 Binary files a/custom_components/alexa_media/__pycache__/services.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/__pycache__/switch.cpython-314.pyc b/custom_components/alexa_media/__pycache__/switch.cpython-314.pyc deleted file mode 100644 index c3fd8f86..00000000 Binary files a/custom_components/alexa_media/__pycache__/switch.cpython-314.pyc and /dev/null differ diff --git a/custom_components/alexa_media/binary_sensor.py b/custom_components/alexa_media/binary_sensor.py index dcfe0541..297c074e 100644 --- a/custom_components/alexa_media/binary_sensor.py +++ b/custom_components/alexa_media/binary_sensor.py @@ -7,14 +7,16 @@ For more details about this platform, please refer to the documentation at https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639 """ +from datetime import timedelta import logging -from alexapy import hide_serial +from alexapy import AlexaAPI, hide_serial from homeassistant.components.binary_sensor import ( BinarySensorDeviceClass, BinarySensorEntity, ) from homeassistant.exceptions import ConfigEntryNotReady +from homeassistant.helpers.event import async_track_time_interval from homeassistant.helpers.update_coordinator import CoordinatorEntity from . import ( @@ -26,10 +28,13 @@ from . import ( ) from .alexa_entity import parse_detection_state_from_coordinator from .const import CONF_EXTENDED_ENTITY_DISCOVERY -from .helpers import add_devices, safe_get +from .helpers import _catch_login_errors, add_devices, safe_get _LOGGER = logging.getLogger(__name__) +KIDS_SCAN_INTERVAL = timedelta(minutes=5) +KIDS_CAPABLE_FAMILIES = {"ECHO", "ROOK", "KNIGHT", "REAVER", "MANTIS"} + async def async_setup_platform(hass, config, add_devices_callback, discovery_info=None): """Set up the Alexa sensor platform.""" @@ -57,13 +62,38 @@ async def async_setup_platform(hass, config, add_devices_callback, discovery_inf account_dict["entities"]["binary_sensor"].append(contact_sensor) devices.append(contact_sensor) - return await add_devices( + # Amazon Kids (child mode) sensor per Echo device. + # Only create a sensor for Echos that already have a media_player entity, so + # the configured include/exclude device filters are inherited and the unique + # id can be scoped to the account exactly like the media player. + login_obj = account_dict["login_obj"] + media_players = account_dict["entities"]["media_player"] + kids_devices: list[BinarySensorEntity] = [] + for key, device in account_dict["devices"]["media_player"].items(): + if device.get("deviceFamily") not in KIDS_CAPABLE_FAMILIES: + continue + device_type = device.get("deviceType") + client = media_players.get(key) + if not device_type or client is None: + continue + kids_sensor = AmazonKidsSensor(login_obj, client, device_type) + account_dict["entities"]["binary_sensor"].append(kids_sensor) + kids_devices.append(kids_sensor) + + result = await add_devices( hide_email(account), devices, add_devices_callback, include_filter, exclude_filter, ) + if kids_devices: + # Already scoped via the media_player entities, so no extra name filter. + result = ( + await add_devices(hide_email(account), kids_devices, add_devices_callback) + and result + ) + return result async def async_setup_entry(hass, config_entry, async_add_devices): @@ -126,3 +156,71 @@ class AlexaContact(CoordinatorEntity, BinarySensorEntity): self.coordinator.data and self.alexa_entity_id in self.coordinator.data ) return not last_refresh_success + + +class AmazonKidsSensor(BinarySensorEntity): + """Whether Amazon Kids (child mode) is active on an Echo device. + + Polls the per-device ``isChildDirectedDevice`` state via alexapy on its own + interval (independent of the main coordinator). + """ + + _attr_has_entity_name = True + _attr_name = "Amazon Kids" + _attr_icon = "mdi:account-child" + _attr_should_poll = False + + def __init__(self, login, client, device_type: str) -> None: + """Initialize the Amazon Kids sensor. + + client is the Echo's media_player entity; its unique id already encodes + the account, so the sensor inherits the same (account-scoped) identity. + """ + self._login = login + self._client = client + self._serial = client.device_serial_number + self._device_type = device_type + self._state = None + + @property + def unique_id(self): + """Return the unique id, scoped to the account like the media player.""" + return f"{self._client.unique_id}_amazon_kids" + + @property + def is_on(self): + """Return whether Amazon Kids is active.""" + return self._state + + @property + def available(self): + """Return whether the state is known.""" + return self._state is not None + + @property + def device_info(self): + """Attach to the Echo device.""" + return { + "identifiers": {(DATA_ALEXAMEDIA, self._client.unique_id)}, + "via_device": (DATA_ALEXAMEDIA, self._client.unique_id), + } + + async def async_added_to_hass(self): + """Do an initial refresh and schedule periodic updates.""" + await self._async_refresh() + self.async_on_remove( + async_track_time_interval( + self.hass, self._async_interval, KIDS_SCAN_INTERVAL + ) + ) + + async def _async_interval(self, now): + await self._async_refresh() + + @_catch_login_errors + async def _async_refresh(self): + """Fetch the current Amazon Kids state.""" + self._state = await AlexaAPI.get_child_mode( + self._login, self._serial, self._device_type + ) + self.async_write_ha_state() diff --git a/custom_components/alexa_media/const.py b/custom_components/alexa_media/const.py index bf63ee14..d9e8bcb5 100644 --- a/custom_components/alexa_media/const.py +++ b/custom_components/alexa_media/const.py @@ -11,11 +11,23 @@ from __future__ import annotations from datetime import timedelta -from homeassistant.const import ( - CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, - CONCENTRATION_PARTS_PER_MILLION, - PERCENTAGE, -) +from homeassistant.const import PERCENTAGE + +try: + # UnitOfDensity/UnitOfRatio were added in HA 2026.7.0. Below that (this + # integration's floor is 2025.2.0), fall back to the equivalent + # CONCENTRATION_* constants -- deprecated starting in HA 2026.8 (removed + # in 2027.8) but still present as aliases for the same values, and the + # only ones that exist pre-2026.7. + from homeassistant.const import UnitOfDensity, UnitOfRatio + + _MICROGRAMS_PER_CUBIC_METER = UnitOfDensity.MICROGRAMS_PER_CUBIC_METER + _PARTS_PER_MILLION = UnitOfRatio.PARTS_PER_MILLION +except ImportError: + from homeassistant.const import ( + CONCENTRATION_MICROGRAMS_PER_CUBIC_METER as _MICROGRAMS_PER_CUBIC_METER, + CONCENTRATION_PARTS_PER_MILLION as _PARTS_PER_MILLION, + ) PROJECT_URL = "https://github.com/alandtse/alexa_media_player/" ISSUE_URL = f"{PROJECT_URL}issues" @@ -78,6 +90,8 @@ SERVICE_RESTORE_VOLUME = "restore_volume" SERVICE_GET_HISTORY_RECORDS = "get_history_records" SERVICE_FORCE_LOGOUT = "force_logout" SERVICE_ENABLE_NETWORK_DISCOVERY = "enable_network_discovery" +SERVICE_AMAZON_KIDS_ENABLE = "amazon_kids_enable" +SERVICE_AMAZON_KIDS_DISABLE = "amazon_kids_disable" # Backoff durations for the last-called probe worker LAST_CALLED_429_BACKOFF_INITIAL_S = 30.0 @@ -147,6 +161,7 @@ ATTR_MESSAGE = "message" ATTR_EMAIL = "email" ATTR_ENTITY_ID = "entity_id" ATTR_NUM_ENTRIES = "entries" +ATTR_CHILD = "child" COMMON_BUCKET_COUNTS = ( "accounts", "devices", @@ -213,8 +228,8 @@ AUTH_PROXY_NAME = "auth:alexamedia:proxy" ALEXA_UNIT_CONVERSION = { "Alexa.Unit.Percent": PERCENTAGE, - "Alexa.Unit.PartsPerMillion": CONCENTRATION_PARTS_PER_MILLION, - "Alexa.Unit.Density.MicroGramsPerCubicMeter": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, + "Alexa.Unit.PartsPerMillion": _PARTS_PER_MILLION, + "Alexa.Unit.Density.MicroGramsPerCubicMeter": _MICROGRAMS_PER_CUBIC_METER, } ALEXA_ICON_CONVERSION = { diff --git a/custom_components/alexa_media/manifest.json b/custom_components/alexa_media/manifest.json index 5f888d87..38e2ee4f 100644 --- a/custom_components/alexa_media/manifest.json +++ b/custom_components/alexa_media/manifest.json @@ -9,10 +9,10 @@ "issue_tracker": "https://github.com/alandtse/alexa_media_player/issues", "loggers": ["alexapy", "authcaptureproxy"], "requirements": [ - "alexapy==1.29.25", + "alexapy==1.30.0", "packaging>=20.3", "wrapt>=1.14.0", "dictor>=0.1.12,<0.2" ], - "version": "5.15.7" + "version": "5.16.0" } diff --git a/custom_components/alexa_media/services.py b/custom_components/alexa_media/services.py index 055fa69a..e32694e2 100644 --- a/custom_components/alexa_media/services.py +++ b/custom_components/alexa_media/services.py @@ -16,14 +16,18 @@ from alexapy import AlexaAPI, AlexapyLoginError, hide_email from alexapy.errors import AlexapyConnectionError from homeassistant.core import HomeAssistant, ServiceCall from homeassistant.helpers import config_validation as cv, entity_registry as er +from homeassistant.util import slugify import voluptuous as vol from .const import ( + ATTR_CHILD, ATTR_EMAIL, ATTR_ENTITY_ID, ATTR_NUM_ENTRIES, DATA_ALEXAMEDIA, DOMAIN, + SERVICE_AMAZON_KIDS_DISABLE, + SERVICE_AMAZON_KIDS_ENABLE, SERVICE_ENABLE_NETWORK_DISCOVERY, SERVICE_FORCE_LOGOUT, SERVICE_GET_HISTORY_RECORDS, @@ -59,6 +63,14 @@ ENABLE_NETWORK_DISCOVERY_SCHEMA = vol.Schema( } ) +AMAZON_KIDS_ENABLE_SCHEMA = vol.Schema( + { + vol.Required(ATTR_ENTITY_ID): cv.entity_id, + vol.Required(ATTR_CHILD): cv.string, + } +) +AMAZON_KIDS_DISABLE_SCHEMA = vol.Schema({vol.Required(ATTR_ENTITY_ID): cv.entity_id}) + @dataclass(frozen=True) class AlexaServiceDef: @@ -95,6 +107,16 @@ SERVICE_DEFS: tuple[AlexaServiceDef, ...] = ( schema=ENABLE_NETWORK_DISCOVERY_SCHEMA, handler="enable_network_discovery", ), + AlexaServiceDef( + name=SERVICE_AMAZON_KIDS_ENABLE, + schema=AMAZON_KIDS_ENABLE_SCHEMA, + handler="amazon_kids_enable", + ), + AlexaServiceDef( + name=SERVICE_AMAZON_KIDS_DISABLE, + schema=AMAZON_KIDS_DISABLE_SCHEMA, + handler="amazon_kids_disable", + ), ) @@ -276,6 +298,75 @@ class AlexaMediaServices: _LOGGER.debug("Volume restored to %s for entity %s", previous_volume, entity_id) return True + def _resolve_device(self, entity_id): + """Resolve a media_player entity_id to (login_obj, serial, device_type).""" + entity_registry = er.async_get(self.hass) + entity_entry = entity_registry.async_get(entity_id) + if not entity_entry or entity_entry.platform != DOMAIN: + _LOGGER.error("Entity %s not found or not part of %s", entity_id, DOMAIN) + return None, None, None + unique_id = entity_entry.unique_id + accounts = self.hass.data[DATA_ALEXAMEDIA]["accounts"] + for email, account_dict in accounts.items(): + for device in AlexaAPI.devices.get(email, []): + serial = device.get("serialNumber") + if not serial: + continue + # Match the media_player unique id convention: raw serial for the + # primary account, slugify("_") for secondaries. + if unique_id in (serial, slugify(f"{serial}_{email}")): + return account_dict["login_obj"], serial, device.get("deviceType") + _LOGGER.error("No Alexa Media account/device found for entity %s", entity_id) + return None, None, None + + async def _resolve_child_id(self, login_obj, child): + """Resolve a child (directedId or first name) to its directedId.""" + if child and child.startswith("amzn1.account"): + return child + profiles = await AlexaAPI.get_child_profiles(login_obj) or [] + for profile in profiles: + if (profile.get("firstName") or "").lower() == (child or "").lower(): + return profile.get("directedId") + _LOGGER.error("Child profile '%s' not found in household", child) + return None + + @_catch_login_errors + async def amazon_kids_enable(self, call: ServiceCall) -> bool: + """Enable Amazon Kids on a device by assigning it to a child profile. + + Arguments: + call.ATTR_ENTITY_ID {str} -- Alexa Media Player entity. + call.ATTR_CHILD {str} -- Child first name or directedId. + + """ + entity_id = call.data.get(ATTR_ENTITY_ID) + child = call.data.get(ATTR_CHILD) + login_obj, serial, device_type = self._resolve_device(entity_id) + if not login_obj: + return False + child_id = await self._resolve_child_id(login_obj, child) + if not child_id: + return False + await AlexaAPI.enable_child_mode(login_obj, serial, device_type, child_id) + _LOGGER.debug("Enabled Amazon Kids on %s for child %s", entity_id, child) + return True + + @_catch_login_errors + async def amazon_kids_disable(self, call: ServiceCall) -> bool: + """Disable Amazon Kids on a device (unassign it from any child). + + Arguments: + call.ATTR_ENTITY_ID {str} -- Alexa Media Player entity. + + """ + entity_id = call.data.get(ATTR_ENTITY_ID) + login_obj, serial, device_type = self._resolve_device(entity_id) + if not login_obj: + return False + await AlexaAPI.disable_child_mode(login_obj, serial, device_type) + _LOGGER.debug("Disabled Amazon Kids on %s", entity_id) + return True + async def get_history_records(self, call: ServiceCall) -> bool: """Handle request to get history records and store them on the entity.""" entity_id = call.data.get(ATTR_ENTITY_ID) diff --git a/custom_components/alexa_media/services.yaml b/custom_components/alexa_media/services.yaml index e6651ab0..0842f008 100644 --- a/custom_components/alexa_media/services.yaml +++ b/custom_components/alexa_media/services.yaml @@ -68,3 +68,36 @@ enable_network_discovery: example: [email protected] selector: text: + +amazon_kids_enable: + name: Enable Amazon Kids + description: Enable Amazon Kids (child mode) on an Echo by assigning it to a child profile. + fields: + entity_id: + name: Entity + description: Alexa Media Player device to enable Amazon Kids on. + required: true + selector: + entity: + domain: media_player + integration: alexa_media + child: + name: Child + description: Child profile first name (or directedId) to assign the device to. + required: true + example: "Anton" + selector: + text: + +amazon_kids_disable: + name: Disable Amazon Kids + description: Disable Amazon Kids (child mode) on an Echo by unassigning it from any child. + fields: + entity_id: + name: Entity + description: Alexa Media Player device to disable Amazon Kids on. + required: true + selector: + entity: + domain: media_player + integration: alexa_media diff --git a/custom_components/alexa_media/strings.json b/custom_components/alexa_media/strings.json index b1e1c9f6..d62eba2c 100644 --- a/custom_components/alexa_media/strings.json +++ b/custom_components/alexa_media/strings.json @@ -132,6 +132,30 @@ "description": "Optional Alexa account email or list of emails. If empty, all known accounts will be refreshed." } } + }, + "amazon_kids_enable": { + "name": "Enable Amazon Kids", + "description": "Turns on Amazon Kids (child mode) for an Echo by assigning it to a child profile.", + "fields": { + "entity_id": { + "name": "Select media player:", + "description": "Echo device to enable Amazon Kids on" + }, + "child": { + "name": "Child", + "description": "Child profile to assign (first name or directedId)" + } + } + }, + "amazon_kids_disable": { + "name": "Disable Amazon Kids", + "description": "Turns off Amazon Kids (child mode) for an Echo by unassigning it from any child profile.", + "fields": { + "entity_id": { + "name": "Select media player:", + "description": "Echo device to disable Amazon Kids on" + } + } } }, "entity": { diff --git a/custom_components/alexa_media/translations/ar.json b/custom_components/alexa_media/translations/ar.json index 262c074a..219d2618 100644 --- a/custom_components/alexa_media/translations/ar.json +++ b/custom_components/alexa_media/translations/ar.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Turns off Amazon Kids (child mode) for an Echo by unassigning it from any child profile.", + "fields": { + "entity_id": { + "description": "Echo device to disable Amazon Kids on", + "name": "Select media player:" + } + }, + "name": "Disable Amazon Kids" + }, + "amazon_kids_enable": { + "description": "Turns on Amazon Kids (child mode) for an Echo by assigning it to a child profile.", + "fields": { + "child": { + "description": "Child profile to assign (first name or directedId)", + "name": "Child" + }, + "entity_id": { + "description": "Echo device to enable Amazon Kids on", + "name": "Select media player:" + } + }, + "name": "Enable Amazon Kids" + }, "enable_network_discovery": { "description": "يعيد تفعيل اكتشاف شبكة Alexa بحيث تعيد دورة الاستطلاع التالية اكتشاف أجهزة Alexa للحسابات المحددة.", "fields": { diff --git a/custom_components/alexa_media/translations/bg.json b/custom_components/alexa_media/translations/bg.json index 970da804..3a1819fb 100644 --- a/custom_components/alexa_media/translations/bg.json +++ b/custom_components/alexa_media/translations/bg.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Turns off Amazon Kids (child mode) for an Echo by unassigning it from any child profile.", + "fields": { + "entity_id": { + "description": "Echo device to disable Amazon Kids on", + "name": "Select media player:" + } + }, + "name": "Disable Amazon Kids" + }, + "amazon_kids_enable": { + "description": "Turns on Amazon Kids (child mode) for an Echo by assigning it to a child profile.", + "fields": { + "child": { + "description": "Child profile to assign (first name or directedId)", + "name": "Child" + }, + "entity_id": { + "description": "Echo device to enable Amazon Kids on", + "name": "Select media player:" + } + }, + "name": "Enable Amazon Kids" + }, "enable_network_discovery": { "description": "Re-enables Alexa network discovery so the next polling cycle will rediscover Alexa devices for the selected accounts.", "fields": { diff --git a/custom_components/alexa_media/translations/bg_BG.json b/custom_components/alexa_media/translations/bg_BG.json index 970da804..3a1819fb 100644 --- a/custom_components/alexa_media/translations/bg_BG.json +++ b/custom_components/alexa_media/translations/bg_BG.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Turns off Amazon Kids (child mode) for an Echo by unassigning it from any child profile.", + "fields": { + "entity_id": { + "description": "Echo device to disable Amazon Kids on", + "name": "Select media player:" + } + }, + "name": "Disable Amazon Kids" + }, + "amazon_kids_enable": { + "description": "Turns on Amazon Kids (child mode) for an Echo by assigning it to a child profile.", + "fields": { + "child": { + "description": "Child profile to assign (first name or directedId)", + "name": "Child" + }, + "entity_id": { + "description": "Echo device to enable Amazon Kids on", + "name": "Select media player:" + } + }, + "name": "Enable Amazon Kids" + }, "enable_network_discovery": { "description": "Re-enables Alexa network discovery so the next polling cycle will rediscover Alexa devices for the selected accounts.", "fields": { diff --git a/custom_components/alexa_media/translations/de.json b/custom_components/alexa_media/translations/de.json index c86f7c38..95a911ce 100644 --- a/custom_components/alexa_media/translations/de.json +++ b/custom_components/alexa_media/translations/de.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Deaktiviert Amazon Kids (Kindermodus) für ein Echo-Gerät, indem es von allen Kinderprofilen entfernt wird.", + "fields": { + "entity_id": { + "description": "Echo-Gerät zum Deaktivieren von Amazon Kids", + "name": "Medienplayer auswählen:" + } + }, + "name": "Amazon Kids deaktivieren" + }, + "amazon_kids_enable": { + "description": "Aktiviert Amazon Kids (Kindermodus) für ein Echo-Gerät, indem es einem Kinderprofil zugewiesen wird.", + "fields": { + "child": { + "description": "Kinderprofil zuweisen (Vorname oder Directed-ID)", + "name": "Kind" + }, + "entity_id": { + "description": "Echo-Gerät zum Aktivieren von Amazon Kids", + "name": "Medienplayer auswählen:" + } + }, + "name": "Amazon Kids aktivieren" + }, "enable_network_discovery": { "description": "Aktiviert die Alexa-Netzwerkerkennung erneut, sodass beim nächsten Abfragezyklus die Alexa-Geräte für die ausgewählten Konten erneut erkannt werden.", "fields": { diff --git a/custom_components/alexa_media/translations/en.json b/custom_components/alexa_media/translations/en.json index 970da804..3a1819fb 100644 --- a/custom_components/alexa_media/translations/en.json +++ b/custom_components/alexa_media/translations/en.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Turns off Amazon Kids (child mode) for an Echo by unassigning it from any child profile.", + "fields": { + "entity_id": { + "description": "Echo device to disable Amazon Kids on", + "name": "Select media player:" + } + }, + "name": "Disable Amazon Kids" + }, + "amazon_kids_enable": { + "description": "Turns on Amazon Kids (child mode) for an Echo by assigning it to a child profile.", + "fields": { + "child": { + "description": "Child profile to assign (first name or directedId)", + "name": "Child" + }, + "entity_id": { + "description": "Echo device to enable Amazon Kids on", + "name": "Select media player:" + } + }, + "name": "Enable Amazon Kids" + }, "enable_network_discovery": { "description": "Re-enables Alexa network discovery so the next polling cycle will rediscover Alexa devices for the selected accounts.", "fields": { diff --git a/custom_components/alexa_media/translations/es.json b/custom_components/alexa_media/translations/es.json index 6a7f30d6..2d94098a 100644 --- a/custom_components/alexa_media/translations/es.json +++ b/custom_components/alexa_media/translations/es.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Desactiva Amazon Kids (modo infantil) para un Echo desvinculándolo de cualquier perfil infantil.", + "fields": { + "entity_id": { + "description": "Dispositivo Echo para desactivar Amazon Kids en", + "name": "Seleccione el reproductor multimedia:" + } + }, + "name": "Desactivar Amazon Kids" + }, + "amazon_kids_enable": { + "description": "Activa Amazon Kids (modo infantil) para un Echo asignándole un perfil infantil.", + "fields": { + "child": { + "description": "Perfil del niño a asignar (nombre o ID dirigido)", + "name": "Niño" + }, + "entity_id": { + "description": "Dispositivo Echo para habilitar Amazon Kids en", + "name": "Seleccione el reproductor multimedia:" + } + }, + "name": "Habilitar Amazon Kids" + }, "enable_network_discovery": { "description": "Vuelve a habilitar el descubrimiento de red de Alexa para que el próximo ciclo de sondeo redescubra los dispositivos Alexa para las cuentas seleccionadas.", "fields": { diff --git a/custom_components/alexa_media/translations/fr.json b/custom_components/alexa_media/translations/fr.json index 2dfb83be..d50ecf44 100644 --- a/custom_components/alexa_media/translations/fr.json +++ b/custom_components/alexa_media/translations/fr.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Désactive Amazon Kids (mode enfant) pour un Echo en le dissociant de tout profil enfant.", + "fields": { + "entity_id": { + "description": "appareil Echo pour désactiver Amazon Kids sur", + "name": "Sélectionner le lecteur multimédia :" + } + }, + "name": "Désactiver Amazon Kids" + }, + "amazon_kids_enable": { + "description": "Active Amazon Kids (mode enfant) pour un Echo en l'associant à un profil enfant.", + "fields": { + "child": { + "description": "Profil enfant à attribuer (prénom ou identifiant direct)", + "name": "Enfant" + }, + "entity_id": { + "description": "Appareil Echo pour activer Amazon Kids sur", + "name": "Sélectionner le lecteur multimédia :" + } + }, + "name": "Activer Amazon Kids" + }, "enable_network_discovery": { "description": "Réactive la découverte du réseau Alexa afin que le prochain cycle d'interrogation redécouvre les appareils Alexa pour les comptes sélectionnés.", "fields": { diff --git a/custom_components/alexa_media/translations/it.json b/custom_components/alexa_media/translations/it.json index 2910a894..987ec0d4 100644 --- a/custom_components/alexa_media/translations/it.json +++ b/custom_components/alexa_media/translations/it.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Disattiva Amazon Kids (modalità bambino) per un Echo rimuovendolo da qualsiasi profilo bambino.", + "fields": { + "entity_id": { + "description": "Dispositivo Echo per disattivare Amazon Kids su", + "name": "Seleziona il lettore multimediale:" + } + }, + "name": "Disattiva Amazon Kids" + }, + "amazon_kids_enable": { + "description": "Attiva Amazon Kids (modalità bambino) per un dispositivo Echo assegnandolo a un profilo bambino.", + "fields": { + "child": { + "description": "Profilo bambino da assegnare (nome o ID indirizzato)", + "name": "Bambino" + }, + "entity_id": { + "description": "Dispositivo Echo per abilitare Amazon Kids su", + "name": "Seleziona il lettore multimediale:" + } + }, + "name": "Abilita Amazon Kids" + }, "enable_network_discovery": { "description": "Riattiva la rilevazione della rete Alexa in modo che il successivo ciclo di sondaggio rilevi i dispositivi Alexa per gli account selezionati.", "fields": { diff --git a/custom_components/alexa_media/translations/ja.json b/custom_components/alexa_media/translations/ja.json index 0acb099a..0a18c3ab 100644 --- a/custom_components/alexa_media/translations/ja.json +++ b/custom_components/alexa_media/translations/ja.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Turns off Amazon Kids (child mode) for an Echo by unassigning it from any child profile.", + "fields": { + "entity_id": { + "description": "Echo device to disable Amazon Kids on", + "name": "Select media player:" + } + }, + "name": "Disable Amazon Kids" + }, + "amazon_kids_enable": { + "description": "Turns on Amazon Kids (child mode) for an Echo by assigning it to a child profile.", + "fields": { + "child": { + "description": "Child profile to assign (first name or directedId)", + "name": "Child" + }, + "entity_id": { + "description": "Echo device to enable Amazon Kids on", + "name": "Select media player:" + } + }, + "name": "Enable Amazon Kids" + }, "enable_network_discovery": { "description": "Alexa ネットワーク検出を再度有効にすると、次のポーリングサイクルで、選択したアカウントの Alexa デバイスが再検出されます。", "fields": { diff --git a/custom_components/alexa_media/translations/nb.json b/custom_components/alexa_media/translations/nb.json index 70f63399..a8a094e5 100644 --- a/custom_components/alexa_media/translations/nb.json +++ b/custom_components/alexa_media/translations/nb.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Slår av Amazon Kids (barnemodus) for en Echo ved å fjerne tilordningen fra en hvilken som helst barneprofil.", + "fields": { + "entity_id": { + "description": "Echo-enhet for å deaktivere Amazon Kids på", + "name": "Velg mediespiller:" + } + }, + "name": "Deaktiver Amazon Kids" + }, + "amazon_kids_enable": { + "description": "Slår på Amazon Kids (barnemodus) for en Echo ved å tilordne den til en barneprofil.", + "fields": { + "child": { + "description": "Barneprofil som skal tilordnes (fornavn eller directedId)", + "name": "Barn" + }, + "entity_id": { + "description": "Echo-enhet for å aktivere Amazon Kids", + "name": "Velg mediespiller:" + } + }, + "name": "Aktiver Amazon Kids" + }, "enable_network_discovery": { "description": "Aktiverer Alexa-nettverksoppdagelse på nytt, slik at neste avstemningssyklus vil oppdage Alexa-enheter på nytt for de valgte kontoene.", "fields": { diff --git a/custom_components/alexa_media/translations/nl.json b/custom_components/alexa_media/translations/nl.json index 424d54d6..dabbae30 100644 --- a/custom_components/alexa_media/translations/nl.json +++ b/custom_components/alexa_media/translations/nl.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Hiermee wordt Amazon Kids (kindermodus) voor een Echo uitgeschakeld door het apparaat los te koppelen van elk kinderprofiel.", + "fields": { + "entity_id": { + "description": "Amazon Kids uitschakelen op het Echo-apparaat", + "name": "Selecteer een mediaspeler:" + } + }, + "name": "Amazon Kids uitschakelen" + }, + "amazon_kids_enable": { + "description": "Hiermee wordt Amazon Kids (kindermodus) voor een Echo ingeschakeld door het apparaat aan een kinderprofiel toe te wijzen.", + "fields": { + "child": { + "description": "Kindprofiel dat moet worden toegewezen (voornaam of directedId)", + "name": "Kind" + }, + "entity_id": { + "description": "Echo-apparaat om Amazon Kids in te schakelen", + "name": "Selecteer een mediaspeler:" + } + }, + "name": "Amazon Kids inschakelen" + }, "enable_network_discovery": { "description": "Hiermee wordt de Alexa-netwerkdetectie opnieuw ingeschakeld, zodat de volgende pollingcyclus Alexa-apparaten voor de geselecteerde accounts opnieuw kan detecteren.", "fields": { diff --git a/custom_components/alexa_media/translations/pl.json b/custom_components/alexa_media/translations/pl.json index bdb069c0..7bb30142 100644 --- a/custom_components/alexa_media/translations/pl.json +++ b/custom_components/alexa_media/translations/pl.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Wyłącza Amazon Kids (tryb dziecięcy) dla urządzenia Echo poprzez usunięcie jego przypisania do dowolnego profilu dziecięcego.", + "fields": { + "entity_id": { + "description": "Urządzenie Echo do wyłączania Amazon Kids", + "name": "Wybierz odtwarzacz multimedialny:" + } + }, + "name": "Wyłącz Amazon Kids" + }, + "amazon_kids_enable": { + "description": "Włącza Amazon Kids (tryb dziecięcy) dla urządzenia Echo poprzez przypisanie go do profilu dziecięcego.", + "fields": { + "child": { + "description": "Profil dziecka do przypisania (imię lub directionId)", + "name": "Dziecko" + }, + "entity_id": { + "description": "Urządzenie Echo umożliwiające korzystanie z Amazon Kids", + "name": "Wybierz odtwarzacz multimedialny:" + } + }, + "name": "Włącz Amazon Kids" + }, "enable_network_discovery": { "description": "Ponownie włącza wykrywanie sieci Alexa, dzięki czemu kolejny cykl sondowania ponownie wykryje urządzenia Alexa dla wybranych kont.", "fields": { diff --git a/custom_components/alexa_media/translations/pt-BR.json b/custom_components/alexa_media/translations/pt-BR.json index ecad922b..7d1fe61e 100644 --- a/custom_components/alexa_media/translations/pt-BR.json +++ b/custom_components/alexa_media/translations/pt-BR.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Desativa o Amazon Kids (modo infantil) para um dispositivo Echo, removendo-o de qualquer perfil infantil.", + "fields": { + "entity_id": { + "description": "Dispositivo Echo para desativar o Amazon Kids em", + "name": "Selecione o media player:" + } + }, + "name": "Desativar Amazon Kids" + }, + "amazon_kids_enable": { + "description": "Ativa o Amazon Kids (modo infantil) em um dispositivo Echo, atribuindo-o a um perfil infantil.", + "fields": { + "child": { + "description": "Perfil da criança a ser atribuído (primeiro nome ou directedId)", + "name": "Criança" + }, + "entity_id": { + "description": "Dispositivo Echo para ativar o Amazon Kids", + "name": "Selecione o media player:" + } + }, + "name": "Ative o Amazon Kids" + }, "enable_network_discovery": { "description": "Reativa a descoberta de rede da Alexa para que o próximo ciclo de pesquisa redescubra os dispositivos Alexa das contas selecionadas.", "fields": { diff --git a/custom_components/alexa_media/translations/pt.json b/custom_components/alexa_media/translations/pt.json index 711bb62d..52b06a22 100644 --- a/custom_components/alexa_media/translations/pt.json +++ b/custom_components/alexa_media/translations/pt.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Desativa o Amazon Kids (modo infantil) para um dispositivo Echo, removendo-o de qualquer perfil infantil.", + "fields": { + "entity_id": { + "description": "Dispositivo Echo para desativar o Amazon Kids em", + "name": "Selecione o media player:" + } + }, + "name": "Desativar Amazon Kids" + }, + "amazon_kids_enable": { + "description": "Ativa o Amazon Kids (modo infantil) em um dispositivo Echo, atribuindo-o a um perfil infantil.", + "fields": { + "child": { + "description": "Perfil da criança a ser atribuído (primeiro nome ou directedId)", + "name": "Criança" + }, + "entity_id": { + "description": "Dispositivo Echo para ativar o Amazon Kids", + "name": "Selecione o media player:" + } + }, + "name": "Ative o Amazon Kids" + }, "enable_network_discovery": { "description": "Reativa a descoberta de rede da Alexa para que o próximo ciclo de pesquisa redescubra os dispositivos Alexa das contas selecionadas.", "fields": { diff --git a/custom_components/alexa_media/translations/ru.json b/custom_components/alexa_media/translations/ru.json index 8c5f5554..2ae91c15 100644 --- a/custom_components/alexa_media/translations/ru.json +++ b/custom_components/alexa_media/translations/ru.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Отключает детский режим Amazon Kids для Echo, удаляя его из любого детского профиля.", + "fields": { + "entity_id": { + "description": "Устройство Cho для отключения Amazon Kids", + "name": "Выберите медиа плеер:" + } + }, + "name": "Отключить Amazon Kids" + }, + "amazon_kids_enable": { + "description": "Включает детский режим Amazon Kids для устройства Echo, назначая его детскому профилю.", + "fields": { + "child": { + "description": "Профиль ребенка для присвоения (имя или directedId)", + "name": "Ребенок" + }, + "entity_id": { + "description": "Устройство Echo для включения Amazon Kids", + "name": "Выберите медиа плеер:" + } + }, + "name": "Включить Amazon Kids" + }, "enable_network_discovery": { "description": "Повторно включает обнаружение сети Alexa, чтобы в следующем цикле опроса были повторно обнаружены устройства Alexa для выбранных учетных записей.", "fields": { diff --git a/custom_components/alexa_media/translations/sv.json b/custom_components/alexa_media/translations/sv.json index 970da804..3a1819fb 100644 --- a/custom_components/alexa_media/translations/sv.json +++ b/custom_components/alexa_media/translations/sv.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Turns off Amazon Kids (child mode) for an Echo by unassigning it from any child profile.", + "fields": { + "entity_id": { + "description": "Echo device to disable Amazon Kids on", + "name": "Select media player:" + } + }, + "name": "Disable Amazon Kids" + }, + "amazon_kids_enable": { + "description": "Turns on Amazon Kids (child mode) for an Echo by assigning it to a child profile.", + "fields": { + "child": { + "description": "Child profile to assign (first name or directedId)", + "name": "Child" + }, + "entity_id": { + "description": "Echo device to enable Amazon Kids on", + "name": "Select media player:" + } + }, + "name": "Enable Amazon Kids" + }, "enable_network_discovery": { "description": "Re-enables Alexa network discovery so the next polling cycle will rediscover Alexa devices for the selected accounts.", "fields": { diff --git a/custom_components/alexa_media/translations/zh-Hans.json b/custom_components/alexa_media/translations/zh-Hans.json index ecd2f2df..aba12686 100644 --- a/custom_components/alexa_media/translations/zh-Hans.json +++ b/custom_components/alexa_media/translations/zh-Hans.json @@ -130,6 +130,30 @@ } }, "services": { + "amazon_kids_disable": { + "description": "Turns off Amazon Kids (child mode) for an Echo by unassigning it from any child profile.", + "fields": { + "entity_id": { + "description": "Echo device to disable Amazon Kids on", + "name": "Select media player:" + } + }, + "name": "Disable Amazon Kids" + }, + "amazon_kids_enable": { + "description": "Turns on Amazon Kids (child mode) for an Echo by assigning it to a child profile.", + "fields": { + "child": { + "description": "Child profile to assign (first name or directedId)", + "name": "Child" + }, + "entity_id": { + "description": "Echo device to enable Amazon Kids on", + "name": "Select media player:" + } + }, + "name": "Enable Amazon Kids" + }, "enable_network_discovery": { "description": "重新启用 Alexa 网络发现功能,以便在下一个轮询周期中重新发现所选帐户的 Alexa 设备。", "fields": { diff --git a/zigbee2mqtt/state.json b/zigbee2mqtt/state.json index 5a86897b..804528a5 100644 --- a/zigbee2mqtt/state.json +++ b/zigbee2mqtt/state.json @@ -4,7 +4,7 @@ "state": "ON", "led_brightness": 100, "countdown_to_turn_off": 0, - "voltage": 118.9, + "voltage": 119.4, "countdown_to_turn_on": 0, "ac_frequency": 60, "power_factor": 0.35, @@ -30,7 +30,7 @@ "power": 2, "current": 0.09, "energy": 41.39, - "power_factor": 0.18, + "power_factor": 0.17, "update": { "state": "idle", "installed_version": 268513381, @@ -48,7 +48,7 @@ "voltage": 118.5, "countdown_to_turn_on": 0, "energy": 81.47, - "power_factor": 0.89, + "power_factor": 0.2, "ac_frequency": 60, "update": { "state": "idle", @@ -58,8 +58,8 @@ "latest_release_notes": null }, "linkquality": 80, - "power": 83.9, - "current": 0.78, + "power": 2.4, + "current": 0.12, "power_on_behavior": "on" }, "0xb40e060fffe031e3": { @@ -74,13 +74,13 @@ "led_brightness": 100, "countdown_to_turn_off": 0, "countdown_to_turn_on": 0, - "voltage": 117.8, + "voltage": 118.3, "state": "ON", "ac_frequency": 60, "energy": 165.71, "power": 0.9, "current": 0.88, - "power_factor": 0.66, + "power_factor": 0.34, "update": { "state": "idle", "installed_version": 268513381, @@ -96,12 +96,12 @@ "countdown_to_turn_off": 0, "countdown_to_turn_on": 0, "voltage": 119, - "energy": 81.55, + "energy": 81.56, "state": "ON", - "power": 59.3, - "current": 0.6, + "power": 55, + "current": 0.58, "ac_frequency": 60, - "power_factor": 0.85, + "power_factor": 0.83, "update": { "state": "idle", "installed_version": 268513381, @@ -136,13 +136,13 @@ "0xffffb40e0608864e": { "led_brightness": 100, "countdown_to_turn_off": 0, - "voltage": 119.3, + "voltage": 119.8, "energy": 24.54, "countdown_to_turn_on": 0, "state": "ON", "current": 0.02, "ac_frequency": 60, - "power": 0.4, + "power": 0.3, "power_factor": 0.14, "update": { "state": "idle",