Rename DALI Center to Sunricher DALI (#155865)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Paulus Schoutsen
2025-11-05 13:15:07 -05:00
committed by Franck Nijhof
parent b7696bfb20
commit 396a987035
21 changed files with 43 additions and 51 deletions

4
CODEOWNERS generated
View File

@@ -1543,8 +1543,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

View File

@@ -1,4 +1,4 @@
"""The DALI Center integration."""
"""The Sunricher DALI integration."""
from __future__ import annotations
@@ -28,7 +28,7 @@ _LOGGER = logging.getLogger(__name__)
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],

View File

@@ -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 @@ _LOGGER = logging.getLogger(__name__)
class DaliCenterConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle a config flow for DALI Center."""
"""Handle a config flow for Sunricher DALI."""
VERSION = 1

View File

@@ -0,0 +1,5 @@
"""Constants for the Sunricher DALI integration."""
DOMAIN = "sunricher_dali"
MANUFACTURER = "Sunricher"
CONF_SERIAL_NUMBER = "serial_number"

View File

@@ -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 @@ async def async_setup_entry(
class DaliCenterLight(LightEntity):
"""Representation of a DALI Center Light."""
"""Representation of a Sunricher DALI Light."""
_attr_has_entity_name = True
_attr_name = None

View File

@@ -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"]

View File

@@ -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."
}
}
}

View File

@@ -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 @@ from homeassistant.config_entries import ConfigEntry
@dataclass
class DaliCenterData:
"""Runtime data for the DALI Center integration."""
"""Runtime data for the Sunricher DALI integration."""
gateway: DaliGateway
devices: list[Device]

View File

@@ -1,5 +0,0 @@
"""Constants for the DALI Center integration."""
DOMAIN = "sunricher_dali_center"
MANUFACTURER = "Sunricher"
CONF_SERIAL_NUMBER = "serial_number"

View File

@@ -641,7 +641,7 @@ FLOWS = {
"subaru",
"suez_water",
"sun",
"sunricher_dali_center",
"sunricher_dali",
"sunweg",
"surepetcare",
"swiss_public_transport",

View File

@@ -6484,8 +6484,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"

2
requirements_all.txt generated
View File

@@ -83,7 +83,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

View File

@@ -80,7 +80,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

View File

@@ -0,0 +1 @@
"""Tests for the Sunricher Sunricher DALI integration."""

View File

@@ -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

View File

@@ -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,

View File

@@ -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,

View File

@@ -1,4 +1,4 @@
"""Test the Dali Center integration initialization."""
"""Test the Sunricher DALI integration initialization."""
from unittest.mock import MagicMock

View File

@@ -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()

View File

@@ -1 +0,0 @@
"""Tests for the Sunricher DALI Center integration."""