Rename Amazon Devices to Alexa Devices (#146362)

Co-authored-by: Simone Chemelli <simone.chemelli@gmail.com>
Co-authored-by: Joostlek <joostlek@outlook.com>
pull/145650/head
tronikos 2025-06-11 09:35:26 -07:00 committed by Franck Nijhof
parent af72d1854f
commit 82de2ed8e1
No known key found for this signature in database
GPG Key ID: AB33ADACE7101952
35 changed files with 67 additions and 67 deletions

View File

@ -65,8 +65,8 @@ homeassistant.components.aladdin_connect.*
homeassistant.components.alarm_control_panel.*
homeassistant.components.alert.*
homeassistant.components.alexa.*
homeassistant.components.alexa_devices.*
homeassistant.components.alpha_vantage.*
homeassistant.components.amazon_devices.*
homeassistant.components.amazon_polly.*
homeassistant.components.amberelectric.*
homeassistant.components.ambient_network.*

4
CODEOWNERS generated
View File

@ -89,8 +89,8 @@ build.json @home-assistant/supervisor
/tests/components/alert/ @home-assistant/core @frenck
/homeassistant/components/alexa/ @home-assistant/cloud @ochlocracy @jbouwh
/tests/components/alexa/ @home-assistant/cloud @ochlocracy @jbouwh
/homeassistant/components/amazon_devices/ @chemelli74
/tests/components/amazon_devices/ @chemelli74
/homeassistant/components/alexa_devices/ @chemelli74
/tests/components/alexa_devices/ @chemelli74
/homeassistant/components/amazon_polly/ @jschlyter
/homeassistant/components/amberelectric/ @madpilot
/tests/components/amberelectric/ @madpilot

View File

@ -3,7 +3,7 @@
"name": "Amazon",
"integrations": [
"alexa",
"amazon_devices",
"alexa_devices",
"amazon_polly",
"aws",
"aws_s3",

View File

@ -1,4 +1,4 @@
"""Amazon Devices integration."""
"""Alexa Devices integration."""
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
@ -13,7 +13,7 @@ PLATFORMS = [
async def async_setup_entry(hass: HomeAssistant, entry: AmazonConfigEntry) -> bool:
"""Set up Amazon Devices platform."""
"""Set up Alexa Devices platform."""
coordinator = AmazonDevicesCoordinator(hass, entry)

View File

@ -26,7 +26,7 @@ PARALLEL_UPDATES = 0
@dataclass(frozen=True, kw_only=True)
class AmazonBinarySensorEntityDescription(BinarySensorEntityDescription):
"""Amazon Devices binary sensor entity description."""
"""Alexa Devices binary sensor entity description."""
is_on_fn: Callable[[AmazonDevice], bool]
@ -52,7 +52,7 @@ async def async_setup_entry(
entry: AmazonConfigEntry,
async_add_entities: AddConfigEntryEntitiesCallback,
) -> None:
"""Set up Amazon Devices binary sensors based on a config entry."""
"""Set up Alexa Devices binary sensors based on a config entry."""
coordinator = entry.runtime_data

View File

@ -1,4 +1,4 @@
"""Config flow for Amazon Devices integration."""
"""Config flow for Alexa Devices integration."""
from __future__ import annotations
@ -17,7 +17,7 @@ from .const import CONF_LOGIN_DATA, DOMAIN
class AmazonDevicesConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Amazon Devices."""
"""Handle a config flow for Alexa Devices."""
async def async_step_user(
self, user_input: dict[str, Any] | None = None

View File

@ -1,8 +1,8 @@
"""Amazon Devices constants."""
"""Alexa Devices constants."""
import logging
_LOGGER = logging.getLogger(__package__)
DOMAIN = "amazon_devices"
DOMAIN = "alexa_devices"
CONF_LOGIN_DATA = "login_data"

View File

@ -1,4 +1,4 @@
"""Support for Amazon Devices."""
"""Support for Alexa Devices."""
from datetime import timedelta
@ -23,7 +23,7 @@ type AmazonConfigEntry = ConfigEntry[AmazonDevicesCoordinator]
class AmazonDevicesCoordinator(DataUpdateCoordinator[dict[str, AmazonDevice]]):
"""Base coordinator for Amazon Devices."""
"""Base coordinator for Alexa Devices."""
config_entry: AmazonConfigEntry

View File

@ -1,4 +1,4 @@
"""Diagnostics support for Amazon Devices integration."""
"""Diagnostics support for Alexa Devices integration."""
from __future__ import annotations

View File

@ -1,4 +1,4 @@
"""Defines a base Amazon Devices entity."""
"""Defines a base Alexa Devices entity."""
from aioamazondevices.api import AmazonDevice
from aioamazondevices.const import SPEAKER_GROUP_MODEL
@ -12,7 +12,7 @@ from .coordinator import AmazonDevicesCoordinator
class AmazonEntity(CoordinatorEntity[AmazonDevicesCoordinator]):
"""Defines a base Amazon Devices entity."""
"""Defines a base Alexa Devices entity."""
_attr_has_entity_name = True

View File

@ -1,9 +1,9 @@
{
"domain": "amazon_devices",
"name": "Amazon Devices",
"domain": "alexa_devices",
"name": "Alexa Devices",
"codeowners": ["@chemelli74"],
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/amazon_devices",
"documentation": "https://www.home-assistant.io/integrations/alexa_devices",
"integration_type": "hub",
"iot_class": "cloud_polling",
"loggers": ["aioamazondevices"],

View File

@ -20,7 +20,7 @@ PARALLEL_UPDATES = 1
@dataclass(frozen=True, kw_only=True)
class AmazonNotifyEntityDescription(NotifyEntityDescription):
"""Amazon Devices notify entity description."""
"""Alexa Devices notify entity description."""
method: Callable[[AmazonEchoApi, AmazonDevice, str], Awaitable[None]]
subkey: str
@ -49,7 +49,7 @@ async def async_setup_entry(
entry: AmazonConfigEntry,
async_add_entities: AddConfigEntryEntitiesCallback,
) -> None:
"""Set up Amazon Devices notification entity based on a config entry."""
"""Set up Alexa Devices notification entity based on a config entry."""
coordinator = entry.runtime_data

View File

@ -12,16 +12,16 @@
"step": {
"user": {
"data": {
"country": "[%key:component::amazon_devices::common::data_country%]",
"country": "[%key:component::alexa_devices::common::data_country%]",
"username": "[%key:common::config_flow::data::username%]",
"password": "[%key:common::config_flow::data::password%]",
"code": "[%key:component::amazon_devices::common::data_description_code%]"
"code": "[%key:component::alexa_devices::common::data_description_code%]"
},
"data_description": {
"country": "[%key:component::amazon_devices::common::data_description_country%]",
"username": "[%key:component::amazon_devices::common::data_description_username%]",
"password": "[%key:component::amazon_devices::common::data_description_password%]",
"code": "[%key:component::amazon_devices::common::data_description_code%]"
"country": "[%key:component::alexa_devices::common::data_description_country%]",
"username": "[%key:component::alexa_devices::common::data_description_username%]",
"password": "[%key:component::alexa_devices::common::data_description_password%]",
"code": "[%key:component::alexa_devices::common::data_description_code%]"
}
}
},

View File

@ -20,7 +20,7 @@ PARALLEL_UPDATES = 1
@dataclass(frozen=True, kw_only=True)
class AmazonSwitchEntityDescription(SwitchEntityDescription):
"""Amazon Devices switch entity description."""
"""Alexa Devices switch entity description."""
is_on_fn: Callable[[AmazonDevice], bool]
subkey: str
@ -43,7 +43,7 @@ async def async_setup_entry(
entry: AmazonConfigEntry,
async_add_entities: AddConfigEntryEntitiesCallback,
) -> None:
"""Set up Amazon Devices switches based on a config entry."""
"""Set up Alexa Devices switches based on a config entry."""
coordinator = entry.runtime_data

View File

@ -47,7 +47,7 @@ FLOWS = {
"airzone",
"airzone_cloud",
"alarmdecoder",
"amazon_devices",
"alexa_devices",
"amberelectric",
"ambient_network",
"ambient_station",

View File

@ -207,11 +207,11 @@
"amazon": {
"name": "Amazon",
"integrations": {
"amazon_devices": {
"alexa_devices": {
"integration_type": "hub",
"config_flow": true,
"iot_class": "cloud_polling",
"name": "Amazon Devices"
"name": "Alexa Devices"
},
"amazon_polly": {
"integration_type": "hub",

4
mypy.ini generated
View File

@ -405,7 +405,7 @@ disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.alpha_vantage.*]
[mypy-homeassistant.components.alexa_devices.*]
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
@ -415,7 +415,7 @@ disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.amazon_devices.*]
[mypy-homeassistant.components.alpha_vantage.*]
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_subclassing_any = true

2
requirements_all.txt generated
View File

@ -181,7 +181,7 @@ aioairzone-cloud==0.6.12
# homeassistant.components.airzone
aioairzone==1.0.0
# homeassistant.components.amazon_devices
# homeassistant.components.alexa_devices
aioamazondevices==3.0.6
# homeassistant.components.ambient_network

View File

@ -169,7 +169,7 @@ aioairzone-cloud==0.6.12
# homeassistant.components.airzone
aioairzone==1.0.0
# homeassistant.components.amazon_devices
# homeassistant.components.alexa_devices
aioamazondevices==3.0.6
# homeassistant.components.ambient_network

View File

@ -1,4 +1,4 @@
"""Tests for the Amazon Devices integration."""
"""Tests for the Alexa Devices integration."""
from homeassistant.core import HomeAssistant

View File

@ -1,4 +1,4 @@
"""Amazon Devices tests configuration."""
"""Alexa Devices tests configuration."""
from collections.abc import Generator
from unittest.mock import AsyncMock, patch
@ -7,7 +7,7 @@ from aioamazondevices.api import AmazonDevice
from aioamazondevices.const import DEVICE_TYPE_TO_MODEL
import pytest
from homeassistant.components.amazon_devices.const import CONF_LOGIN_DATA, DOMAIN
from homeassistant.components.alexa_devices.const import CONF_LOGIN_DATA, DOMAIN
from homeassistant.const import CONF_COUNTRY, CONF_PASSWORD, CONF_USERNAME
from .const import TEST_COUNTRY, TEST_PASSWORD, TEST_SERIAL_NUMBER, TEST_USERNAME
@ -19,7 +19,7 @@ from tests.common import MockConfigEntry
def mock_setup_entry() -> Generator[AsyncMock]:
"""Override async_setup_entry."""
with patch(
"homeassistant.components.amazon_devices.async_setup_entry",
"homeassistant.components.alexa_devices.async_setup_entry",
return_value=True,
) as mock_setup_entry:
yield mock_setup_entry
@ -27,14 +27,14 @@ def mock_setup_entry() -> Generator[AsyncMock]:
@pytest.fixture
def mock_amazon_devices_client() -> Generator[AsyncMock]:
"""Mock an Amazon Devices client."""
"""Mock an Alexa Devices client."""
with (
patch(
"homeassistant.components.amazon_devices.coordinator.AmazonEchoApi",
"homeassistant.components.alexa_devices.coordinator.AmazonEchoApi",
autospec=True,
) as mock_client,
patch(
"homeassistant.components.amazon_devices.config_flow.AmazonEchoApi",
"homeassistant.components.alexa_devices.config_flow.AmazonEchoApi",
new=mock_client,
),
):

View File

@ -1,4 +1,4 @@
"""Amazon Devices tests const."""
"""Alexa Devices tests const."""
TEST_CODE = "023123"
TEST_COUNTRY = "IT"

View File

@ -25,7 +25,7 @@
'original_device_class': None,
'original_icon': None,
'original_name': 'Bluetooth',
'platform': 'amazon_devices',
'platform': 'alexa_devices',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
@ -73,7 +73,7 @@
'original_device_class': <BinarySensorDeviceClass.CONNECTIVITY: 'connectivity'>,
'original_icon': None,
'original_name': 'Connectivity',
'platform': 'amazon_devices',
'platform': 'alexa_devices',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,

View File

@ -57,7 +57,7 @@
'disabled_by': None,
'discovery_keys': dict({
}),
'domain': 'amazon_devices',
'domain': 'alexa_devices',
'minor_version': 1,
'options': dict({
}),

View File

@ -13,7 +13,7 @@
'id': <ANY>,
'identifiers': set({
tuple(
'amazon_devices',
'alexa_devices',
'echo_test_serial_number',
),
}),

View File

@ -25,7 +25,7 @@
'original_device_class': None,
'original_icon': None,
'original_name': 'Announce',
'platform': 'amazon_devices',
'platform': 'alexa_devices',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
@ -74,7 +74,7 @@
'original_device_class': None,
'original_icon': None,
'original_name': 'Speak',
'platform': 'amazon_devices',
'platform': 'alexa_devices',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,

View File

@ -25,7 +25,7 @@
'original_device_class': None,
'original_icon': None,
'original_name': 'Do not disturb',
'platform': 'amazon_devices',
'platform': 'alexa_devices',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,

View File

@ -1,4 +1,4 @@
"""Tests for the Amazon Devices binary sensor platform."""
"""Tests for the Alexa Devices binary sensor platform."""
from unittest.mock import AsyncMock, patch
@ -11,7 +11,7 @@ from freezegun.api import FrozenDateTimeFactory
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.amazon_devices.coordinator import SCAN_INTERVAL
from homeassistant.components.alexa_devices.coordinator import SCAN_INTERVAL
from homeassistant.const import STATE_ON, STATE_UNAVAILABLE, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
@ -31,7 +31,7 @@ async def test_all_entities(
) -> None:
"""Test all entities."""
with patch(
"homeassistant.components.amazon_devices.PLATFORMS", [Platform.BINARY_SENSOR]
"homeassistant.components.alexa_devices.PLATFORMS", [Platform.BINARY_SENSOR]
):
await setup_integration(hass, mock_config_entry)

View File

@ -1,11 +1,11 @@
"""Tests for the Amazon Devices config flow."""
"""Tests for the Alexa Devices config flow."""
from unittest.mock import AsyncMock
from aioamazondevices.exceptions import CannotAuthenticate, CannotConnect
import pytest
from homeassistant.components.amazon_devices.const import CONF_LOGIN_DATA, DOMAIN
from homeassistant.components.alexa_devices.const import CONF_LOGIN_DATA, DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.const import CONF_CODE, CONF_COUNTRY, CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant

View File

@ -1,4 +1,4 @@
"""Tests for Amazon Devices diagnostics platform."""
"""Tests for Alexa Devices diagnostics platform."""
from __future__ import annotations
@ -7,7 +7,7 @@ from unittest.mock import AsyncMock
from syrupy.assertion import SnapshotAssertion
from syrupy.filters import props
from homeassistant.components.amazon_devices.const import DOMAIN
from homeassistant.components.alexa_devices.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr

View File

@ -1,10 +1,10 @@
"""Tests for the Amazon Devices integration."""
"""Tests for the Alexa Devices integration."""
from unittest.mock import AsyncMock
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.amazon_devices.const import DOMAIN
from homeassistant.components.alexa_devices.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr

View File

@ -1,4 +1,4 @@
"""Tests for the Amazon Devices notify platform."""
"""Tests for the Alexa Devices notify platform."""
from unittest.mock import AsyncMock, patch
@ -6,7 +6,7 @@ from freezegun.api import FrozenDateTimeFactory
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.amazon_devices.coordinator import SCAN_INTERVAL
from homeassistant.components.alexa_devices.coordinator import SCAN_INTERVAL
from homeassistant.components.notify import (
ATTR_MESSAGE,
DOMAIN as NOTIFY_DOMAIN,
@ -32,7 +32,7 @@ async def test_all_entities(
entity_registry: er.EntityRegistry,
) -> None:
"""Test all entities."""
with patch("homeassistant.components.amazon_devices.PLATFORMS", [Platform.NOTIFY]):
with patch("homeassistant.components.alexa_devices.PLATFORMS", [Platform.NOTIFY]):
await setup_integration(hass, mock_config_entry)
await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id)

View File

@ -1,4 +1,4 @@
"""Tests for the Amazon Devices switch platform."""
"""Tests for the Alexa Devices switch platform."""
from unittest.mock import AsyncMock, patch
@ -6,7 +6,7 @@ from freezegun.api import FrozenDateTimeFactory
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.amazon_devices.coordinator import SCAN_INTERVAL
from homeassistant.components.alexa_devices.coordinator import SCAN_INTERVAL
from homeassistant.components.switch import (
DOMAIN as SWITCH_DOMAIN,
SERVICE_TURN_OFF,
@ -37,7 +37,7 @@ async def test_all_entities(
entity_registry: er.EntityRegistry,
) -> None:
"""Test all entities."""
with patch("homeassistant.components.amazon_devices.PLATFORMS", [Platform.SWITCH]):
with patch("homeassistant.components.alexa_devices.PLATFORMS", [Platform.SWITCH]):
await setup_integration(hass, mock_config_entry)
await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id)