diff --git a/CODEOWNERS b/CODEOWNERS index 8aed7f44997372..e1ffca9dd65178 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1539,8 +1539,8 @@ build.json @home-assistant/supervisor /tests/components/suez_water/ @ooii @jb101010-2 /homeassistant/components/sun/ @home-assistant/core /tests/components/sun/ @home-assistant/core -/homeassistant/components/sunricher_dali_center/ @niracler -/tests/components/sunricher_dali_center/ @niracler +/homeassistant/components/sunricher_dali/ @niracler +/tests/components/sunricher_dali/ @niracler /homeassistant/components/supla/ @mwegrzynek /homeassistant/components/surepetcare/ @benleb @danielhiversen /tests/components/surepetcare/ @benleb @danielhiversen diff --git a/homeassistant/components/sunricher_dali_center/__init__.py b/homeassistant/components/sunricher_dali/__init__.py similarity index 96% rename from homeassistant/components/sunricher_dali_center/__init__.py rename to homeassistant/components/sunricher_dali/__init__.py index 75b08a16d21dad..4d5840bbe7f519 100644 --- a/homeassistant/components/sunricher_dali_center/__init__.py +++ b/homeassistant/components/sunricher_dali/__init__.py @@ -1,4 +1,4 @@ -"""The DALI Center integration.""" +"""The Sunricher DALI integration.""" from __future__ import annotations @@ -28,7 +28,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: DaliCenterConfigEntry) -> bool: - """Set up DALI Center from a config entry.""" + """Set up Sunricher DALI from a config entry.""" gateway = DaliGateway( entry.data[CONF_SERIAL_NUMBER], diff --git a/homeassistant/components/sunricher_dali_center/config_flow.py b/homeassistant/components/sunricher_dali/config_flow.py similarity index 97% rename from homeassistant/components/sunricher_dali_center/config_flow.py rename to homeassistant/components/sunricher_dali/config_flow.py index 84b1c692920495..27321fa9a1fc3c 100644 --- a/homeassistant/components/sunricher_dali_center/config_flow.py +++ b/homeassistant/components/sunricher_dali/config_flow.py @@ -1,4 +1,4 @@ -"""Config flow for the DALI Center integration.""" +"""Config flow for the Sunricher DALI integration.""" from __future__ import annotations @@ -30,7 +30,7 @@ class DaliCenterConfigFlow(ConfigFlow, domain=DOMAIN): - """Handle a config flow for DALI Center.""" + """Handle a config flow for Sunricher DALI.""" VERSION = 1 diff --git a/homeassistant/components/sunricher_dali/const.py b/homeassistant/components/sunricher_dali/const.py new file mode 100644 index 00000000000000..917153a6065f6c --- /dev/null +++ b/homeassistant/components/sunricher_dali/const.py @@ -0,0 +1,5 @@ +"""Constants for the Sunricher DALI integration.""" + +DOMAIN = "sunricher_dali" +MANUFACTURER = "Sunricher" +CONF_SERIAL_NUMBER = "serial_number" diff --git a/homeassistant/components/sunricher_dali_center/light.py b/homeassistant/components/sunricher_dali/light.py similarity index 98% rename from homeassistant/components/sunricher_dali_center/light.py rename to homeassistant/components/sunricher_dali/light.py index a73422ca33492b..2506349389ac04 100644 --- a/homeassistant/components/sunricher_dali_center/light.py +++ b/homeassistant/components/sunricher_dali/light.py @@ -38,7 +38,7 @@ async def async_setup_entry( entry: DaliCenterConfigEntry, async_add_entities: AddConfigEntryEntitiesCallback, ) -> None: - """Set up DALI Center light entities from config entry.""" + """Set up Sunricher DALI light entities from config entry.""" runtime_data = entry.runtime_data gateway = runtime_data.gateway devices = runtime_data.devices @@ -57,7 +57,7 @@ def _on_light_status(dev_id: str, status: LightStatus) -> None: class DaliCenterLight(LightEntity): - """Representation of a DALI Center Light.""" + """Representation of a Sunricher DALI Light.""" _attr_has_entity_name = True _attr_name = None diff --git a/homeassistant/components/sunricher_dali_center/manifest.json b/homeassistant/components/sunricher_dali/manifest.json similarity index 72% rename from homeassistant/components/sunricher_dali_center/manifest.json rename to homeassistant/components/sunricher_dali/manifest.json index 1f68d484f7811e..72e17912115e4f 100644 --- a/homeassistant/components/sunricher_dali_center/manifest.json +++ b/homeassistant/components/sunricher_dali/manifest.json @@ -1,9 +1,9 @@ { - "domain": "sunricher_dali_center", - "name": "DALI Center", + "domain": "sunricher_dali", + "name": "Sunricher DALI", "codeowners": ["@niracler"], "config_flow": true, - "documentation": "https://www.home-assistant.io/integrations/sunricher_dali_center", + "documentation": "https://www.home-assistant.io/integrations/sunricher_dali", "iot_class": "local_push", "quality_scale": "bronze", "requirements": ["PySrDaliGateway==0.13.1"] diff --git a/homeassistant/components/sunricher_dali_center/quality_scale.yaml b/homeassistant/components/sunricher_dali/quality_scale.yaml similarity index 100% rename from homeassistant/components/sunricher_dali_center/quality_scale.yaml rename to homeassistant/components/sunricher_dali/quality_scale.yaml diff --git a/homeassistant/components/sunricher_dali_center/strings.json b/homeassistant/components/sunricher_dali/strings.json similarity index 64% rename from homeassistant/components/sunricher_dali_center/strings.json rename to homeassistant/components/sunricher_dali/strings.json index ed2c9dc6d62e96..aec4f1d493f868 100644 --- a/homeassistant/components/sunricher_dali_center/strings.json +++ b/homeassistant/components/sunricher_dali/strings.json @@ -5,8 +5,8 @@ }, "error": { "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]", - "discovery_failed": "Failed to discover DALI gateways on the network", - "no_devices_found": "No DALI gateways found on the network", + "discovery_failed": "Failed to discover Sunricher DALI gateways on the network", + "no_devices_found": "No Sunricher DALI gateways found on the network", "unknown": "[%key:common::config_flow::error::unknown%]" }, "step": { @@ -17,12 +17,10 @@ "data_description": { "selected_gateway": "Each option shows the gateway name, serial number, and IP address." }, - "description": "Select the gateway to configure.", - "title": "Select DALI gateway" + "description": "Select the gateway to configure." }, "user": { - "description": "**Three-step process:**\n\n1. Ensure the gateway is powered and on the same network.\n2. Select **Submit** to start discovery (searches for up to 3 minutes)\n3. While discovery is in progress, press the **Reset** button on your DALI gateway device **once**.\n\nThe gateway will respond immediately after the button press.", - "title": "Set up DALI Center gateway" + "description": "**Three-step process:**\n\n1. Ensure the gateway is powered and on the same network.\n2. Select **Submit** to start discovery (searches for up to 3 minutes)\n3. While discovery is in progress, press the **Reset** button on your Sunricher DALI gateway device **once**.\n\nThe gateway will respond immediately after the button press." } } } diff --git a/homeassistant/components/sunricher_dali_center/types.py b/homeassistant/components/sunricher_dali/types.py similarity index 70% rename from homeassistant/components/sunricher_dali_center/types.py rename to homeassistant/components/sunricher_dali/types.py index 8307360f62cae0..39dacb69a6cb54 100644 --- a/homeassistant/components/sunricher_dali_center/types.py +++ b/homeassistant/components/sunricher_dali/types.py @@ -1,4 +1,4 @@ -"""Type definitions for the DALI Center integration.""" +"""Type definitions for the Sunricher DALI integration.""" from dataclasses import dataclass @@ -9,7 +9,7 @@ @dataclass class DaliCenterData: - """Runtime data for the DALI Center integration.""" + """Runtime data for the Sunricher DALI integration.""" gateway: DaliGateway devices: list[Device] diff --git a/homeassistant/components/sunricher_dali_center/const.py b/homeassistant/components/sunricher_dali_center/const.py deleted file mode 100644 index 7e78b441d52863..00000000000000 --- a/homeassistant/components/sunricher_dali_center/const.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Constants for the DALI Center integration.""" - -DOMAIN = "sunricher_dali_center" -MANUFACTURER = "Sunricher" -CONF_SERIAL_NUMBER = "serial_number" diff --git a/homeassistant/generated/config_flows.py b/homeassistant/generated/config_flows.py index 69d20208f54af6..9c478ee8e7e2ce 100644 --- a/homeassistant/generated/config_flows.py +++ b/homeassistant/generated/config_flows.py @@ -640,7 +640,7 @@ "subaru", "suez_water", "sun", - "sunricher_dali_center", + "sunricher_dali", "sunweg", "surepetcare", "swiss_public_transport", diff --git a/homeassistant/generated/integrations.json b/homeassistant/generated/integrations.json index f3efe0ce0afb30..128c125ab5d502 100644 --- a/homeassistant/generated/integrations.json +++ b/homeassistant/generated/integrations.json @@ -6412,8 +6412,8 @@ "iot_class": "calculated", "single_config_entry": true }, - "sunricher_dali_center": { - "name": "DALI Center", + "sunricher_dali": { + "name": "Sunricher DALI", "integration_type": "hub", "config_flow": true, "iot_class": "local_push" diff --git a/requirements_all.txt b/requirements_all.txt index 545d7ec916ed29..6129cfb2749969 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -79,7 +79,7 @@ PyQRCode==1.2.1 # homeassistant.components.rmvtransport PyRMVtransport==0.3.3 -# homeassistant.components.sunricher_dali_center +# homeassistant.components.sunricher_dali PySrDaliGateway==0.13.1 # homeassistant.components.switchbot diff --git a/requirements_test_all.txt b/requirements_test_all.txt index ece7b3817b602b..b35aa4ec2b586e 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -76,7 +76,7 @@ PyQRCode==1.2.1 # homeassistant.components.rmvtransport PyRMVtransport==0.3.3 -# homeassistant.components.sunricher_dali_center +# homeassistant.components.sunricher_dali PySrDaliGateway==0.13.1 # homeassistant.components.switchbot diff --git a/tests/components/sunricher_dali/__init__.py b/tests/components/sunricher_dali/__init__.py new file mode 100644 index 00000000000000..8cb99013614eaa --- /dev/null +++ b/tests/components/sunricher_dali/__init__.py @@ -0,0 +1 @@ +"""Tests for the Sunricher Sunricher DALI integration.""" diff --git a/tests/components/sunricher_dali_center/conftest.py b/tests/components/sunricher_dali/conftest.py similarity index 88% rename from tests/components/sunricher_dali_center/conftest.py rename to tests/components/sunricher_dali/conftest.py index b533a5e8ded885..85609629c2b6e4 100644 --- a/tests/components/sunricher_dali_center/conftest.py +++ b/tests/components/sunricher_dali/conftest.py @@ -1,14 +1,11 @@ -"""Common fixtures for the Dali Center tests.""" +"""Common fixtures for the Sunricher DALI tests.""" from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch import pytest -from homeassistant.components.sunricher_dali_center.const import ( - CONF_SERIAL_NUMBER, - DOMAIN, -) +from homeassistant.components.sunricher_dali.const import CONF_SERIAL_NUMBER, DOMAIN from homeassistant.const import ( CONF_HOST, CONF_NAME, @@ -108,7 +105,7 @@ def mock_devices() -> list[MagicMock]: def mock_discovery(mock_gateway: MagicMock) -> Generator[MagicMock]: """Mock DaliGatewayDiscovery.""" with patch( - "homeassistant.components.sunricher_dali_center.config_flow.DaliGatewayDiscovery" + "homeassistant.components.sunricher_dali.config_flow.DaliGatewayDiscovery" ) as mock_discovery_class: mock_discovery = mock_discovery_class.return_value mock_discovery.discover_gateways = AsyncMock(return_value=[mock_gateway]) @@ -120,10 +117,10 @@ def mock_gateway(mock_devices: list[MagicMock]) -> Generator[MagicMock]: """Return a mocked DaliGateway.""" with ( patch( - "homeassistant.components.sunricher_dali_center.DaliGateway", autospec=True + "homeassistant.components.sunricher_dali.DaliGateway", autospec=True ) as mock_gateway_class, patch( - "homeassistant.components.sunricher_dali_center.config_flow.DaliGateway", + "homeassistant.components.sunricher_dali.config_flow.DaliGateway", new=mock_gateway_class, ), ): @@ -144,7 +141,7 @@ def mock_gateway(mock_devices: list[MagicMock]) -> Generator[MagicMock]: def mock_setup_entry() -> Generator[AsyncMock]: """Override async_setup_entry.""" with patch( - "homeassistant.components.sunricher_dali_center.async_setup_entry", + "homeassistant.components.sunricher_dali.async_setup_entry", return_value=True, ) as mock_setup_entry: yield mock_setup_entry diff --git a/tests/components/sunricher_dali_center/snapshots/test_light.ambr b/tests/components/sunricher_dali/snapshots/test_light.ambr similarity index 97% rename from tests/components/sunricher_dali_center/snapshots/test_light.ambr rename to tests/components/sunricher_dali/snapshots/test_light.ambr index 75ee3145121644..0f95b2fc7502e6 100644 --- a/tests/components/sunricher_dali_center/snapshots/test_light.ambr +++ b/tests/components/sunricher_dali/snapshots/test_light.ambr @@ -33,7 +33,7 @@ 'original_device_class': None, 'original_icon': None, 'original_name': None, - 'platform': 'sunricher_dali_center', + 'platform': 'sunricher_dali', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, @@ -100,7 +100,7 @@ 'original_device_class': None, 'original_icon': None, 'original_name': None, - 'platform': 'sunricher_dali_center', + 'platform': 'sunricher_dali', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, @@ -158,7 +158,7 @@ 'original_device_class': None, 'original_icon': None, 'original_name': None, - 'platform': 'sunricher_dali_center', + 'platform': 'sunricher_dali', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, @@ -219,7 +219,7 @@ 'original_device_class': None, 'original_icon': None, 'original_name': None, - 'platform': 'sunricher_dali_center', + 'platform': 'sunricher_dali', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, diff --git a/tests/components/sunricher_dali_center/test_config_flow.py b/tests/components/sunricher_dali/test_config_flow.py similarity index 98% rename from tests/components/sunricher_dali_center/test_config_flow.py rename to tests/components/sunricher_dali/test_config_flow.py index dbad0c11f5ef15..dc1a2ce73fcf42 100644 --- a/tests/components/sunricher_dali_center/test_config_flow.py +++ b/tests/components/sunricher_dali/test_config_flow.py @@ -1,13 +1,10 @@ -"""Test the DALI Center config flow.""" +"""Test the Sunricher DALI config flow.""" from unittest.mock import AsyncMock, MagicMock from PySrDaliGateway.exceptions import DaliGatewayError -from homeassistant.components.sunricher_dali_center.const import ( - CONF_SERIAL_NUMBER, - DOMAIN, -) +from homeassistant.components.sunricher_dali.const import CONF_SERIAL_NUMBER, DOMAIN from homeassistant.config_entries import SOURCE_USER from homeassistant.const import ( CONF_HOST, diff --git a/tests/components/sunricher_dali_center/test_init.py b/tests/components/sunricher_dali/test_init.py similarity index 96% rename from tests/components/sunricher_dali_center/test_init.py rename to tests/components/sunricher_dali/test_init.py index 20ff81ce059053..e1ea225f89a3d2 100644 --- a/tests/components/sunricher_dali_center/test_init.py +++ b/tests/components/sunricher_dali/test_init.py @@ -1,4 +1,4 @@ -"""Test the Dali Center integration initialization.""" +"""Test the Sunricher DALI integration initialization.""" from unittest.mock import MagicMock diff --git a/tests/components/sunricher_dali_center/test_light.py b/tests/components/sunricher_dali/test_light.py similarity index 97% rename from tests/components/sunricher_dali_center/test_light.py rename to tests/components/sunricher_dali/test_light.py index 999c3f8d6df53b..5a522bf3b2c231 100644 --- a/tests/components/sunricher_dali_center/test_light.py +++ b/tests/components/sunricher_dali/test_light.py @@ -1,4 +1,4 @@ -"""Test the Dali Center light platform.""" +"""Test the Sunricher DALI light platform.""" from typing import Any from unittest.mock import MagicMock, patch @@ -50,7 +50,7 @@ async def init_integration( """Set up the integration for testing.""" mock_config_entry.add_to_hass(hass) - with patch("homeassistant.components.sunricher_dali_center._PLATFORMS", platforms): + with patch("homeassistant.components.sunricher_dali._PLATFORMS", platforms): await hass.config_entries.async_setup(mock_config_entry.entry_id) await hass.async_block_till_done() diff --git a/tests/components/sunricher_dali_center/__init__.py b/tests/components/sunricher_dali_center/__init__.py deleted file mode 100644 index 5ff4c7ca609a53..00000000000000 --- a/tests/components/sunricher_dali_center/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests for the Sunricher DALI Center integration."""