diff --git a/.strict-typing b/.strict-typing index 91aa90df0280d..14f1540c53370 100644 --- a/.strict-typing +++ b/.strict-typing @@ -477,6 +477,7 @@ homeassistant.components.skybell.* homeassistant.components.slack.* homeassistant.components.sleep_as_android.* homeassistant.components.sleepiq.* +homeassistant.components.sma.* homeassistant.components.smhi.* homeassistant.components.smlight.* homeassistant.components.smtp.* diff --git a/Dockerfile b/Dockerfile index 4a004c046e350..5693406e5ae3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,7 @@ RUN \ && go2rtc --version # Install uv -RUN pip3 install uv==0.8.9 +RUN pip3 install uv==0.9.5 WORKDIR /usr/src diff --git a/homeassistant/components/google_generative_ai_conversation/tts.py b/homeassistant/components/google_generative_ai_conversation/tts.py index ed956bdb13c3e..22b4e2937cf03 100644 --- a/homeassistant/components/google_generative_ai_conversation/tts.py +++ b/homeassistant/components/google_generative_ai_conversation/tts.py @@ -59,6 +59,7 @@ class GoogleGenerativeAITextToSpeechEntity( "en-US", "es-US", "fr-FR", + "he-IL", "hi-IN", "id-ID", "it-IT", diff --git a/homeassistant/components/huawei_lte/quality_scale.yaml b/homeassistant/components/huawei_lte/quality_scale.yaml index 05cfb812da126..871329e7401b9 100644 --- a/homeassistant/components/huawei_lte/quality_scale.yaml +++ b/homeassistant/components/huawei_lte/quality_scale.yaml @@ -41,7 +41,7 @@ rules: reauthentication-flow: done test-coverage: status: todo - comment: Get percentage up there, add missing actual action press invocations in button tests' suspended state tests, rename test_switch.py to test_switch.py + make its functions receive hass as first parameter where applicable. + comment: Get percentage up there, add missing actual action press invocations in button tests' suspended state tests. # Gold devices: done diff --git a/homeassistant/components/litterrobot/manifest.json b/homeassistant/components/litterrobot/manifest.json index d0000ef275137..90af3237e4d08 100644 --- a/homeassistant/components/litterrobot/manifest.json +++ b/homeassistant/components/litterrobot/manifest.json @@ -13,5 +13,5 @@ "iot_class": "cloud_push", "loggers": ["pylitterbot"], "quality_scale": "bronze", - "requirements": ["pylitterbot==2024.2.6"] + "requirements": ["pylitterbot==2024.2.7"] } diff --git a/homeassistant/components/matter/entity.py b/homeassistant/components/matter/entity.py index c349a6b1fda72..f0718dead2153 100644 --- a/homeassistant/components/matter/entity.py +++ b/homeassistant/components/matter/entity.py @@ -36,6 +36,21 @@ LOGGER = logging.getLogger(__name__) +# Due to variances in labeling implementations, labels are vendor and product specific. +# This dictionary defines which labels to use for specific vendor/product combinations. +# The keys are vendor IDs, the values are dictionaries with product IDs as keys +# and lists of label names to use as values. If the value is None, no labels are used +VENDOR_LABELING_LIST: dict[int, dict[int, list[str] | None]] = { + 4488: {259: ["position"]}, # TP-Link Dual Outdoor Plug US + 4874: {105: ["orientation"]}, # Eve Energy dual Outlet US + 4961: { + 1: ["inovelliname", "label", "name", "button"], # Inovelli VTM31 + 2: ["label", "devicetype", "button"], # Inovelli VTM35 + 4: None, # Inovelli VTM36 + 16: ["label", "name", "button"], # Inovelli VTM30 + }, +} + def catch_matter_error[_R, **P]( func: Callable[Concatenate[MatterEntity, P], Coroutine[Any, Any, _R]], @@ -112,30 +127,47 @@ def __init__( if self._platform_translation_key and not self.translation_key: self._attr_translation_key = self._platform_translation_key - # prefer the label attribute for the entity name - # Matter has a way for users and/or vendors to specify a name for an endpoint - # which is always preferred over a standard HA (generated) name - for attr in ( - clusters.FixedLabel.Attributes.LabelList, - clusters.UserLabel.Attributes.LabelList, - ): - if not (labels := self.get_matter_attribute_value(attr)): - continue - for label in labels: - if label.label not in ["Label", "Button"]: - continue - # fixed or user label found: use it - label_value: str = label.value - # in the case the label is only the label id, use it as postfix only - if label_value.isnumeric(): - self._name_postfix = label_value - else: - self._attr_name = label_value - break + # Matter labels can be used to modify the entity name + # by appending the text. + if name_modifier := self._get_name_modifier(): + self._name_postfix = name_modifier # make sure to update the attributes once self._update_from_device() + def _find_matching_labels(self) -> list[str]: + """Find all labels for a Matter entity.""" + + device_info = self._endpoint.device_info + labeling_list = VENDOR_LABELING_LIST.get(device_info.vendorID, {}).get( + device_info.productID + ) + + # get the labels from the UserLabel and FixedLabel clusters + user_label_list: list[clusters.UserLabel.Structs.LabelStruct] = ( + self.get_matter_attribute_value(clusters.UserLabel.Attributes.LabelList) + or [] + ) + fixed_label_list: list[clusters.FixedLabel.Structs.LabelStruct] = ( + self.get_matter_attribute_value(clusters.FixedLabel.Attributes.LabelList) + or [] + ) + + found_labels: list[str] = [ + lbl.value + for label in labeling_list or [] + for lbl in (*user_label_list, *fixed_label_list) + if lbl.label.lower() == label + ] + return found_labels + + def _get_name_modifier(self) -> str | None: + """Get the name modifier for the entity.""" + + if found_labels := self._find_matching_labels(): + return found_labels[0] + return None + async def async_added_to_hass(self) -> None: """Handle being added to Home Assistant.""" await super().async_added_to_hass() diff --git a/homeassistant/components/matter/update.py b/homeassistant/components/matter/update.py index e100bf444935b..26a8da72e550d 100644 --- a/homeassistant/components/matter/update.py +++ b/homeassistant/components/matter/update.py @@ -256,7 +256,8 @@ async def async_will_remove_from_hass(self) -> None: MatterDiscoverySchema( platform=Platform.UPDATE, entity_description=MatterUpdateEntityDescription( - key="MatterUpdate", device_class=UpdateDeviceClass.FIRMWARE + key="MatterUpdate", + device_class=UpdateDeviceClass.FIRMWARE, ), entity_class=MatterUpdate, required_attributes=( diff --git a/homeassistant/components/openrgb/manifest.json b/homeassistant/components/openrgb/manifest.json index e9e656d330d7e..bb2677285904c 100644 --- a/homeassistant/components/openrgb/manifest.json +++ b/homeassistant/components/openrgb/manifest.json @@ -7,5 +7,5 @@ "integration_type": "hub", "iot_class": "local_polling", "quality_scale": "silver", - "requirements": ["openrgb-python==0.3.5"] + "requirements": ["openrgb-python==0.3.6"] } diff --git a/homeassistant/components/ps4/config_flow.py b/homeassistant/components/ps4/config_flow.py index 4e3f8f08e3986..abb1f2ad38100 100644 --- a/homeassistant/components/ps4/config_flow.py +++ b/homeassistant/components/ps4/config_flow.py @@ -26,6 +26,7 @@ DEFAULT_ALIAS, DEFAULT_NAME, DOMAIN, + PS4_DOCS_URL, ) CONF_MODE = "Config Mode" @@ -66,7 +67,10 @@ async def async_step_user( failed = await self.hass.async_add_executor_job(self.helper.port_bind, ports) if failed in ports: reason = PORT_MSG[failed] - return self.async_abort(reason=reason) + return self.async_abort( + reason=reason, + description_placeholders={"ps4_docs_url": PS4_DOCS_URL}, + ) return await self.async_step_creds() async def async_step_creds( @@ -85,7 +89,11 @@ async def async_step_creds( except CredentialTimeout: errors["base"] = "credential_timeout" - return self.async_show_form(step_id="creds", errors=errors) + return self.async_show_form( + step_id="creds", + errors=errors, + description_placeholders={"ps4_docs_url": PS4_DOCS_URL}, + ) async def async_step_mode( self, user_input: dict[str, Any] | None = None diff --git a/homeassistant/components/ps4/const.py b/homeassistant/components/ps4/const.py index f552388fe1d87..e1d3a6a241b2d 100644 --- a/homeassistant/components/ps4/const.py +++ b/homeassistant/components/ps4/const.py @@ -9,6 +9,8 @@ if TYPE_CHECKING: from . import PS4Data +PS4_DOCS_URL = "https://www.home-assistant.io/components/ps4/" + ATTR_MEDIA_IMAGE_URL = "media_image_url" CONFIG_ENTRY_VERSION = 3 DEFAULT_NAME = "PlayStation 4" diff --git a/homeassistant/components/ps4/strings.json b/homeassistant/components/ps4/strings.json index 778fa0215fb4f..c2e5795ae8385 100644 --- a/homeassistant/components/ps4/strings.json +++ b/homeassistant/components/ps4/strings.json @@ -2,7 +2,13 @@ "config": { "step": { "creds": { - "description": "Credentials needed. Select **Submit** and then in the PS4 2nd Screen App, refresh devices and select the **Home-Assistant** device to continue." + "description": "Credentials needed. Select **Submit** and then in the PS4 2nd Screen App, refresh devices and select the **Home-Assistant** device to continue.", + "data": { + "token": "PSN Token" + }, + "data_description": { + "token": "To get your PSN token, please follow these [instructions]({ps4_docs_url})." + } }, "mode": { "data": { @@ -35,8 +41,8 @@ "credential_error": "Error fetching credentials.", "no_devices_found": "[%key:common::config_flow::abort::no_devices_found%]", "already_configured": "[%key:common::config_flow::abort::already_configured_device%]", - "port_987_bind_error": "Could not bind to port 987. Refer to the [documentation](https://www.home-assistant.io/components/ps4/) for additional info.", - "port_997_bind_error": "Could not bind to port 997. Refer to the [documentation](https://www.home-assistant.io/components/ps4/) for additional info." + "port_987_bind_error": "Could not bind to port 987. Refer to the [documentation]({ps4_docs_url}) for additional info.", + "port_997_bind_error": "Could not bind to port 997. Refer to the [documentation]({ps4_docs_url}) for additional info." } }, "services": { diff --git a/homeassistant/components/sma/__init__.py b/homeassistant/components/sma/__init__.py index 7097308ebf709..f97b2ee25b5b5 100644 --- a/homeassistant/components/sma/__init__.py +++ b/homeassistant/components/sma/__init__.py @@ -4,7 +4,7 @@ import logging -from pysma import SMA +from pysma import SMAWebConnect from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( @@ -35,7 +35,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: SMAConfigEntry) -> bool: protocol = "https" if entry.data[CONF_SSL] else "http" url = f"{protocol}://{entry.data[CONF_HOST]}" - sma = SMA( + sma = SMAWebConnect( session=async_get_clientsession( hass=hass, verify_ssl=entry.data[CONF_VERIFY_SSL] ), diff --git a/homeassistant/components/sma/config_flow.py b/homeassistant/components/sma/config_flow.py index 66dd9c9993d02..7d76fbe0ec988 100644 --- a/homeassistant/components/sma/config_flow.py +++ b/homeassistant/components/sma/config_flow.py @@ -6,7 +6,13 @@ import logging from typing import Any -import pysma +import attrs +from pysma import ( + SmaAuthenticationException, + SmaConnectionException, + SmaReadException, + SMAWebConnect, +) import voluptuous as vol from yarl import URL @@ -42,7 +48,7 @@ async def validate_input( host = data[CONF_HOST] if data is not None else user_input[CONF_HOST] url = URL.build(scheme=protocol, host=host) - sma = pysma.SMA( + sma = SMAWebConnect( session, str(url), user_input[CONF_PASSWORD], group=user_input[CONF_GROUP] ) @@ -51,7 +57,7 @@ async def validate_input( device_info = await sma.device_info() await sma.close_session() - return device_info + return attrs.asdict(device_info) class SmaConfigFlow(ConfigFlow, domain=DOMAIN): @@ -90,11 +96,11 @@ async def _handle_user_input( device_info = await validate_input( self.hass, user_input=user_input, data=self._data ) - except pysma.exceptions.SmaConnectionException: + except SmaConnectionException: errors["base"] = "cannot_connect" - except pysma.exceptions.SmaAuthenticationException: + except SmaAuthenticationException: errors["base"] = "invalid_auth" - except pysma.exceptions.SmaReadException: + except SmaReadException: errors["base"] = "cannot_retrieve_device_info" except Exception: _LOGGER.exception("Unexpected exception") diff --git a/homeassistant/components/sma/coordinator.py b/homeassistant/components/sma/coordinator.py index b4adc4eb9d6d3..5fd00ad9f5067 100644 --- a/homeassistant/components/sma/coordinator.py +++ b/homeassistant/components/sma/coordinator.py @@ -6,13 +6,14 @@ from datetime import timedelta import logging -from pysma import SMA -from pysma.exceptions import ( +from pysma import ( SmaAuthenticationException, SmaConnectionException, SmaReadException, + SMAWebConnect, ) -from pysma.sensor import Sensor +from pysma.helpers import DeviceInfo +from pysma.sensor import Sensors from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_SCAN_INTERVAL @@ -29,8 +30,8 @@ class SMACoordinatorData: """Data class for SMA sensors.""" - sma_device_info: dict[str, str] - sensors: list[Sensor] + sma_device_info: DeviceInfo + sensors: Sensors class SMADataUpdateCoordinator(DataUpdateCoordinator[SMACoordinatorData]): @@ -42,7 +43,7 @@ def __init__( self, hass: HomeAssistant, config_entry: ConfigEntry, - sma: SMA, + sma: SMAWebConnect, ) -> None: """Initialize the SMA Data Update Coordinator.""" super().__init__( @@ -57,8 +58,8 @@ def __init__( ), ) self.sma = sma - self._sma_device_info: dict[str, str] = {} - self._sensors: list[Sensor] = [] + self._sma_device_info = DeviceInfo() + self._sensors = Sensors() async def _async_setup(self) -> None: """Setup the SMA Data Update Coordinator.""" diff --git a/homeassistant/components/sma/manifest.json b/homeassistant/components/sma/manifest.json index bb3f53182802c..89b8fafc6ae57 100644 --- a/homeassistant/components/sma/manifest.json +++ b/homeassistant/components/sma/manifest.json @@ -13,5 +13,5 @@ "documentation": "https://www.home-assistant.io/integrations/sma", "iot_class": "local_polling", "loggers": ["pysma"], - "requirements": ["pysma==0.7.5"] + "requirements": ["pysma==1.0.2"] } diff --git a/homeassistant/components/sma/sensor.py b/homeassistant/components/sma/sensor.py index 1c103b53cc4d2..3f90014eb90a0 100644 --- a/homeassistant/components/sma/sensor.py +++ b/homeassistant/components/sma/sensor.py @@ -2,7 +2,7 @@ from __future__ import annotations -import pysma +from pysma.sensor import Sensor from homeassistant.components.sensor import ( SensorDeviceClass, @@ -859,7 +859,7 @@ def __init__( self, coordinator: SMADataUpdateCoordinator, description: SensorEntityDescription | None, - pysma_sensor: pysma.sensor.Sensor, + pysma_sensor: Sensor, entry: SMAConfigEntry, ) -> None: """Initialize the sensor.""" @@ -873,17 +873,17 @@ def __init__( url = f"{protocol}://{entry.data[CONF_HOST]}" self._sensor = pysma_sensor - self._serial = coordinator.data.sma_device_info["serial"] + self._serial = coordinator.data.sma_device_info.serial assert entry.unique_id self._attr_device_info = DeviceInfo( configuration_url=url, identifiers={(DOMAIN, entry.unique_id)}, - manufacturer=coordinator.data.sma_device_info["manufacturer"], - model=coordinator.data.sma_device_info["type"], - name=coordinator.data.sma_device_info["name"], - sw_version=coordinator.data.sma_device_info["sw_version"], - serial_number=coordinator.data.sma_device_info["serial"], + manufacturer=coordinator.data.sma_device_info.manufacturer, + model=coordinator.data.sma_device_info.type, + name=coordinator.data.sma_device_info.name, + sw_version=coordinator.data.sma_device_info.sw_version, + serial_number=coordinator.data.sma_device_info.serial, ) self._attr_unique_id = ( f"{entry.unique_id}-{pysma_sensor.key}_{pysma_sensor.key_idx}" @@ -908,7 +908,7 @@ def available(self) -> bool: """Return if the device is available.""" return ( super().available - and self._serial == self.coordinator.data.sma_device_info["serial"] + and self._serial == self.coordinator.data.sma_device_info.serial ) @property diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 2e1b268888898..e7b08f165b280 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -69,7 +69,7 @@ standard-telnetlib==3.13.0 typing-extensions>=4.15.0,<5.0 ulid-transform==1.5.2 urllib3>=2.0 -uv==0.8.9 +uv==0.9.5 voluptuous-openapi==0.1.0 voluptuous-serialize==2.7.0 voluptuous==0.15.2 diff --git a/mypy.ini b/mypy.ini index 3f987800262d0..4ef7b2a826fc2 100644 --- a/mypy.ini +++ b/mypy.ini @@ -4526,6 +4526,16 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.sma.*] +check_untyped_defs = true +disallow_incomplete_defs = true +disallow_subclassing_any = true +disallow_untyped_calls = true +disallow_untyped_decorators = true +disallow_untyped_defs = true +warn_return_any = true +warn_unreachable = true + [mypy-homeassistant.components.smhi.*] check_untyped_defs = true disallow_incomplete_defs = true diff --git a/pyproject.toml b/pyproject.toml index 38408172d1643..5be848614e571 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,7 +75,7 @@ dependencies = [ "typing-extensions>=4.15.0,<5.0", "ulid-transform==1.5.2", "urllib3>=2.0", - "uv==0.8.9", + "uv==0.9.5", "voluptuous==0.15.2", "voluptuous-serialize==2.7.0", "voluptuous-openapi==0.1.0", diff --git a/requirements.txt b/requirements.txt index d7e74b4edc1af..1f36766b5f215 100644 --- a/requirements.txt +++ b/requirements.txt @@ -46,7 +46,7 @@ standard-telnetlib==3.13.0 typing-extensions>=4.15.0,<5.0 ulid-transform==1.5.2 urllib3>=2.0 -uv==0.8.9 +uv==0.9.5 voluptuous==0.15.2 voluptuous-serialize==2.7.0 voluptuous-openapi==0.1.0 diff --git a/requirements_all.txt b/requirements_all.txt index e61c3f69c9563..d35a164b6fae1 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1646,7 +1646,7 @@ openevsewifi==1.1.2 openhomedevice==2.2.0 # homeassistant.components.openrgb -openrgb-python==0.3.5 +openrgb-python==0.3.6 # homeassistant.components.opensensemap opensensemap-api==0.2.0 @@ -2162,7 +2162,7 @@ pylibrespot-java==0.1.1 pylitejet==0.6.3 # homeassistant.components.litterrobot -pylitterbot==2024.2.6 +pylitterbot==2024.2.7 # homeassistant.components.lutron_caseta pylutron-caseta==0.25.0 @@ -2387,7 +2387,7 @@ pysignalclirestapi==0.3.24 pyskyqhub==0.1.4 # homeassistant.components.sma -pysma==0.7.5 +pysma==1.0.2 # homeassistant.components.smappee pysmappee==0.2.29 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 86951dfd82814..0f321b6f716d8 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1414,7 +1414,7 @@ openerz-api==0.3.0 openhomedevice==2.2.0 # homeassistant.components.openrgb -openrgb-python==0.3.5 +openrgb-python==0.3.6 # homeassistant.components.enigma2 openwebifpy==4.3.1 @@ -1810,7 +1810,7 @@ pylibrespot-java==0.1.1 pylitejet==0.6.3 # homeassistant.components.litterrobot -pylitterbot==2024.2.6 +pylitterbot==2024.2.7 # homeassistant.components.lutron_caseta pylutron-caseta==0.25.0 @@ -1993,7 +1993,7 @@ pysiaalarm==3.1.1 pysignalclirestapi==0.3.24 # homeassistant.components.sma -pysma==0.7.5 +pysma==1.0.2 # homeassistant.components.smappee pysmappee==0.2.29 diff --git a/script/hassfest/docker/Dockerfile b/script/hassfest/docker/Dockerfile index c127f5ae51ebb..c6a3951275e10 100644 --- a/script/hassfest/docker/Dockerfile +++ b/script/hassfest/docker/Dockerfile @@ -14,7 +14,7 @@ WORKDIR "/github/workspace" COPY . /usr/src/homeassistant # Uv is only needed during build -RUN --mount=from=ghcr.io/astral-sh/uv:0.8.9,source=/uv,target=/bin/uv \ +RUN --mount=from=ghcr.io/astral-sh/uv:0.9.5,source=/uv,target=/bin/uv \ # Uv creates a lock file in /tmp --mount=type=tmpfs,target=/tmp \ # Required for PyTurboJPEG diff --git a/tests/components/huawei_lte/__init__.py b/tests/components/huawei_lte/__init__.py index f9f16a2473c08..de93908c78ab0 100644 --- a/tests/components/huawei_lte/__init__.py +++ b/tests/components/huawei_lte/__init__.py @@ -5,26 +5,8 @@ from huawei_lte_api.enums.cradle import ConnectionStatusEnum -def magic_client(multi_basic_settings_value: dict) -> MagicMock: - """Mock huawei_lte.Client.""" - information = MagicMock(return_value={"SerialNumber": "test-serial-number"}) - check_notifications = MagicMock(return_value={"SmsStorageFull": 0}) - status = MagicMock( - return_value={"ConnectionStatus": ConnectionStatusEnum.CONNECTED.value} - ) - multi_basic_settings = MagicMock(return_value=multi_basic_settings_value) - wifi_feature_switch = MagicMock(return_value={"wifi24g_switch_enable": 1}) - device = MagicMock(information=information) - monitoring = MagicMock(check_notifications=check_notifications, status=status) - wlan = MagicMock( - multi_basic_settings=multi_basic_settings, - wifi_feature_switch=wifi_feature_switch, - ) - return MagicMock(device=device, monitoring=monitoring, wlan=wlan) - - -def magic_client_full() -> MagicMock: - """Extended mock for huawei_lte.Client with all API methods.""" +def magic_client() -> MagicMock: + """Mock huawei_lte.Client with all API methods.""" information = MagicMock( return_value={ "DeviceName": "Test Router", @@ -121,7 +103,7 @@ def magic_client_full() -> MagicMock: ) status = MagicMock( return_value={ - "ConnectionStatus": "901", + "ConnectionStatus": str(ConnectionStatusEnum.CONNECTED.value), "WifiConnectionStatus": None, "SignalStrength": None, "SignalIcon": "5", diff --git a/tests/components/huawei_lte/test_button.py b/tests/components/huawei_lte/test_button.py index c99c08c436c87..1bffdc8a411a6 100644 --- a/tests/components/huawei_lte/test_button.py +++ b/tests/components/huawei_lte/test_button.py @@ -22,23 +22,25 @@ @patch("homeassistant.components.huawei_lte.Connection", MagicMock()) -@patch("homeassistant.components.huawei_lte.Client", return_value=magic_client({})) -async def test_clear_traffic_statistics(client, hass: HomeAssistant) -> None: +async def test_clear_traffic_statistics(hass: HomeAssistant) -> None: """Test clear traffic statistics button.""" huawei_lte = MockConfigEntry(domain=DOMAIN, data={CONF_URL: MOCK_CONF_URL}) huawei_lte.add_to_hass(hass) - await hass.config_entries.async_setup(huawei_lte.entry_id) + client = magic_client() + with patch("homeassistant.components.huawei_lte.Client", return_value=client): + await hass.config_entries.async_setup(huawei_lte.entry_id) await hass.async_block_till_done() + await hass.services.async_call( BUTTON_DOMAIN, SERVICE_PRESS, - {ATTR_ENTITY_ID: f"button.lte_{BUTTON_KEY_CLEAR_TRAFFIC_STATISTICS}"}, + {ATTR_ENTITY_ID: f"button.test_router_{BUTTON_KEY_CLEAR_TRAFFIC_STATISTICS}"}, blocking=True, ) await hass.async_block_till_done() - client.return_value.monitoring.set_clear_traffic.assert_called_once() + client.monitoring.set_clear_traffic.assert_called_once() - client.return_value.monitoring.set_clear_traffic.reset_mock() + client.monitoring.set_clear_traffic.reset_mock() await hass.services.async_call( DOMAIN, SERVICE_SUSPEND_INTEGRATION, @@ -46,27 +48,31 @@ async def test_clear_traffic_statistics(client, hass: HomeAssistant) -> None: blocking=True, ) await hass.async_block_till_done() - client.return_value.monitoring.set_clear_traffic.assert_not_called() + client.monitoring.set_clear_traffic.assert_not_called() -@patch("homeassistant.components.huawei_lte.Connection", MagicMock()) -@patch("homeassistant.components.huawei_lte.Client", return_value=magic_client({})) -async def test_restart(client, hass: HomeAssistant) -> None: +async def test_restart(hass: HomeAssistant) -> None: """Test restart button.""" huawei_lte = MockConfigEntry(domain=DOMAIN, data={CONF_URL: MOCK_CONF_URL}) huawei_lte.add_to_hass(hass) - await hass.config_entries.async_setup(huawei_lte.entry_id) + client = magic_client() + with ( + patch("homeassistant.components.huawei_lte.Connection", MagicMock()), + patch("homeassistant.components.huawei_lte.Client", return_value=client), + ): + await hass.config_entries.async_setup(huawei_lte.entry_id) await hass.async_block_till_done() + await hass.services.async_call( BUTTON_DOMAIN, SERVICE_PRESS, - {ATTR_ENTITY_ID: f"button.lte_{BUTTON_KEY_RESTART}"}, + {ATTR_ENTITY_ID: f"button.test_router_{BUTTON_KEY_RESTART}"}, blocking=True, ) await hass.async_block_till_done() - client.return_value.device.set_control.assert_called_with(ControlModeEnum.REBOOT) + client.device.set_control.assert_called_with(ControlModeEnum.REBOOT) - client.return_value.device.set_control.reset_mock() + client.device.set_control.reset_mock() await hass.services.async_call( DOMAIN, SERVICE_SUSPEND_INTEGRATION, @@ -74,4 +80,4 @@ async def test_restart(client, hass: HomeAssistant) -> None: blocking=True, ) await hass.async_block_till_done() - client.return_value.device.set_control.assert_not_called() + client.device.set_control.assert_not_called() diff --git a/tests/components/huawei_lte/test_diagnostics.py b/tests/components/huawei_lte/test_diagnostics.py index e63ba94e9be7e..33b4899644339 100644 --- a/tests/components/huawei_lte/test_diagnostics.py +++ b/tests/components/huawei_lte/test_diagnostics.py @@ -9,30 +9,31 @@ from homeassistant.const import CONF_URL from homeassistant.core import HomeAssistant -from . import magic_client_full +from . import magic_client from tests.common import MockConfigEntry from tests.components.diagnostics import get_diagnostics_for_config_entry from tests.typing import ClientSessionGenerator -@patch("homeassistant.components.huawei_lte.Connection", MagicMock()) -@patch("homeassistant.components.huawei_lte.Client") async def test_entry_diagnostics( - client, hass: HomeAssistant, hass_client: ClientSessionGenerator, snapshot: SnapshotAssertion, ) -> None: """Test config entry diagnostics.""" - client.return_value = magic_client_full() huawei_lte = MockConfigEntry( domain=DOMAIN, data={CONF_URL: "http://huawei-lte.example.com"} ) huawei_lte.add_to_hass(hass) - await hass.config_entries.async_setup(huawei_lte.entry_id) + with ( + patch("homeassistant.components.huawei_lte.Connection", MagicMock()), + patch( + "homeassistant.components.huawei_lte.Client", return_value=magic_client() + ), + ): + await hass.config_entries.async_setup(huawei_lte.entry_id) await hass.async_block_till_done() result = await get_diagnostics_for_config_entry(hass, hass_client, huawei_lte) - assert result == snapshot(exclude=props("entry_id", "created_at", "modified_at")) diff --git a/tests/components/huawei_lte/test_select.py b/tests/components/huawei_lte/test_select.py index 85a0fcfdf0c70..71a87e486ea6f 100644 --- a/tests/components/huawei_lte/test_select.py +++ b/tests/components/huawei_lte/test_select.py @@ -16,20 +16,23 @@ from tests.common import MockConfigEntry -SELECT_NETWORK_MODE = "select.lte_preferred_network_mode" +SELECT_NETWORK_MODE = "select.test_router_preferred_network_mode" -@patch("homeassistant.components.huawei_lte.Connection", MagicMock()) -@patch("homeassistant.components.huawei_lte.Client") -async def test_set_net_mode(client, hass: HomeAssistant) -> None: +async def test_set_net_mode(hass: HomeAssistant) -> None: """Test setting network mode.""" - client.return_value = magic_client({}) huawei_lte = MockConfigEntry( domain=DOMAIN, data={CONF_URL: "http://huawei-lte.example.com"} ) huawei_lte.add_to_hass(hass) - await hass.config_entries.async_setup(huawei_lte.entry_id) + client = magic_client() + with ( + patch("homeassistant.components.huawei_lte.Connection", MagicMock()), + patch("homeassistant.components.huawei_lte.Client", return_value=client), + ): + await hass.config_entries.async_setup(huawei_lte.entry_id) await hass.async_block_till_done() + await hass.services.async_call( SELECT_DOMAIN, SERVICE_SELECT_OPTION, @@ -40,7 +43,7 @@ async def test_set_net_mode(client, hass: HomeAssistant) -> None: blocking=True, ) await hass.async_block_till_done() - client.return_value.net.set_net_mode.assert_called_once() - client.return_value.net.set_net_mode.assert_called_with( + client.net.set_net_mode.assert_called_once() + client.net.set_net_mode.assert_called_with( LTEBandEnum.ALL, NetworkBandEnum.ALL, NetworkModeEnum.MODE_4G_3G_AUTO.value ) diff --git a/tests/components/huawei_lte/test_switches.py b/tests/components/huawei_lte/test_switch.py similarity index 53% rename from tests/components/huawei_lte/test_switches.py rename to tests/components/huawei_lte/test_switch.py index 288416c8c9948..8e595d1dab66f 100644 --- a/tests/components/huawei_lte/test_switches.py +++ b/tests/components/huawei_lte/test_switch.py @@ -16,55 +16,62 @@ from tests.common import MockConfigEntry -SWITCH_WIFI_GUEST_NETWORK = "switch.lte_wi_fi_guest_network" +SWITCH_WIFI_GUEST_NETWORK = "switch.test_router_wi_fi_guest_network" -@patch("homeassistant.components.huawei_lte.Connection", MagicMock()) -@patch("homeassistant.components.huawei_lte.Client", return_value=magic_client({})) async def test_huawei_lte_wifi_guest_network_config_entry_when_network_is_not_present( - client, - hass: HomeAssistant, - entity_registry: er.EntityRegistry, + hass: HomeAssistant, entity_registry: er.EntityRegistry ) -> None: """Test switch wifi guest network config entry when network is not present.""" huawei_lte = MockConfigEntry(domain=DOMAIN, data={CONF_URL: "http://huawei-lte"}) huawei_lte.add_to_hass(hass) - await hass.config_entries.async_setup(huawei_lte.entry_id) + with ( + patch("homeassistant.components.huawei_lte.Connection", MagicMock()), + patch( + "homeassistant.components.huawei_lte.Client", return_value=magic_client() + ), + ): + await hass.config_entries.async_setup(huawei_lte.entry_id) await hass.async_block_till_done() + assert not entity_registry.async_is_registered(SWITCH_WIFI_GUEST_NETWORK) -@patch("homeassistant.components.huawei_lte.Connection", MagicMock()) -@patch( - "homeassistant.components.huawei_lte.Client", - return_value=magic_client( - {"Ssids": {"Ssid": [{"wifiisguestnetwork": "1", "WifiEnable": "0"}]}} - ), -) async def test_huawei_lte_wifi_guest_network_config_entry_when_network_is_present( - client, - hass: HomeAssistant, - entity_registry: er.EntityRegistry, + hass: HomeAssistant, entity_registry: er.EntityRegistry ) -> None: """Test switch wifi guest network config entry when network is present.""" huawei_lte = MockConfigEntry(domain=DOMAIN, data={CONF_URL: "http://huawei-lte"}) huawei_lte.add_to_hass(hass) - await hass.config_entries.async_setup(huawei_lte.entry_id) + client = magic_client() + client.wlan.multi_basic_settings.return_value = { + "Ssids": {"Ssid": [{"wifiisguestnetwork": "1", "WifiEnable": "0"}]} + } + with ( + patch("homeassistant.components.huawei_lte.Connection", MagicMock()), + patch("homeassistant.components.huawei_lte.Client", return_value=client), + ): + await hass.config_entries.async_setup(huawei_lte.entry_id) await hass.async_block_till_done() + assert entity_registry.async_is_registered(SWITCH_WIFI_GUEST_NETWORK) -@patch("homeassistant.components.huawei_lte.Connection", MagicMock()) -@patch("homeassistant.components.huawei_lte.Client") -async def test_turn_on_switch_wifi_guest_network(client, hass: HomeAssistant) -> None: +async def test_turn_on_switch_wifi_guest_network(hass: HomeAssistant) -> None: """Test switch wifi guest network turn on method.""" - client.return_value = magic_client( - {"Ssids": {"Ssid": [{"wifiisguestnetwork": "1", "WifiEnable": "0"}]}} - ) huawei_lte = MockConfigEntry(domain=DOMAIN, data={CONF_URL: "http://huawei-lte"}) huawei_lte.add_to_hass(hass) - await hass.config_entries.async_setup(huawei_lte.entry_id) + client = magic_client() + client.wlan.multi_basic_settings.return_value = { + "Ssids": {"Ssid": [{"wifiisguestnetwork": "1", "WifiEnable": "0"}]} + } + with ( + patch("homeassistant.components.huawei_lte.Connection", MagicMock()), + patch("homeassistant.components.huawei_lte.Client", return_value=client), + ): + await hass.config_entries.async_setup(huawei_lte.entry_id) await hass.async_block_till_done() + await hass.services.async_call( SWITCH_DOMAIN, SERVICE_TURN_ON, @@ -73,20 +80,24 @@ async def test_turn_on_switch_wifi_guest_network(client, hass: HomeAssistant) -> ) await hass.async_block_till_done() assert hass.states.is_state(SWITCH_WIFI_GUEST_NETWORK, STATE_ON) - client.return_value.wlan.wifi_guest_network_switch.assert_called_once_with(True) + client.wlan.wifi_guest_network_switch.assert_called_once_with(True) -@patch("homeassistant.components.huawei_lte.Connection", MagicMock()) -@patch("homeassistant.components.huawei_lte.Client") -async def test_turn_off_switch_wifi_guest_network(client, hass: HomeAssistant) -> None: +async def test_turn_off_switch_wifi_guest_network(hass: HomeAssistant) -> None: """Test switch wifi guest network turn off method.""" - client.return_value = magic_client( - {"Ssids": {"Ssid": [{"wifiisguestnetwork": "1", "WifiEnable": "1"}]}} - ) huawei_lte = MockConfigEntry(domain=DOMAIN, data={CONF_URL: "http://huawei-lte"}) huawei_lte.add_to_hass(hass) - await hass.config_entries.async_setup(huawei_lte.entry_id) + client = magic_client() + client.wlan.multi_basic_settings.return_value = { + "Ssids": {"Ssid": [{"wifiisguestnetwork": "1", "WifiEnable": "1"}]} + } + with ( + patch("homeassistant.components.huawei_lte.Connection", MagicMock()), + patch("homeassistant.components.huawei_lte.Client", return_value=client), + ): + await hass.config_entries.async_setup(huawei_lte.entry_id) await hass.async_block_till_done() + await hass.services.async_call( SWITCH_DOMAIN, SERVICE_TURN_OFF, @@ -95,18 +106,11 @@ async def test_turn_off_switch_wifi_guest_network(client, hass: HomeAssistant) - ) await hass.async_block_till_done() assert hass.states.is_state(SWITCH_WIFI_GUEST_NETWORK, STATE_OFF) - client.return_value.wlan.wifi_guest_network_switch.assert_called_with(False) + client.wlan.wifi_guest_network_switch.assert_called_with(False) -@patch("homeassistant.components.huawei_lte.Connection", MagicMock()) -@patch( - "homeassistant.components.huawei_lte.Client", - return_value=magic_client({"Ssids": {"Ssid": "str"}}), -) async def test_huawei_lte_wifi_guest_network_config_entry_when_ssid_is_str( - client, - hass: HomeAssistant, - entity_registry: er.EntityRegistry, + hass: HomeAssistant, entity_registry: er.EntityRegistry ) -> None: """Test switch wifi guest network config entry when ssid is a str. @@ -114,20 +118,20 @@ async def test_huawei_lte_wifi_guest_network_config_entry_when_ssid_is_str( """ huawei_lte = MockConfigEntry(domain=DOMAIN, data={CONF_URL: "http://huawei-lte"}) huawei_lte.add_to_hass(hass) - await hass.config_entries.async_setup(huawei_lte.entry_id) + client = magic_client() + client.wlan.multi_basic_settings.return_value = {"Ssids": {"Ssid": "str"}} + with ( + patch("homeassistant.components.huawei_lte.Connection", MagicMock()), + patch("homeassistant.components.huawei_lte.Client", return_value=client), + ): + await hass.config_entries.async_setup(huawei_lte.entry_id) await hass.async_block_till_done() + assert not entity_registry.async_is_registered(SWITCH_WIFI_GUEST_NETWORK) -@patch("homeassistant.components.huawei_lte.Connection", MagicMock()) -@patch( - "homeassistant.components.huawei_lte.Client", - return_value=magic_client({"Ssids": {"Ssid": None}}), -) async def test_huawei_lte_wifi_guest_network_config_entry_when_ssid_is_none( - client, - hass: HomeAssistant, - entity_registry: er.EntityRegistry, + hass: HomeAssistant, entity_registry: er.EntityRegistry ) -> None: """Test switch wifi guest network config entry when ssid is a None. @@ -135,6 +139,13 @@ async def test_huawei_lte_wifi_guest_network_config_entry_when_ssid_is_none( """ huawei_lte = MockConfigEntry(domain=DOMAIN, data={CONF_URL: "http://huawei-lte"}) huawei_lte.add_to_hass(hass) - await hass.config_entries.async_setup(huawei_lte.entry_id) + client = magic_client() + client.wlan.multi_basic_settings.return_value = {"Ssids": {"Ssid": None}} + with ( + patch("homeassistant.components.huawei_lte.Connection", MagicMock()), + patch("homeassistant.components.huawei_lte.Client", return_value=client), + ): + await hass.config_entries.async_setup(huawei_lte.entry_id) await hass.async_block_till_done() + assert not entity_registry.async_is_registered(SWITCH_WIFI_GUEST_NETWORK) diff --git a/tests/components/iometer/test_init.py b/tests/components/iometer/test_init.py index 9d8eadc50792a..68f75384d4098 100644 --- a/tests/components/iometer/test_init.py +++ b/tests/components/iometer/test_init.py @@ -1,13 +1,17 @@ -"""Tests for the AirGradient integration.""" +"""Tests for the IOmeter integration.""" from datetime import timedelta from unittest.mock import AsyncMock from freezegun.api import FrozenDateTimeFactory +from iometer import IOmeterConnectionError +import pytest +from homeassistant.components.iometer import async_setup_entry from homeassistant.components.iometer.const import DOMAIN from homeassistant.const import Platform from homeassistant.core import HomeAssistant +from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers import device_registry as dr from . import setup_platform @@ -23,7 +27,8 @@ async def test_new_firmware_version( freezer: FrozenDateTimeFactory, ) -> None: """Test device registry integration.""" - # await setup_integration(hass, mock_config_entry) + assert mock_config_entry.unique_id is not None + await setup_platform(hass, mock_config_entry, [Platform.SENSOR]) device_entry = device_registry.async_get_device( identifiers={(DOMAIN, mock_config_entry.unique_id)} @@ -42,3 +47,21 @@ async def test_new_firmware_version( ) assert device_entry is not None assert device_entry.sw_version == "build-62/build-69" + + +async def test_async_setup_entry_connection_error( + hass: HomeAssistant, + mock_iometer_client: AsyncMock, + mock_config_entry: MockConfigEntry, +) -> None: + """Test async_setup_entry raises ConfigEntryNotReady on connection error.""" + + mock_config_entry.add_to_hass(hass) + mock_iometer_client.get_current_status.side_effect = IOmeterConnectionError( + "cannot connect" + ) + + with pytest.raises(ConfigEntryNotReady): + await async_setup_entry(hass, mock_config_entry) + + assert mock_iometer_client.get_current_status.await_count == 1 diff --git a/tests/components/matter/fixtures/nodes/device_diagnostics.json b/tests/components/matter/fixtures/nodes/device_diagnostics.json index 5600a7e801b20..408944ab24701 100644 --- a/tests/components/matter/fixtures/nodes/device_diagnostics.json +++ b/tests/components/matter/fixtures/nodes/device_diagnostics.json @@ -336,24 +336,6 @@ "0/63/65528": [2, 5], "0/63/65529": [0, 1, 3, 4], "0/63/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533], - "0/64/0": [ - { - "0": "room", - "1": "bedroom 2" - }, - { - "0": "orientation", - "1": "North" - }, - { - "0": "floor", - "1": "2" - }, - { - "0": "direction", - "1": "up" - } - ], "0/64/65532": 0, "0/64/65533": 1, "0/64/65528": [], diff --git a/tests/components/matter/fixtures/nodes/dimmable_light.json b/tests/components/matter/fixtures/nodes/dimmable_light.json index f8a3b28fb9e00..867e6963b9dcf 100644 --- a/tests/components/matter/fixtures/nodes/dimmable_light.json +++ b/tests/components/matter/fixtures/nodes/dimmable_light.json @@ -276,24 +276,6 @@ "0/63/65528": [2, 5], "0/63/65529": [0, 1, 3, 4], "0/63/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533], - "0/64/0": [ - { - "0": "room", - "1": "bedroom 2" - }, - { - "0": "orientation", - "1": "North" - }, - { - "0": "floor", - "1": "2" - }, - { - "0": "direction", - "1": "up" - } - ], "0/64/65532": 0, "0/64/65533": 1, "0/64/65528": [], diff --git a/tests/components/matter/fixtures/nodes/door_lock.json b/tests/components/matter/fixtures/nodes/door_lock.json index 27907479f0748..360435605ae2e 100644 --- a/tests/components/matter/fixtures/nodes/door_lock.json +++ b/tests/components/matter/fixtures/nodes/door_lock.json @@ -384,24 +384,6 @@ "0/63/65528": [2, 5], "0/63/65529": [0, 1, 3, 4], "0/63/65531": [0, 1, 2, 3, 65528, 65529, 65530, 65531, 65532, 65533], - "0/64/0": [ - { - "0": "room", - "1": "bedroom 2" - }, - { - "0": "orientation", - "1": "North" - }, - { - "0": "floor", - "1": "2" - }, - { - "0": "direction", - "1": "up" - } - ], "0/64/65532": 0, "0/64/65533": 1, "0/64/65528": [], diff --git a/tests/components/matter/fixtures/nodes/door_lock_with_unbolt.json b/tests/components/matter/fixtures/nodes/door_lock_with_unbolt.json index fd26d5d1df3fe..1c35d855db50f 100644 --- a/tests/components/matter/fixtures/nodes/door_lock_with_unbolt.json +++ b/tests/components/matter/fixtures/nodes/door_lock_with_unbolt.json @@ -384,24 +384,6 @@ "0/63/65528": [2, 5], "0/63/65529": [0, 1, 3, 4], "0/63/65531": [0, 1, 2, 3, 65528, 65529, 65530, 65531, 65532, 65533], - "0/64/0": [ - { - "0": "room", - "1": "bedroom 2" - }, - { - "0": "orientation", - "1": "North" - }, - { - "0": "floor", - "1": "2" - }, - { - "0": "direction", - "1": "up" - } - ], "0/64/65532": 0, "0/64/65533": 1, "0/64/65528": [], diff --git a/tests/components/matter/fixtures/nodes/onoff_light.json b/tests/components/matter/fixtures/nodes/onoff_light.json index 15390129dd235..de3e5d4c357f7 100644 --- a/tests/components/matter/fixtures/nodes/onoff_light.json +++ b/tests/components/matter/fixtures/nodes/onoff_light.json @@ -276,24 +276,6 @@ "0/63/65528": [2, 5], "0/63/65529": [0, 1, 3, 4], "0/63/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533], - "0/64/0": [ - { - "0": "room", - "1": "bedroom 2" - }, - { - "0": "orientation", - "1": "North" - }, - { - "0": "floor", - "1": "2" - }, - { - "0": "direction", - "1": "up" - } - ], "0/64/65532": 0, "0/64/65533": 1, "0/64/65528": [], diff --git a/tests/components/matter/fixtures/nodes/onoff_light_alt_name.json b/tests/components/matter/fixtures/nodes/onoff_light_alt_name.json index ac462cd79512c..ad3bb82173665 100644 --- a/tests/components/matter/fixtures/nodes/onoff_light_alt_name.json +++ b/tests/components/matter/fixtures/nodes/onoff_light_alt_name.json @@ -276,24 +276,6 @@ "0/63/65528": [2, 5], "0/63/65529": [0, 1, 3, 4], "0/63/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533], - "0/64/0": [ - { - "0": "room", - "1": "bedroom 2" - }, - { - "0": "orientation", - "1": "North" - }, - { - "0": "floor", - "1": "2" - }, - { - "0": "direction", - "1": "up" - } - ], "0/64/65532": 0, "0/64/65533": 1, "0/64/65528": [], diff --git a/tests/components/matter/fixtures/nodes/onoff_light_no_name.json b/tests/components/matter/fixtures/nodes/onoff_light_no_name.json index 19cd58bf5cbb0..2f7abd2bc4490 100644 --- a/tests/components/matter/fixtures/nodes/onoff_light_no_name.json +++ b/tests/components/matter/fixtures/nodes/onoff_light_no_name.json @@ -276,24 +276,6 @@ "0/63/65528": [2, 5], "0/63/65529": [0, 1, 3, 4], "0/63/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533], - "0/64/0": [ - { - "0": "room", - "1": "bedroom 2" - }, - { - "0": "orientation", - "1": "North" - }, - { - "0": "floor", - "1": "2" - }, - { - "0": "direction", - "1": "up" - } - ], "0/64/65532": 0, "0/64/65533": 1, "0/64/65528": [], diff --git a/tests/components/matter/fixtures/nodes/silabs_dishwasher.json b/tests/components/matter/fixtures/nodes/silabs_dishwasher.json index fa66f4dfeefd0..f6129d2649512 100644 --- a/tests/components/matter/fixtures/nodes/silabs_dishwasher.json +++ b/tests/components/matter/fixtures/nodes/silabs_dishwasher.json @@ -354,24 +354,6 @@ "0/63/65528": [2, 5], "0/63/65529": [0, 1, 3, 4], "0/63/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533], - "0/64/0": [ - { - "0": "room", - "1": "bedroom 2" - }, - { - "0": "orientation", - "1": "North" - }, - { - "0": "floor", - "1": "2" - }, - { - "0": "direction", - "1": "up" - } - ], "0/64/65532": 0, "0/64/65533": 1, "0/64/65528": [], diff --git a/tests/components/matter/fixtures/nodes/silabs_laundrywasher.json b/tests/components/matter/fixtures/nodes/silabs_laundrywasher.json index 93ba7e2e026a8..6bcb5d3d96ec7 100644 --- a/tests/components/matter/fixtures/nodes/silabs_laundrywasher.json +++ b/tests/components/matter/fixtures/nodes/silabs_laundrywasher.json @@ -590,24 +590,6 @@ "0/63/65528": [2, 5], "0/63/65529": [0, 1, 3, 4], "0/63/65531": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533], - "0/64/0": [ - { - "0": "room", - "1": "bedroom 2" - }, - { - "0": "orientation", - "1": "North" - }, - { - "0": "floor", - "1": "2" - }, - { - "0": "direction", - "1": "up" - } - ], "0/64/65532": 0, "0/64/65533": 1, "0/64/65528": [], diff --git a/tests/components/matter/snapshots/test_button.ambr b/tests/components/matter/snapshots/test_button.ambr index f0bc0a134f332..98b552d615fa6 100644 --- a/tests/components/matter/snapshots/test_button.ambr +++ b/tests/components/matter/snapshots/test_button.ambr @@ -438,7 +438,7 @@ 'state': 'unknown', }) # --- -# name: test_buttons[eve_energy_20ecn4101][button.eve_energy_20ecn4101_identify_1-entry] +# name: test_buttons[eve_energy_20ecn4101][button.eve_energy_20ecn4101_identify_bottom-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -451,7 +451,7 @@ 'disabled_by': None, 'domain': 'button', 'entity_category': , - 'entity_id': 'button.eve_energy_20ecn4101_identify_1', + 'entity_id': 'button.eve_energy_20ecn4101_identify_bottom', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -463,31 +463,31 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Identify (1)', + 'original_name': 'Identify (bottom)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, 'translation_key': None, - 'unique_id': '00000000000004D2-00000000000000C7-MatterNodeDevice-1-IdentifyButton-3-1', + 'unique_id': '00000000000004D2-00000000000000C7-MatterNodeDevice-2-IdentifyButton-3-1', 'unit_of_measurement': None, }) # --- -# name: test_buttons[eve_energy_20ecn4101][button.eve_energy_20ecn4101_identify_1-state] +# name: test_buttons[eve_energy_20ecn4101][button.eve_energy_20ecn4101_identify_bottom-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'identify', - 'friendly_name': 'Eve Energy 20ECN4101 Identify (1)', + 'friendly_name': 'Eve Energy 20ECN4101 Identify (bottom)', }), 'context': , - 'entity_id': 'button.eve_energy_20ecn4101_identify_1', + 'entity_id': 'button.eve_energy_20ecn4101_identify_bottom', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_buttons[eve_energy_20ecn4101][button.eve_energy_20ecn4101_identify_2-entry] +# name: test_buttons[eve_energy_20ecn4101][button.eve_energy_20ecn4101_identify_top-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -500,7 +500,7 @@ 'disabled_by': None, 'domain': 'button', 'entity_category': , - 'entity_id': 'button.eve_energy_20ecn4101_identify_2', + 'entity_id': 'button.eve_energy_20ecn4101_identify_top', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -512,24 +512,24 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Identify (2)', + 'original_name': 'Identify (top)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, 'translation_key': None, - 'unique_id': '00000000000004D2-00000000000000C7-MatterNodeDevice-2-IdentifyButton-3-1', + 'unique_id': '00000000000004D2-00000000000000C7-MatterNodeDevice-1-IdentifyButton-3-1', 'unit_of_measurement': None, }) # --- -# name: test_buttons[eve_energy_20ecn4101][button.eve_energy_20ecn4101_identify_2-state] +# name: test_buttons[eve_energy_20ecn4101][button.eve_energy_20ecn4101_identify_top-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'identify', - 'friendly_name': 'Eve Energy 20ECN4101 Identify (2)', + 'friendly_name': 'Eve Energy 20ECN4101 Identify (top)', }), 'context': , - 'entity_id': 'button.eve_energy_20ecn4101_identify_2', + 'entity_id': 'button.eve_energy_20ecn4101_identify_top', 'last_changed': , 'last_reported': , 'last_updated': , @@ -926,7 +926,7 @@ 'state': 'unknown', }) # --- -# name: test_buttons[fan][button.mocked_fan_switch_identify-entry] +# name: test_buttons[fan][button.mocked_fan_switch_identify_fan-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -939,7 +939,7 @@ 'disabled_by': None, 'domain': 'button', 'entity_category': , - 'entity_id': 'button.mocked_fan_switch_identify', + 'entity_id': 'button.mocked_fan_switch_identify_fan', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -951,7 +951,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Identify', + 'original_name': 'Identify (Fan)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -961,14 +961,14 @@ 'unit_of_measurement': None, }) # --- -# name: test_buttons[fan][button.mocked_fan_switch_identify-state] +# name: test_buttons[fan][button.mocked_fan_switch_identify_fan-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'identify', - 'friendly_name': 'Mocked Fan Switch Identify', + 'friendly_name': 'Mocked Fan Switch Identify (Fan)', }), 'context': , - 'entity_id': 'button.mocked_fan_switch_identify', + 'entity_id': 'button.mocked_fan_switch_identify_fan', 'last_changed': , 'last_reported': , 'last_updated': , @@ -1024,7 +1024,7 @@ 'state': 'unknown', }) # --- -# name: test_buttons[inovelli_vtm30][button.white_series_onoff_switch_load_control-entry] +# name: test_buttons[inovelli_vtm30][button.white_series_onoff_switch_identify_load_control-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -1037,7 +1037,7 @@ 'disabled_by': None, 'domain': 'button', 'entity_category': , - 'entity_id': 'button.white_series_onoff_switch_load_control', + 'entity_id': 'button.white_series_onoff_switch_identify_load_control', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1049,7 +1049,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Load Control', + 'original_name': 'Identify (Load Control)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -1059,14 +1059,14 @@ 'unit_of_measurement': None, }) # --- -# name: test_buttons[inovelli_vtm30][button.white_series_onoff_switch_load_control-state] +# name: test_buttons[inovelli_vtm30][button.white_series_onoff_switch_identify_load_control-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'identify', - 'friendly_name': 'White Series OnOff Switch Load Control', + 'friendly_name': 'White Series OnOff Switch Identify (Load Control)', }), 'context': , - 'entity_id': 'button.white_series_onoff_switch_load_control', + 'entity_id': 'button.white_series_onoff_switch_identify_load_control', 'last_changed': , 'last_reported': , 'last_updated': , @@ -1457,7 +1457,7 @@ 'state': 'unknown', }) # --- -# name: test_buttons[multi_endpoint_light][button.inovelli_config-entry] +# name: test_buttons[multi_endpoint_light][button.inovelli_identify_1-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -1470,7 +1470,7 @@ 'disabled_by': None, 'domain': 'button', 'entity_category': , - 'entity_id': 'button.inovelli_config', + 'entity_id': 'button.inovelli_identify_1', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1482,31 +1482,31 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Config', + 'original_name': 'Identify (1)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, 'translation_key': None, - 'unique_id': '00000000000004D2-00000000000000C5-MatterNodeDevice-5-IdentifyButton-3-1', + 'unique_id': '00000000000004D2-00000000000000C5-MatterNodeDevice-1-IdentifyButton-3-1', 'unit_of_measurement': None, }) # --- -# name: test_buttons[multi_endpoint_light][button.inovelli_config-state] +# name: test_buttons[multi_endpoint_light][button.inovelli_identify_1-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'identify', - 'friendly_name': 'Inovelli Config', + 'friendly_name': 'Inovelli Identify (1)', }), 'context': , - 'entity_id': 'button.inovelli_config', + 'entity_id': 'button.inovelli_identify_1', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_buttons[multi_endpoint_light][button.inovelli_down-entry] +# name: test_buttons[multi_endpoint_light][button.inovelli_identify_2-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -1519,7 +1519,7 @@ 'disabled_by': None, 'domain': 'button', 'entity_category': , - 'entity_id': 'button.inovelli_down', + 'entity_id': 'button.inovelli_identify_2', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1531,31 +1531,31 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Down', + 'original_name': 'Identify (2)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, 'translation_key': None, - 'unique_id': '00000000000004D2-00000000000000C5-MatterNodeDevice-4-IdentifyButton-3-1', + 'unique_id': '00000000000004D2-00000000000000C5-MatterNodeDevice-2-IdentifyButton-3-1', 'unit_of_measurement': None, }) # --- -# name: test_buttons[multi_endpoint_light][button.inovelli_down-state] +# name: test_buttons[multi_endpoint_light][button.inovelli_identify_2-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'identify', - 'friendly_name': 'Inovelli Down', + 'friendly_name': 'Inovelli Identify (2)', }), 'context': , - 'entity_id': 'button.inovelli_down', + 'entity_id': 'button.inovelli_identify_2', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_buttons[multi_endpoint_light][button.inovelli_identify_1-entry] +# name: test_buttons[multi_endpoint_light][button.inovelli_identify_6-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -1568,7 +1568,7 @@ 'disabled_by': None, 'domain': 'button', 'entity_category': , - 'entity_id': 'button.inovelli_identify_1', + 'entity_id': 'button.inovelli_identify_6', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1580,31 +1580,31 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Identify (1)', + 'original_name': 'Identify (6)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, 'translation_key': None, - 'unique_id': '00000000000004D2-00000000000000C5-MatterNodeDevice-1-IdentifyButton-3-1', + 'unique_id': '00000000000004D2-00000000000000C5-MatterNodeDevice-6-IdentifyButton-3-1', 'unit_of_measurement': None, }) # --- -# name: test_buttons[multi_endpoint_light][button.inovelli_identify_1-state] +# name: test_buttons[multi_endpoint_light][button.inovelli_identify_6-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'identify', - 'friendly_name': 'Inovelli Identify (1)', + 'friendly_name': 'Inovelli Identify (6)', }), 'context': , - 'entity_id': 'button.inovelli_identify_1', + 'entity_id': 'button.inovelli_identify_6', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_buttons[multi_endpoint_light][button.inovelli_identify_2-entry] +# name: test_buttons[multi_endpoint_light][button.inovelli_identify_config-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -1617,7 +1617,7 @@ 'disabled_by': None, 'domain': 'button', 'entity_category': , - 'entity_id': 'button.inovelli_identify_2', + 'entity_id': 'button.inovelli_identify_config', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1629,31 +1629,31 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Identify (2)', + 'original_name': 'Identify (Config)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, 'translation_key': None, - 'unique_id': '00000000000004D2-00000000000000C5-MatterNodeDevice-2-IdentifyButton-3-1', + 'unique_id': '00000000000004D2-00000000000000C5-MatterNodeDevice-5-IdentifyButton-3-1', 'unit_of_measurement': None, }) # --- -# name: test_buttons[multi_endpoint_light][button.inovelli_identify_2-state] +# name: test_buttons[multi_endpoint_light][button.inovelli_identify_config-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'identify', - 'friendly_name': 'Inovelli Identify (2)', + 'friendly_name': 'Inovelli Identify (Config)', }), 'context': , - 'entity_id': 'button.inovelli_identify_2', + 'entity_id': 'button.inovelli_identify_config', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_buttons[multi_endpoint_light][button.inovelli_identify_6-entry] +# name: test_buttons[multi_endpoint_light][button.inovelli_identify_down-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -1666,7 +1666,7 @@ 'disabled_by': None, 'domain': 'button', 'entity_category': , - 'entity_id': 'button.inovelli_identify_6', + 'entity_id': 'button.inovelli_identify_down', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1678,31 +1678,31 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Identify (6)', + 'original_name': 'Identify (Down)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, 'translation_key': None, - 'unique_id': '00000000000004D2-00000000000000C5-MatterNodeDevice-6-IdentifyButton-3-1', + 'unique_id': '00000000000004D2-00000000000000C5-MatterNodeDevice-4-IdentifyButton-3-1', 'unit_of_measurement': None, }) # --- -# name: test_buttons[multi_endpoint_light][button.inovelli_identify_6-state] +# name: test_buttons[multi_endpoint_light][button.inovelli_identify_down-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'identify', - 'friendly_name': 'Inovelli Identify (6)', + 'friendly_name': 'Inovelli Identify (Down)', }), 'context': , - 'entity_id': 'button.inovelli_identify_6', + 'entity_id': 'button.inovelli_identify_down', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_buttons[multi_endpoint_light][button.inovelli_up-entry] +# name: test_buttons[multi_endpoint_light][button.inovelli_identify_up-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -1715,7 +1715,7 @@ 'disabled_by': None, 'domain': 'button', 'entity_category': , - 'entity_id': 'button.inovelli_up', + 'entity_id': 'button.inovelli_identify_up', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1727,7 +1727,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Up', + 'original_name': 'Identify (Up)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -1737,14 +1737,14 @@ 'unit_of_measurement': None, }) # --- -# name: test_buttons[multi_endpoint_light][button.inovelli_up-state] +# name: test_buttons[multi_endpoint_light][button.inovelli_identify_up-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'identify', - 'friendly_name': 'Inovelli Up', + 'friendly_name': 'Inovelli Identify (Up)', }), 'context': , - 'entity_id': 'button.inovelli_up', + 'entity_id': 'button.inovelli_identify_up', 'last_changed': , 'last_reported': , 'last_updated': , diff --git a/tests/components/matter/snapshots/test_event.ambr b/tests/components/matter/snapshots/test_event.ambr index fbde547f70125..ee4cbef867540 100644 --- a/tests/components/matter/snapshots/test_event.ambr +++ b/tests/components/matter/snapshots/test_event.ambr @@ -125,7 +125,7 @@ 'state': 'unknown', }) # --- -# name: test_events[generic_switch_multi][event.mock_generic_switch_fancy_button-entry] +# name: test_events[generic_switch_multi][event.mock_generic_switch_button_2-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -147,7 +147,7 @@ 'disabled_by': None, 'domain': 'event', 'entity_category': None, - 'entity_id': 'event.mock_generic_switch_fancy_button', + 'entity_id': 'event.mock_generic_switch_button_2', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -159,7 +159,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Fancy Button', + 'original_name': 'Button (2)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -169,7 +169,7 @@ 'unit_of_measurement': None, }) # --- -# name: test_events[generic_switch_multi][event.mock_generic_switch_fancy_button-state] +# name: test_events[generic_switch_multi][event.mock_generic_switch_button_2-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'button', @@ -182,10 +182,10 @@ 'long_press', 'long_release', ]), - 'friendly_name': 'Mock Generic Switch Fancy Button', + 'friendly_name': 'Mock Generic Switch Button (2)', }), 'context': , - 'entity_id': 'event.mock_generic_switch_fancy_button', + 'entity_id': 'event.mock_generic_switch_button_2', 'last_changed': , 'last_reported': , 'last_updated': , @@ -570,7 +570,7 @@ 'state': 'unknown', }) # --- -# name: test_events[inovelli_vtm30][event.white_series_onoff_switch_config-entry] +# name: test_events[inovelli_vtm30][event.white_series_onoff_switch_button_config-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -593,7 +593,7 @@ 'disabled_by': None, 'domain': 'event', 'entity_category': None, - 'entity_id': 'event.white_series_onoff_switch_config', + 'entity_id': 'event.white_series_onoff_switch_button_config', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -605,7 +605,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Config', + 'original_name': 'Button (Config)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -615,7 +615,7 @@ 'unit_of_measurement': None, }) # --- -# name: test_events[inovelli_vtm30][event.white_series_onoff_switch_config-state] +# name: test_events[inovelli_vtm30][event.white_series_onoff_switch_button_config-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'button', @@ -629,17 +629,17 @@ 'long_press', 'long_release', ]), - 'friendly_name': 'White Series OnOff Switch Config', + 'friendly_name': 'White Series OnOff Switch Button (Config)', }), 'context': , - 'entity_id': 'event.white_series_onoff_switch_config', + 'entity_id': 'event.white_series_onoff_switch_button_config', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_events[inovelli_vtm30][event.white_series_onoff_switch_down-entry] +# name: test_events[inovelli_vtm30][event.white_series_onoff_switch_button_down-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -662,7 +662,7 @@ 'disabled_by': None, 'domain': 'event', 'entity_category': None, - 'entity_id': 'event.white_series_onoff_switch_down', + 'entity_id': 'event.white_series_onoff_switch_button_down', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -674,7 +674,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Down', + 'original_name': 'Button (Down)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -684,7 +684,7 @@ 'unit_of_measurement': None, }) # --- -# name: test_events[inovelli_vtm30][event.white_series_onoff_switch_down-state] +# name: test_events[inovelli_vtm30][event.white_series_onoff_switch_button_down-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'button', @@ -698,17 +698,17 @@ 'long_press', 'long_release', ]), - 'friendly_name': 'White Series OnOff Switch Down', + 'friendly_name': 'White Series OnOff Switch Button (Down)', }), 'context': , - 'entity_id': 'event.white_series_onoff_switch_down', + 'entity_id': 'event.white_series_onoff_switch_button_down', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_events[inovelli_vtm30][event.white_series_onoff_switch_up-entry] +# name: test_events[inovelli_vtm30][event.white_series_onoff_switch_button_up-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -731,7 +731,7 @@ 'disabled_by': None, 'domain': 'event', 'entity_category': None, - 'entity_id': 'event.white_series_onoff_switch_up', + 'entity_id': 'event.white_series_onoff_switch_button_up', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -743,7 +743,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Up', + 'original_name': 'Button (Up)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -753,7 +753,7 @@ 'unit_of_measurement': None, }) # --- -# name: test_events[inovelli_vtm30][event.white_series_onoff_switch_up-state] +# name: test_events[inovelli_vtm30][event.white_series_onoff_switch_button_up-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'button', @@ -767,17 +767,17 @@ 'long_press', 'long_release', ]), - 'friendly_name': 'White Series OnOff Switch Up', + 'friendly_name': 'White Series OnOff Switch Button (Up)', }), 'context': , - 'entity_id': 'event.white_series_onoff_switch_up', + 'entity_id': 'event.white_series_onoff_switch_button_up', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_events[multi_endpoint_light][event.inovelli_config-entry] +# name: test_events[multi_endpoint_light][event.inovelli_button_config-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -800,7 +800,7 @@ 'disabled_by': None, 'domain': 'event', 'entity_category': None, - 'entity_id': 'event.inovelli_config', + 'entity_id': 'event.inovelli_button_config', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -812,7 +812,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Config', + 'original_name': 'Button (Config)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -822,7 +822,7 @@ 'unit_of_measurement': None, }) # --- -# name: test_events[multi_endpoint_light][event.inovelli_config-state] +# name: test_events[multi_endpoint_light][event.inovelli_button_config-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'button', @@ -836,17 +836,17 @@ 'long_press', 'long_release', ]), - 'friendly_name': 'Inovelli Config', + 'friendly_name': 'Inovelli Button (Config)', }), 'context': , - 'entity_id': 'event.inovelli_config', + 'entity_id': 'event.inovelli_button_config', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_events[multi_endpoint_light][event.inovelli_down-entry] +# name: test_events[multi_endpoint_light][event.inovelli_button_down-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -869,7 +869,7 @@ 'disabled_by': None, 'domain': 'event', 'entity_category': None, - 'entity_id': 'event.inovelli_down', + 'entity_id': 'event.inovelli_button_down', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -881,7 +881,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Down', + 'original_name': 'Button (Down)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -891,7 +891,7 @@ 'unit_of_measurement': None, }) # --- -# name: test_events[multi_endpoint_light][event.inovelli_down-state] +# name: test_events[multi_endpoint_light][event.inovelli_button_down-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'button', @@ -905,17 +905,17 @@ 'long_press', 'long_release', ]), - 'friendly_name': 'Inovelli Down', + 'friendly_name': 'Inovelli Button (Down)', }), 'context': , - 'entity_id': 'event.inovelli_down', + 'entity_id': 'event.inovelli_button_down', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_events[multi_endpoint_light][event.inovelli_up-entry] +# name: test_events[multi_endpoint_light][event.inovelli_button_up-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -938,7 +938,7 @@ 'disabled_by': None, 'domain': 'event', 'entity_category': None, - 'entity_id': 'event.inovelli_up', + 'entity_id': 'event.inovelli_button_up', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -950,7 +950,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Up', + 'original_name': 'Button (Up)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -960,7 +960,7 @@ 'unit_of_measurement': None, }) # --- -# name: test_events[multi_endpoint_light][event.inovelli_up-state] +# name: test_events[multi_endpoint_light][event.inovelli_button_up-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'button', @@ -974,10 +974,10 @@ 'long_press', 'long_release', ]), - 'friendly_name': 'Inovelli Up', + 'friendly_name': 'Inovelli Button (Up)', }), 'context': , - 'entity_id': 'event.inovelli_up', + 'entity_id': 'event.inovelli_button_up', 'last_changed': , 'last_reported': , 'last_updated': , diff --git a/tests/components/matter/snapshots/test_light.ambr b/tests/components/matter/snapshots/test_light.ambr index 9a403722e5c58..3aec43a16a96b 100644 --- a/tests/components/matter/snapshots/test_light.ambr +++ b/tests/components/matter/snapshots/test_light.ambr @@ -281,7 +281,7 @@ 'state': 'on', }) # --- -# name: test_lights[inovelli_vtm30][light.white_series_onoff_switch_rgb_indicator-entry] +# name: test_lights[inovelli_vtm30][light.white_series_onoff_switch_light_rgb_indicator-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -304,7 +304,7 @@ 'disabled_by': None, 'domain': 'light', 'entity_category': None, - 'entity_id': 'light.white_series_onoff_switch_rgb_indicator', + 'entity_id': 'light.white_series_onoff_switch_light_rgb_indicator', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -316,7 +316,7 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'RGB Indicator', + 'original_name': 'Light (RGB Indicator)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -326,14 +326,14 @@ 'unit_of_measurement': None, }) # --- -# name: test_lights[inovelli_vtm30][light.white_series_onoff_switch_rgb_indicator-state] +# name: test_lights[inovelli_vtm30][light.white_series_onoff_switch_light_rgb_indicator-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'brightness': None, 'color_mode': None, 'color_temp': None, 'color_temp_kelvin': None, - 'friendly_name': 'White Series OnOff Switch RGB Indicator', + 'friendly_name': 'White Series OnOff Switch Light (RGB Indicator)', 'hs_color': None, 'max_color_temp_kelvin': 1000000, 'max_mireds': 66666, @@ -349,7 +349,7 @@ 'xy_color': None, }), 'context': , - 'entity_id': 'light.white_series_onoff_switch_rgb_indicator', + 'entity_id': 'light.white_series_onoff_switch_light_rgb_indicator', 'last_changed': , 'last_reported': , 'last_updated': , diff --git a/tests/components/matter/snapshots/test_number.ambr b/tests/components/matter/snapshots/test_number.ambr index bd22389652a91..e82ab3689b458 100644 --- a/tests/components/matter/snapshots/test_number.ambr +++ b/tests/components/matter/snapshots/test_number.ambr @@ -1096,13 +1096,13 @@ 'state': '255', }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_load_control-entry] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_led_off_intensity_load_control-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), 'area_id': None, 'capabilities': dict({ - 'max': 255, + 'max': 75, 'min': 0, 'mode': , 'step': 1, @@ -1114,7 +1114,7 @@ 'disabled_by': None, 'domain': 'number', 'entity_category': , - 'entity_id': 'number.white_series_onoff_switch_load_control', + 'entity_id': 'number.white_series_onoff_switch_led_off_intensity_load_control', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1126,43 +1126,43 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Load Control', + 'original_name': 'LED off intensity (Load Control)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'on_level', - 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-1-on_level-8-17', + 'translation_key': 'led_indicator_intensity_off', + 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-1-InovelliLEDIndicatorIntensityOff-305134641-305070178', 'unit_of_measurement': None, }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_load_control-state] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_led_off_intensity_load_control-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'White Series OnOff Switch Load Control', - 'max': 255, + 'friendly_name': 'White Series OnOff Switch LED off intensity (Load Control)', + 'max': 75, 'min': 0, 'mode': , 'step': 1, }), 'context': , - 'entity_id': 'number.white_series_onoff_switch_load_control', + 'entity_id': 'number.white_series_onoff_switch_led_off_intensity_load_control', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '255', + 'state': '1', }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_load_control_2-entry] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_led_on_intensity_load_control-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), 'area_id': None, 'capabilities': dict({ - 'max': 65534, + 'max': 75, 'min': 0, 'mode': , - 'step': 0.1, + 'step': 1, }), 'config_entry_id': , 'config_subentry_id': , @@ -1171,7 +1171,7 @@ 'disabled_by': None, 'domain': 'number', 'entity_category': , - 'entity_id': 'number.white_series_onoff_switch_load_control_2', + 'entity_id': 'number.white_series_onoff_switch_led_on_intensity_load_control', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1183,35 +1183,34 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Load Control', + 'original_name': 'LED on intensity (Load Control)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'on_transition_time', - 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-1-on_transition_time-8-18', - 'unit_of_measurement': , + 'translation_key': 'led_indicator_intensity_on', + 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-1-InovelliLEDIndicatorIntensityOn-305134641-305070177', + 'unit_of_measurement': None, }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_load_control_2-state] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_led_on_intensity_load_control-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'White Series OnOff Switch Load Control', - 'max': 65534, + 'friendly_name': 'White Series OnOff Switch LED on intensity (Load Control)', + 'max': 75, 'min': 0, 'mode': , - 'step': 0.1, - 'unit_of_measurement': , + 'step': 1, }), 'context': , - 'entity_id': 'number.white_series_onoff_switch_load_control_2', + 'entity_id': 'number.white_series_onoff_switch_led_on_intensity_load_control', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'unknown', + 'state': '33', }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_load_control_3-entry] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_off_transition_time_load_control-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -1229,7 +1228,7 @@ 'disabled_by': None, 'domain': 'number', 'entity_category': , - 'entity_id': 'number.white_series_onoff_switch_load_control_3', + 'entity_id': 'number.white_series_onoff_switch_off_transition_time_load_control', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1241,7 +1240,7 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Load Control', + 'original_name': 'Off transition time (Load Control)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -1251,10 +1250,10 @@ 'unit_of_measurement': , }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_load_control_3-state] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_off_transition_time_load_control-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'White Series OnOff Switch Load Control', + 'friendly_name': 'White Series OnOff Switch Off transition time (Load Control)', 'max': 65534, 'min': 0, 'mode': , @@ -1262,23 +1261,23 @@ 'unit_of_measurement': , }), 'context': , - 'entity_id': 'number.white_series_onoff_switch_load_control_3', + 'entity_id': 'number.white_series_onoff_switch_off_transition_time_load_control', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'unknown', }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_load_control_4-entry] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_on_level_load_control-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), 'area_id': None, 'capabilities': dict({ - 'max': 65534, + 'max': 255, 'min': 0, 'mode': , - 'step': 0.1, + 'step': 1, }), 'config_entry_id': , 'config_subentry_id': , @@ -1287,7 +1286,7 @@ 'disabled_by': None, 'domain': 'number', 'entity_category': , - 'entity_id': 'number.white_series_onoff_switch_load_control_4', + 'entity_id': 'number.white_series_onoff_switch_on_level_load_control', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1299,41 +1298,40 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Load Control', + 'original_name': 'On level (Load Control)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'on_off_transition_time', - 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-1-on_off_transition_time-8-16', - 'unit_of_measurement': , + 'translation_key': 'on_level', + 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-1-on_level-8-17', + 'unit_of_measurement': None, }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_load_control_4-state] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_on_level_load_control-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'White Series OnOff Switch Load Control', - 'max': 65534, + 'friendly_name': 'White Series OnOff Switch On level (Load Control)', + 'max': 255, 'min': 0, 'mode': , - 'step': 0.1, - 'unit_of_measurement': , + 'step': 1, }), 'context': , - 'entity_id': 'number.white_series_onoff_switch_load_control_4', + 'entity_id': 'number.white_series_onoff_switch_on_level_load_control', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '0.0', + 'state': '255', }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_load_control_5-entry] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_on_level_rgb_indicator-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), 'area_id': None, 'capabilities': dict({ - 'max': 75, + 'max': 255, 'min': 0, 'mode': , 'step': 1, @@ -1345,7 +1343,7 @@ 'disabled_by': None, 'domain': 'number', 'entity_category': , - 'entity_id': 'number.white_series_onoff_switch_load_control_5', + 'entity_id': 'number.white_series_onoff_switch_on_level_rgb_indicator', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1357,43 +1355,43 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Load Control', + 'original_name': 'On level (RGB Indicator)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'led_indicator_intensity_off', - 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-1-InovelliLEDIndicatorIntensityOff-305134641-305070178', + 'translation_key': 'on_level', + 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-6-on_level-8-17', 'unit_of_measurement': None, }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_load_control_5-state] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_on_level_rgb_indicator-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'White Series OnOff Switch Load Control', - 'max': 75, + 'friendly_name': 'White Series OnOff Switch On level (RGB Indicator)', + 'max': 255, 'min': 0, 'mode': , 'step': 1, }), 'context': , - 'entity_id': 'number.white_series_onoff_switch_load_control_5', + 'entity_id': 'number.white_series_onoff_switch_on_level_rgb_indicator', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '1', + 'state': '255', }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_load_control_6-entry] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_on_off_transition_time_load_control-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), 'area_id': None, 'capabilities': dict({ - 'max': 75, + 'max': 65534, 'min': 0, 'mode': , - 'step': 1, + 'step': 0.1, }), 'config_entry_id': , 'config_subentry_id': , @@ -1402,7 +1400,7 @@ 'disabled_by': None, 'domain': 'number', 'entity_category': , - 'entity_id': 'number.white_series_onoff_switch_load_control_6', + 'entity_id': 'number.white_series_onoff_switch_on_off_transition_time_load_control', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1414,43 +1412,44 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Load Control', + 'original_name': 'On/Off transition time (Load Control)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'led_indicator_intensity_on', - 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-1-InovelliLEDIndicatorIntensityOn-305134641-305070177', - 'unit_of_measurement': None, + 'translation_key': 'on_off_transition_time', + 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-1-on_off_transition_time-8-16', + 'unit_of_measurement': , }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_load_control_6-state] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_on_off_transition_time_load_control-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'White Series OnOff Switch Load Control', - 'max': 75, + 'friendly_name': 'White Series OnOff Switch On/Off transition time (Load Control)', + 'max': 65534, 'min': 0, 'mode': , - 'step': 1, + 'step': 0.1, + 'unit_of_measurement': , }), 'context': , - 'entity_id': 'number.white_series_onoff_switch_load_control_6', + 'entity_id': 'number.white_series_onoff_switch_on_off_transition_time_load_control', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '33', + 'state': '0.0', }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_rgb_indicator-entry] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_on_off_transition_time_rgb_indicator-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), 'area_id': None, 'capabilities': dict({ - 'max': 255, + 'max': 65534, 'min': 0, 'mode': , - 'step': 1, + 'step': 0.1, }), 'config_entry_id': , 'config_subentry_id': , @@ -1459,7 +1458,7 @@ 'disabled_by': None, 'domain': 'number', 'entity_category': , - 'entity_id': 'number.white_series_onoff_switch_rgb_indicator', + 'entity_id': 'number.white_series_onoff_switch_on_off_transition_time_rgb_indicator', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1471,34 +1470,35 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'RGB Indicator', + 'original_name': 'On/Off transition time (RGB Indicator)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'on_level', - 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-6-on_level-8-17', - 'unit_of_measurement': None, + 'translation_key': 'on_off_transition_time', + 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-6-on_off_transition_time-8-16', + 'unit_of_measurement': , }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_rgb_indicator-state] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_on_off_transition_time_rgb_indicator-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'White Series OnOff Switch RGB Indicator', - 'max': 255, + 'friendly_name': 'White Series OnOff Switch On/Off transition time (RGB Indicator)', + 'max': 65534, 'min': 0, 'mode': , - 'step': 1, + 'step': 0.1, + 'unit_of_measurement': , }), 'context': , - 'entity_id': 'number.white_series_onoff_switch_rgb_indicator', + 'entity_id': 'number.white_series_onoff_switch_on_off_transition_time_rgb_indicator', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '255', + 'state': '0.0', }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_rgb_indicator_2-entry] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_on_transition_time_load_control-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -1516,7 +1516,7 @@ 'disabled_by': None, 'domain': 'number', 'entity_category': , - 'entity_id': 'number.white_series_onoff_switch_rgb_indicator_2', + 'entity_id': 'number.white_series_onoff_switch_on_transition_time_load_control', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1528,20 +1528,20 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'RGB Indicator', + 'original_name': 'On transition time (Load Control)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'on_off_transition_time', - 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-6-on_off_transition_time-8-16', + 'translation_key': 'on_transition_time', + 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-1-on_transition_time-8-18', 'unit_of_measurement': , }) # --- -# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_rgb_indicator_2-state] +# name: test_numbers[inovelli_vtm30][number.white_series_onoff_switch_on_transition_time_load_control-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'White Series OnOff Switch RGB Indicator', + 'friendly_name': 'White Series OnOff Switch On transition time (Load Control)', 'max': 65534, 'min': 0, 'mode': , @@ -1549,11 +1549,11 @@ 'unit_of_measurement': , }), 'context': , - 'entity_id': 'number.white_series_onoff_switch_rgb_indicator_2', + 'entity_id': 'number.white_series_onoff_switch_on_transition_time_load_control', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '0.0', + 'state': 'unknown', }) # --- # name: test_numbers[microwave_oven][number.microwave_oven_cooking_time-entry] diff --git a/tests/components/matter/snapshots/test_select.ambr b/tests/components/matter/snapshots/test_select.ambr index cf2c4a5586ca1..1885d0203945e 100644 --- a/tests/components/matter/snapshots/test_select.ambr +++ b/tests/components/matter/snapshots/test_select.ambr @@ -682,7 +682,7 @@ 'state': 'silent', }) # --- -# name: test_selects[eve_energy_20ecn4101][select.eve_energy_20ecn4101_power_on_behavior_on_startup_1-entry] +# name: test_selects[eve_energy_20ecn4101][select.eve_energy_20ecn4101_power_on_behavior_on_startup_bottom-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -702,7 +702,7 @@ 'disabled_by': None, 'domain': 'select', 'entity_category': , - 'entity_id': 'select.eve_energy_20ecn4101_power_on_behavior_on_startup_1', + 'entity_id': 'select.eve_energy_20ecn4101_power_on_behavior_on_startup_bottom', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -714,20 +714,20 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Power-on behavior on startup (1)', + 'original_name': 'Power-on behavior on startup (bottom)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, 'translation_key': 'startup_on_off', - 'unique_id': '00000000000004D2-00000000000000C7-MatterNodeDevice-1-MatterStartUpOnOff-6-16387', + 'unique_id': '00000000000004D2-00000000000000C7-MatterNodeDevice-2-MatterStartUpOnOff-6-16387', 'unit_of_measurement': None, }) # --- -# name: test_selects[eve_energy_20ecn4101][select.eve_energy_20ecn4101_power_on_behavior_on_startup_1-state] +# name: test_selects[eve_energy_20ecn4101][select.eve_energy_20ecn4101_power_on_behavior_on_startup_bottom-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Eve Energy 20ECN4101 Power-on behavior on startup (1)', + 'friendly_name': 'Eve Energy 20ECN4101 Power-on behavior on startup (bottom)', 'options': list([ 'on', 'off', @@ -736,14 +736,14 @@ ]), }), 'context': , - 'entity_id': 'select.eve_energy_20ecn4101_power_on_behavior_on_startup_1', + 'entity_id': 'select.eve_energy_20ecn4101_power_on_behavior_on_startup_bottom', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'previous', }) # --- -# name: test_selects[eve_energy_20ecn4101][select.eve_energy_20ecn4101_power_on_behavior_on_startup_2-entry] +# name: test_selects[eve_energy_20ecn4101][select.eve_energy_20ecn4101_power_on_behavior_on_startup_top-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -763,7 +763,7 @@ 'disabled_by': None, 'domain': 'select', 'entity_category': , - 'entity_id': 'select.eve_energy_20ecn4101_power_on_behavior_on_startup_2', + 'entity_id': 'select.eve_energy_20ecn4101_power_on_behavior_on_startup_top', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -775,20 +775,20 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Power-on behavior on startup (2)', + 'original_name': 'Power-on behavior on startup (top)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, 'translation_key': 'startup_on_off', - 'unique_id': '00000000000004D2-00000000000000C7-MatterNodeDevice-2-MatterStartUpOnOff-6-16387', + 'unique_id': '00000000000004D2-00000000000000C7-MatterNodeDevice-1-MatterStartUpOnOff-6-16387', 'unit_of_measurement': None, }) # --- -# name: test_selects[eve_energy_20ecn4101][select.eve_energy_20ecn4101_power_on_behavior_on_startup_2-state] +# name: test_selects[eve_energy_20ecn4101][select.eve_energy_20ecn4101_power_on_behavior_on_startup_top-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Eve Energy 20ECN4101 Power-on behavior on startup (2)', + 'friendly_name': 'Eve Energy 20ECN4101 Power-on behavior on startup (top)', 'options': list([ 'on', 'off', @@ -797,7 +797,7 @@ ]), }), 'context': , - 'entity_id': 'select.eve_energy_20ecn4101_power_on_behavior_on_startup_2', + 'entity_id': 'select.eve_energy_20ecn4101_power_on_behavior_on_startup_top', 'last_changed': , 'last_reported': , 'last_updated': , @@ -1421,17 +1421,15 @@ 'state': 'Solid', }) # --- -# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_load_control-entry] +# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_local_protection-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), 'area_id': None, 'capabilities': dict({ 'options': list([ - 'on', - 'off', - 'toggle', - 'previous', + 'Local Protection Disable', + 'Local Protection Enable', ]), }), 'config_entry_id': , @@ -1441,7 +1439,7 @@ 'disabled_by': None, 'domain': 'select', 'entity_category': , - 'entity_id': 'select.white_series_onoff_switch_load_control', + 'entity_id': 'select.white_series_onoff_switch_local_protection', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1453,44 +1451,42 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Load Control', + 'original_name': 'Local Protection', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'startup_on_off', - 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-1-MatterStartUpOnOff-6-16387', + 'translation_key': 'mode', + 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-8-MatterModeSelect-80-3', 'unit_of_measurement': None, }) # --- -# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_load_control-state] +# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_local_protection-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'White Series OnOff Switch Load Control', + 'friendly_name': 'White Series OnOff Switch Local Protection', 'options': list([ - 'on', - 'off', - 'toggle', - 'previous', + 'Local Protection Disable', + 'Local Protection Enable', ]), }), 'context': , - 'entity_id': 'select.white_series_onoff_switch_load_control', + 'entity_id': 'select.white_series_onoff_switch_local_protection', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'previous', + 'state': 'Local Protection Disable', }) # --- -# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_local_protection-entry] +# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_local_timer-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), 'area_id': None, 'capabilities': dict({ 'options': list([ - 'Local Protection Disable', - 'Local Protection Enable', + 'Local Timer Disable', + 'Local Timer Enable', ]), }), 'config_entry_id': , @@ -1500,7 +1496,7 @@ 'disabled_by': None, 'domain': 'select', 'entity_category': , - 'entity_id': 'select.white_series_onoff_switch_local_protection', + 'entity_id': 'select.white_series_onoff_switch_local_timer', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1512,42 +1508,44 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Local Protection', + 'original_name': 'Local Timer', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, 'translation_key': 'mode', - 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-8-MatterModeSelect-80-3', + 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-3-MatterModeSelect-80-3', 'unit_of_measurement': None, }) # --- -# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_local_protection-state] +# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_local_timer-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'White Series OnOff Switch Local Protection', + 'friendly_name': 'White Series OnOff Switch Local Timer', 'options': list([ - 'Local Protection Disable', - 'Local Protection Enable', + 'Local Timer Disable', + 'Local Timer Enable', ]), }), 'context': , - 'entity_id': 'select.white_series_onoff_switch_local_protection', + 'entity_id': 'select.white_series_onoff_switch_local_timer', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'Local Protection Disable', + 'state': 'Local Timer Disable', }) # --- -# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_local_timer-entry] +# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_power_on_behavior_on_startup_load_control-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), 'area_id': None, 'capabilities': dict({ 'options': list([ - 'Local Timer Disable', - 'Local Timer Enable', + 'on', + 'off', + 'toggle', + 'previous', ]), }), 'config_entry_id': , @@ -1557,7 +1555,7 @@ 'disabled_by': None, 'domain': 'select', 'entity_category': , - 'entity_id': 'select.white_series_onoff_switch_local_timer', + 'entity_id': 'select.white_series_onoff_switch_power_on_behavior_on_startup_load_control', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1569,34 +1567,36 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Local Timer', + 'original_name': 'Power-on behavior on startup (Load Control)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'mode', - 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-3-MatterModeSelect-80-3', + 'translation_key': 'startup_on_off', + 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-1-MatterStartUpOnOff-6-16387', 'unit_of_measurement': None, }) # --- -# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_local_timer-state] +# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_power_on_behavior_on_startup_load_control-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'White Series OnOff Switch Local Timer', + 'friendly_name': 'White Series OnOff Switch Power-on behavior on startup (Load Control)', 'options': list([ - 'Local Timer Disable', - 'Local Timer Enable', + 'on', + 'off', + 'toggle', + 'previous', ]), }), 'context': , - 'entity_id': 'select.white_series_onoff_switch_local_timer', + 'entity_id': 'select.white_series_onoff_switch_power_on_behavior_on_startup_load_control', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'Local Timer Disable', + 'state': 'previous', }) # --- -# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_rgb_indicator-entry] +# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_power_on_behavior_on_startup_rgb_indicator-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -1616,7 +1616,7 @@ 'disabled_by': None, 'domain': 'select', 'entity_category': , - 'entity_id': 'select.white_series_onoff_switch_rgb_indicator', + 'entity_id': 'select.white_series_onoff_switch_power_on_behavior_on_startup_rgb_indicator', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1628,7 +1628,7 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'RGB Indicator', + 'original_name': 'Power-on behavior on startup (RGB Indicator)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -1638,10 +1638,10 @@ 'unit_of_measurement': None, }) # --- -# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_rgb_indicator-state] +# name: test_selects[inovelli_vtm30][select.white_series_onoff_switch_power_on_behavior_on_startup_rgb_indicator-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'White Series OnOff Switch RGB Indicator', + 'friendly_name': 'White Series OnOff Switch Power-on behavior on startup (RGB Indicator)', 'options': list([ 'on', 'off', @@ -1650,7 +1650,7 @@ ]), }), 'context': , - 'entity_id': 'select.white_series_onoff_switch_rgb_indicator', + 'entity_id': 'select.white_series_onoff_switch_power_on_behavior_on_startup_rgb_indicator', 'last_changed': , 'last_reported': , 'last_updated': , diff --git a/tests/components/matter/snapshots/test_sensor.ambr b/tests/components/matter/snapshots/test_sensor.ambr index e11c0f03bf13b..94b7d7c68c04b 100644 --- a/tests/components/matter/snapshots/test_sensor.ambr +++ b/tests/components/matter/snapshots/test_sensor.ambr @@ -2435,7 +2435,7 @@ 'state': '3.558', }) # --- -# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_current-entry] +# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_current_top-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -2450,7 +2450,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': , - 'entity_id': 'sensor.eve_energy_20ecn4101_current', + 'entity_id': 'sensor.eve_energy_20ecn4101_current_top', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -2465,7 +2465,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Current', + 'original_name': 'Current (top)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -2475,23 +2475,23 @@ 'unit_of_measurement': , }) # --- -# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_current-state] +# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_current_top-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'current', - 'friendly_name': 'Eve Energy 20ECN4101 Current', + 'friendly_name': 'Eve Energy 20ECN4101 Current (top)', 'state_class': , 'unit_of_measurement': , }), 'context': , - 'entity_id': 'sensor.eve_energy_20ecn4101_current', + 'entity_id': 'sensor.eve_energy_20ecn4101_current_top', 'last_changed': , 'last_reported': , 'last_updated': , 'state': '0.159999996423721', }) # --- -# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_energy-entry] +# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_energy_top-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -2506,7 +2506,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': , - 'entity_id': 'sensor.eve_energy_20ecn4101_energy', + 'entity_id': 'sensor.eve_energy_20ecn4101_energy_top', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -2521,7 +2521,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Energy', + 'original_name': 'Energy (top)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -2531,23 +2531,23 @@ 'unit_of_measurement': , }) # --- -# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_energy-state] +# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_energy_top-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'energy', - 'friendly_name': 'Eve Energy 20ECN4101 Energy', + 'friendly_name': 'Eve Energy 20ECN4101 Energy (top)', 'state_class': , 'unit_of_measurement': , }), 'context': , - 'entity_id': 'sensor.eve_energy_20ecn4101_energy', + 'entity_id': 'sensor.eve_energy_20ecn4101_energy_top', 'last_changed': , 'last_reported': , 'last_updated': , 'state': '18.7803344726562', }) # --- -# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_power-entry] +# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_power_top-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -2562,7 +2562,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': , - 'entity_id': 'sensor.eve_energy_20ecn4101_power', + 'entity_id': 'sensor.eve_energy_20ecn4101_power_top', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -2577,7 +2577,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Power', + 'original_name': 'Power (top)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -2587,23 +2587,23 @@ 'unit_of_measurement': , }) # --- -# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_power-state] +# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_power_top-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'power', - 'friendly_name': 'Eve Energy 20ECN4101 Power', + 'friendly_name': 'Eve Energy 20ECN4101 Power (top)', 'state_class': , 'unit_of_measurement': , }), 'context': , - 'entity_id': 'sensor.eve_energy_20ecn4101_power', + 'entity_id': 'sensor.eve_energy_20ecn4101_power_top', 'last_changed': , 'last_reported': , 'last_updated': , 'state': '13.3999996185303', }) # --- -# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_voltage-entry] +# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_voltage_top-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -2618,7 +2618,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': , - 'entity_id': 'sensor.eve_energy_20ecn4101_voltage', + 'entity_id': 'sensor.eve_energy_20ecn4101_voltage_top', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -2633,7 +2633,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Voltage', + 'original_name': 'Voltage (top)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -2643,16 +2643,16 @@ 'unit_of_measurement': , }) # --- -# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_voltage-state] +# name: test_sensors[eve_energy_20ecn4101][sensor.eve_energy_20ecn4101_voltage_top-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'voltage', - 'friendly_name': 'Eve Energy 20ECN4101 Voltage', + 'friendly_name': 'Eve Energy 20ECN4101 Voltage (top)', 'state_class': , 'unit_of_measurement': , }), 'context': , - 'entity_id': 'sensor.eve_energy_20ecn4101_voltage', + 'entity_id': 'sensor.eve_energy_20ecn4101_voltage_top', 'last_changed': , 'last_reported': , 'last_updated': , @@ -3933,7 +3933,7 @@ 'state': '0', }) # --- -# name: test_sensors[generic_switch_multi][sensor.mock_generic_switch_fancy_button-entry] +# name: test_sensors[generic_switch_multi][sensor.mock_generic_switch_current_switch_position_2-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -3948,7 +3948,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': , - 'entity_id': 'sensor.mock_generic_switch_fancy_button', + 'entity_id': 'sensor.mock_generic_switch_current_switch_position_2', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -3960,7 +3960,7 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Fancy Button', + 'original_name': 'Current switch position (2)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -3970,14 +3970,14 @@ 'unit_of_measurement': None, }) # --- -# name: test_sensors[generic_switch_multi][sensor.mock_generic_switch_fancy_button-state] +# name: test_sensors[generic_switch_multi][sensor.mock_generic_switch_current_switch_position_2-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Mock Generic Switch Fancy Button', + 'friendly_name': 'Mock Generic Switch Current switch position (2)', 'state_class': , }), 'context': , - 'entity_id': 'sensor.mock_generic_switch_fancy_button', + 'entity_id': 'sensor.mock_generic_switch_current_switch_position_2', 'last_changed': , 'last_reported': , 'last_updated': , @@ -4514,7 +4514,7 @@ 'state': '0.0', }) # --- -# name: test_sensors[inovelli_vtm30][sensor.white_series_onoff_switch_config-entry] +# name: test_sensors[inovelli_vtm30][sensor.white_series_onoff_switch_current_switch_position_config-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -4529,7 +4529,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': , - 'entity_id': 'sensor.white_series_onoff_switch_config', + 'entity_id': 'sensor.white_series_onoff_switch_current_switch_position_config', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -4541,7 +4541,7 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Config', + 'original_name': 'Current switch position (Config)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -4551,21 +4551,21 @@ 'unit_of_measurement': None, }) # --- -# name: test_sensors[inovelli_vtm30][sensor.white_series_onoff_switch_config-state] +# name: test_sensors[inovelli_vtm30][sensor.white_series_onoff_switch_current_switch_position_config-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'White Series OnOff Switch Config', + 'friendly_name': 'White Series OnOff Switch Current switch position (Config)', 'state_class': , }), 'context': , - 'entity_id': 'sensor.white_series_onoff_switch_config', + 'entity_id': 'sensor.white_series_onoff_switch_current_switch_position_config', 'last_changed': , 'last_reported': , 'last_updated': , 'state': '0', }) # --- -# name: test_sensors[inovelli_vtm30][sensor.white_series_onoff_switch_down-entry] +# name: test_sensors[inovelli_vtm30][sensor.white_series_onoff_switch_current_switch_position_down-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -4580,7 +4580,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': , - 'entity_id': 'sensor.white_series_onoff_switch_down', + 'entity_id': 'sensor.white_series_onoff_switch_current_switch_position_down', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -4592,7 +4592,7 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Down', + 'original_name': 'Current switch position (Down)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -4602,14 +4602,65 @@ 'unit_of_measurement': None, }) # --- -# name: test_sensors[inovelli_vtm30][sensor.white_series_onoff_switch_down-state] +# name: test_sensors[inovelli_vtm30][sensor.white_series_onoff_switch_current_switch_position_down-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'White Series OnOff Switch Down', + 'friendly_name': 'White Series OnOff Switch Current switch position (Down)', 'state_class': , }), 'context': , - 'entity_id': 'sensor.white_series_onoff_switch_down', + 'entity_id': 'sensor.white_series_onoff_switch_current_switch_position_down', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0', + }) +# --- +# name: test_sensors[inovelli_vtm30][sensor.white_series_onoff_switch_current_switch_position_up-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.white_series_onoff_switch_current_switch_position_up', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Current switch position (Up)', + 'platform': 'matter', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'switch_current_position', + 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-3-SwitchCurrentPosition-59-1', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[inovelli_vtm30][sensor.white_series_onoff_switch_current_switch_position_up-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'White Series OnOff Switch Current switch position (Up)', + 'state_class': , + }), + 'context': , + 'entity_id': 'sensor.white_series_onoff_switch_current_switch_position_up', 'last_changed': , 'last_reported': , 'last_updated': , @@ -4843,57 +4894,6 @@ 'state': '21.83', }) # --- -# name: test_sensors[inovelli_vtm30][sensor.white_series_onoff_switch_up-entry] - EntityRegistryEntrySnapshot({ - 'aliases': set({ - }), - 'area_id': None, - 'capabilities': dict({ - 'state_class': , - }), - 'config_entry_id': , - 'config_subentry_id': , - 'device_class': None, - 'device_id': , - 'disabled_by': None, - 'domain': 'sensor', - 'entity_category': , - 'entity_id': 'sensor.white_series_onoff_switch_up', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - 'options': dict({ - }), - 'original_device_class': None, - 'original_icon': None, - 'original_name': 'Up', - 'platform': 'matter', - 'previous_unique_id': None, - 'suggested_object_id': None, - 'supported_features': 0, - 'translation_key': 'switch_current_position', - 'unique_id': '00000000000004D2-0000000000000100-MatterNodeDevice-3-SwitchCurrentPosition-59-1', - 'unit_of_measurement': None, - }) -# --- -# name: test_sensors[inovelli_vtm30][sensor.white_series_onoff_switch_up-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - 'friendly_name': 'White Series OnOff Switch Up', - 'state_class': , - }), - 'context': , - 'entity_id': 'sensor.white_series_onoff_switch_up', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': '0', - }) -# --- # name: test_sensors[inovelli_vtm30][sensor.white_series_onoff_switch_voltage-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -5239,7 +5239,7 @@ 'state': 'stopped', }) # --- -# name: test_sensors[multi_endpoint_light][sensor.inovelli_config-entry] +# name: test_sensors[multi_endpoint_light][sensor.inovelli_current_switch_position_config-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -5254,7 +5254,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': , - 'entity_id': 'sensor.inovelli_config', + 'entity_id': 'sensor.inovelli_current_switch_position_config', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -5266,7 +5266,7 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Config', + 'original_name': 'Current switch position (Config)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -5276,21 +5276,21 @@ 'unit_of_measurement': None, }) # --- -# name: test_sensors[multi_endpoint_light][sensor.inovelli_config-state] +# name: test_sensors[multi_endpoint_light][sensor.inovelli_current_switch_position_config-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Inovelli Config', + 'friendly_name': 'Inovelli Current switch position (Config)', 'state_class': , }), 'context': , - 'entity_id': 'sensor.inovelli_config', + 'entity_id': 'sensor.inovelli_current_switch_position_config', 'last_changed': , 'last_reported': , 'last_updated': , 'state': '0', }) # --- -# name: test_sensors[multi_endpoint_light][sensor.inovelli_down-entry] +# name: test_sensors[multi_endpoint_light][sensor.inovelli_current_switch_position_down-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -5305,7 +5305,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': , - 'entity_id': 'sensor.inovelli_down', + 'entity_id': 'sensor.inovelli_current_switch_position_down', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -5317,7 +5317,7 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Down', + 'original_name': 'Current switch position (Down)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -5327,21 +5327,21 @@ 'unit_of_measurement': None, }) # --- -# name: test_sensors[multi_endpoint_light][sensor.inovelli_down-state] +# name: test_sensors[multi_endpoint_light][sensor.inovelli_current_switch_position_down-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Inovelli Down', + 'friendly_name': 'Inovelli Current switch position (Down)', 'state_class': , }), 'context': , - 'entity_id': 'sensor.inovelli_down', + 'entity_id': 'sensor.inovelli_current_switch_position_down', 'last_changed': , 'last_reported': , 'last_updated': , 'state': '0', }) # --- -# name: test_sensors[multi_endpoint_light][sensor.inovelli_up-entry] +# name: test_sensors[multi_endpoint_light][sensor.inovelli_current_switch_position_up-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -5356,7 +5356,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': , - 'entity_id': 'sensor.inovelli_up', + 'entity_id': 'sensor.inovelli_current_switch_position_up', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -5368,7 +5368,7 @@ }), 'original_device_class': None, 'original_icon': None, - 'original_name': 'Up', + 'original_name': 'Current switch position (Up)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -5378,14 +5378,14 @@ 'unit_of_measurement': None, }) # --- -# name: test_sensors[multi_endpoint_light][sensor.inovelli_up-state] +# name: test_sensors[multi_endpoint_light][sensor.inovelli_current_switch_position_up-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'friendly_name': 'Inovelli Up', + 'friendly_name': 'Inovelli Current switch position (Up)', 'state_class': , }), 'context': , - 'entity_id': 'sensor.inovelli_up', + 'entity_id': 'sensor.inovelli_current_switch_position_up', 'last_changed': , 'last_reported': , 'last_updated': , diff --git a/tests/components/matter/snapshots/test_switch.ambr b/tests/components/matter/snapshots/test_switch.ambr index d11680fa73a03..4fae8c8ac38a1 100644 --- a/tests/components/matter/snapshots/test_switch.ambr +++ b/tests/components/matter/snapshots/test_switch.ambr @@ -291,7 +291,7 @@ 'state': 'off', }) # --- -# name: test_switches[eve_energy_20ecn4101][switch.eve_energy_20ecn4101_switch_1-entry] +# name: test_switches[eve_energy_20ecn4101][switch.eve_energy_20ecn4101_switch_bottom-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -304,7 +304,7 @@ 'disabled_by': None, 'domain': 'switch', 'entity_category': None, - 'entity_id': 'switch.eve_energy_20ecn4101_switch_1', + 'entity_id': 'switch.eve_energy_20ecn4101_switch_bottom', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -316,31 +316,31 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Switch (1)', + 'original_name': 'Switch (bottom)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, 'translation_key': 'switch', - 'unique_id': '00000000000004D2-00000000000000C7-MatterNodeDevice-1-MatterPlug-6-0', + 'unique_id': '00000000000004D2-00000000000000C7-MatterNodeDevice-2-MatterPlug-6-0', 'unit_of_measurement': None, }) # --- -# name: test_switches[eve_energy_20ecn4101][switch.eve_energy_20ecn4101_switch_1-state] +# name: test_switches[eve_energy_20ecn4101][switch.eve_energy_20ecn4101_switch_bottom-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'outlet', - 'friendly_name': 'Eve Energy 20ECN4101 Switch (1)', + 'friendly_name': 'Eve Energy 20ECN4101 Switch (bottom)', }), 'context': , - 'entity_id': 'switch.eve_energy_20ecn4101_switch_1', + 'entity_id': 'switch.eve_energy_20ecn4101_switch_bottom', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'off', + 'state': 'on', }) # --- -# name: test_switches[eve_energy_20ecn4101][switch.eve_energy_20ecn4101_switch_2-entry] +# name: test_switches[eve_energy_20ecn4101][switch.eve_energy_20ecn4101_switch_top-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -353,7 +353,7 @@ 'disabled_by': None, 'domain': 'switch', 'entity_category': None, - 'entity_id': 'switch.eve_energy_20ecn4101_switch_2', + 'entity_id': 'switch.eve_energy_20ecn4101_switch_top', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -365,28 +365,28 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Switch (2)', + 'original_name': 'Switch (top)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, 'translation_key': 'switch', - 'unique_id': '00000000000004D2-00000000000000C7-MatterNodeDevice-2-MatterPlug-6-0', + 'unique_id': '00000000000004D2-00000000000000C7-MatterNodeDevice-1-MatterPlug-6-0', 'unit_of_measurement': None, }) # --- -# name: test_switches[eve_energy_20ecn4101][switch.eve_energy_20ecn4101_switch_2-state] +# name: test_switches[eve_energy_20ecn4101][switch.eve_energy_20ecn4101_switch_top-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'outlet', - 'friendly_name': 'Eve Energy 20ECN4101 Switch (2)', + 'friendly_name': 'Eve Energy 20ECN4101 Switch (top)', }), 'context': , - 'entity_id': 'switch.eve_energy_20ecn4101_switch_2', + 'entity_id': 'switch.eve_energy_20ecn4101_switch_top', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'on', + 'state': 'off', }) # --- # name: test_switches[eve_energy_plug][switch.eve_energy_plug-entry] @@ -535,7 +535,7 @@ 'state': 'off', }) # --- -# name: test_switches[inovelli_vtm30][switch.white_series_onoff_switch_load_control-entry] +# name: test_switches[inovelli_vtm30][switch.white_series_onoff_switch_switch_load_control-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -548,7 +548,7 @@ 'disabled_by': None, 'domain': 'switch', 'entity_category': None, - 'entity_id': 'switch.white_series_onoff_switch_load_control', + 'entity_id': 'switch.white_series_onoff_switch_switch_load_control', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -560,7 +560,7 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Load Control', + 'original_name': 'Switch (Load Control)', 'platform': 'matter', 'previous_unique_id': None, 'suggested_object_id': None, @@ -570,14 +570,14 @@ 'unit_of_measurement': None, }) # --- -# name: test_switches[inovelli_vtm30][switch.white_series_onoff_switch_load_control-state] +# name: test_switches[inovelli_vtm30][switch.white_series_onoff_switch_switch_load_control-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'outlet', - 'friendly_name': 'White Series OnOff Switch Load Control', + 'friendly_name': 'White Series OnOff Switch Switch (Load Control)', }), 'context': , - 'entity_id': 'switch.white_series_onoff_switch_load_control', + 'entity_id': 'switch.white_series_onoff_switch_switch_load_control', 'last_changed': , 'last_reported': , 'last_updated': , diff --git a/tests/components/matter/test_event.py b/tests/components/matter/test_event.py index 8098d4dd6394e..fff5d5ef01cab 100644 --- a/tests/components/matter/test_event.py +++ b/tests/components/matter/test_event.py @@ -84,11 +84,11 @@ async def test_generic_switch_multi_node( "long_release", ] # check button 2 - state_button_2 = hass.states.get("event.mock_generic_switch_fancy_button") + state_button_2 = hass.states.get("event.mock_generic_switch_button_2") assert state_button_2 assert state_button_2.state == "unknown" - # name should be 'DeviceName Fancy Button' due to the label set to 'Fancy Button' - assert state_button_2.name == "Mock Generic Switch Fancy Button" + # name should be 'DeviceName Button (2)' + assert state_button_2.name == "Mock Generic Switch Button (2)" # check event_types from featuremap 30 (0b11110) and MultiPressMax 4 assert state_button_2.attributes[ATTR_EVENT_TYPES] == [ "multi_press_1", diff --git a/tests/components/sma/__init__.py b/tests/components/sma/__init__.py index 61d3f81a9fca6..eebaf43ccd81b 100644 --- a/tests/components/sma/__init__.py +++ b/tests/components/sma/__init__.py @@ -1,5 +1,7 @@ """Tests for the sma integration.""" +from pysma.helpers import DeviceInfo + from homeassistant.components.sma.const import CONF_GROUP from homeassistant.const import ( CONF_HOST, @@ -12,13 +14,14 @@ from tests.common import MockConfigEntry -MOCK_DEVICE = { - "manufacturer": "SMA", - "name": "SMA Device Name", - "type": "Sunny Boy 3.6", - "serial": 123456789, - "sw_version": "1.0.0", -} +MOCK_DEVICE = DeviceInfo( + manufacturer="SMA", + name="SMA Device Name", + type="Sunny Boy 3.6", + serial=123456789, + sw_version="1.0.0", +) + MOCK_USER_INPUT = { CONF_HOST: "1.1.1.1", diff --git a/tests/components/sma/conftest.py b/tests/components/sma/conftest.py index d06cbe0912ebd..a81334b472780 100644 --- a/tests/components/sma/conftest.py +++ b/tests/components/sma/conftest.py @@ -8,7 +8,7 @@ GENERIC_SENSORS, OPTIMIZERS_VIA_INVERTER, ) -from pysma.definitions import sensor_map +from pysma.definitions.webconnect import sensor_map from pysma.sensor import Sensors import pytest @@ -26,8 +26,8 @@ def mock_config_entry(hass: HomeAssistant) -> MockConfigEntry: return MockConfigEntry( domain=DOMAIN, - title=MOCK_DEVICE["name"], - unique_id=str(MOCK_DEVICE["serial"]), + title=MOCK_DEVICE.name, + unique_id=str(MOCK_DEVICE.serial), data=MOCK_USER_INPUT, minor_version=2, entry_id="sma_entry_123", @@ -47,7 +47,7 @@ def mock_setup_entry() -> Generator[AsyncMock]: def mock_sma_client() -> Generator[MagicMock]: """Mock the SMA client.""" with patch( - "homeassistant.components.sma.coordinator.SMA", autospec=True + "homeassistant.components.sma.coordinator.SMAWebConnect", autospec=True ) as sma_cls: sma_instance: MagicMock = sma_cls.return_value sma_instance.device_info = AsyncMock(return_value=MOCK_DEVICE) @@ -80,8 +80,11 @@ async def _async_mock_read(sensors) -> bool: sma_instance.read = AsyncMock(side_effect=_async_mock_read) with ( - patch("homeassistant.components.sma.config_flow.pysma.SMA", new=sma_cls), - patch("homeassistant.components.sma.SMA", new=sma_cls), - patch("pysma.SMA", new=sma_cls), + patch( + "homeassistant.components.sma.config_flow.SMAWebConnect", + new=sma_cls, + ), + patch("homeassistant.components.sma.SMAWebConnect", new=sma_cls), + patch("pysma.SMAWebConnect", new=sma_cls), ): yield sma_instance diff --git a/tests/components/sma/test_config_flow.py b/tests/components/sma/test_config_flow.py index 7bcc2bcfee5e9..f13da7198bcc0 100644 --- a/tests/components/sma/test_config_flow.py +++ b/tests/components/sma/test_config_flow.py @@ -2,11 +2,7 @@ from unittest.mock import AsyncMock, MagicMock, patch -from pysma.exceptions import ( - SmaAuthenticationException, - SmaConnectionException, - SmaReadException, -) +from pysma import SmaAuthenticationException, SmaConnectionException, SmaReadException import pytest from homeassistant.components.sma.const import DOMAIN @@ -91,7 +87,7 @@ async def test_form_exceptions( ) with patch( - "homeassistant.components.sma.config_flow.pysma.SMA.new_session", + "homeassistant.components.sma.config_flow.SMAWebConnect.new_session", side_effect=exception, ): result = await hass.config_entries.flow.async_configure( @@ -211,7 +207,7 @@ async def test_dhcp_exceptions( data=DHCP_DISCOVERY, ) - with patch("homeassistant.components.sma.config_flow.pysma.SMA") as mock_sma: + with patch("homeassistant.components.sma.config_flow.SMAWebConnect") as mock_sma: mock_sma_instance = mock_sma.return_value mock_sma_instance.new_session = AsyncMock(side_effect=exception) @@ -223,7 +219,7 @@ async def test_dhcp_exceptions( assert result["type"] is FlowResultType.FORM assert result["errors"] == {"base": error} - with patch("homeassistant.components.sma.config_flow.pysma.SMA") as mock_sma: + with patch("homeassistant.components.sma.config_flow.SMAWebConnect") as mock_sma: mock_sma_instance = mock_sma.return_value mock_sma_instance.new_session = AsyncMock(return_value=True) mock_sma_instance.device_info = AsyncMock(return_value=MOCK_DEVICE) @@ -291,7 +287,7 @@ async def test_reauth_flow_exceptions( result = await entry.start_reauth_flow(hass) - with patch("homeassistant.components.sma.config_flow.pysma.SMA") as mock_sma: + with patch("homeassistant.components.sma.config_flow.SMAWebConnect") as mock_sma: mock_sma_instance = mock_sma.return_value mock_sma_instance.new_session = AsyncMock(side_effect=exception) result = await hass.config_entries.flow.async_configure( diff --git a/tests/components/sma/test_init.py b/tests/components/sma/test_init.py index 0c20a1acc4340..b9f78f568c651 100644 --- a/tests/components/sma/test_init.py +++ b/tests/components/sma/test_init.py @@ -1,12 +1,9 @@ """Test the sma init file.""" -from collections.abc import AsyncGenerator, Generator +from collections.abc import AsyncGenerator +from unittest.mock import MagicMock -from pysma.exceptions import ( - SmaAuthenticationException, - SmaConnectionException, - SmaReadException, -) +from pysma import SmaAuthenticationException, SmaConnectionException, SmaReadException import pytest from homeassistant.components.sma.const import DOMAIN @@ -26,8 +23,8 @@ async def test_migrate_entry_minor_version_1_2( """Test migrating a 1.1 config entry to 1.2.""" entry = MockConfigEntry( domain=DOMAIN, - title=MOCK_DEVICE["name"], - unique_id=MOCK_DEVICE["serial"], # Not converted to str + title=MOCK_DEVICE.name, + unique_id=MOCK_DEVICE.serial, data=MOCK_USER_INPUT, source=SOURCE_IMPORT, minor_version=1, @@ -36,7 +33,8 @@ async def test_migrate_entry_minor_version_1_2( assert await hass.config_entries.async_setup(entry.entry_id) assert entry.version == 1 assert entry.minor_version == 2 - assert entry.unique_id == str(MOCK_DEVICE["serial"]) + assert isinstance(MOCK_DEVICE.serial, str) + assert entry.unique_id == MOCK_DEVICE.serial @pytest.mark.parametrize( @@ -49,7 +47,7 @@ async def test_migrate_entry_minor_version_1_2( ) async def test_setup_exceptions( hass: HomeAssistant, - mock_sma_client: Generator, + mock_sma_client: MagicMock, mock_config_entry: MockConfigEntry, exception: Exception, expected_state: ConfigEntryState, diff --git a/tests/components/sma/test_sensor.py b/tests/components/sma/test_sensor.py index d289962d79819..991898b222917 100644 --- a/tests/components/sma/test_sensor.py +++ b/tests/components/sma/test_sensor.py @@ -1,14 +1,10 @@ """Test the SMA sensor platform.""" from collections.abc import Generator -from unittest.mock import patch +from unittest.mock import MagicMock, patch from freezegun.api import FrozenDateTimeFactory -from pysma.exceptions import ( - SmaAuthenticationException, - SmaConnectionException, - SmaReadException, -) +from pysma import SmaAuthenticationException, SmaConnectionException, SmaReadException import pytest from syrupy.assertion import SnapshotAssertion @@ -56,7 +52,7 @@ async def test_all_entities( async def test_refresh_exceptions( hass: HomeAssistant, mock_config_entry: MockConfigEntry, - mock_sma_client: Generator, + mock_sma_client: MagicMock, freezer: FrozenDateTimeFactory, exception: Exception, ) -> None: @@ -71,4 +67,5 @@ async def test_refresh_exceptions( await hass.async_block_till_done() state = hass.states.get("sensor.sma_device_name_battery_capacity_a") + assert state assert state.state == STATE_UNAVAILABLE