Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CODEOWNERS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""The DALI Center integration."""
"""The Sunricher DALI integration."""

from __future__ import annotations

Expand Down Expand Up @@ -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],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Config flow for the DALI Center integration."""
"""Config flow for the Sunricher DALI integration."""

from __future__ import annotations

Expand Down Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions homeassistant/components/sunricher_dali/const.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Constants for the Sunricher DALI integration."""

DOMAIN = "sunricher_dali"
Comment thread
frenck marked this conversation as resolved.
MANUFACTURER = "Sunricher"
CONF_SERIAL_NUMBER = "serial_number"
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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."
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Type definitions for the DALI Center integration."""
"""Type definitions for the Sunricher DALI integration."""

from dataclasses import dataclass

Expand All @@ -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]
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/sunricher_dali_center/const.py

This file was deleted.

2 changes: 1 addition & 1 deletion homeassistant/generated/config_flows.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions homeassistant/generated/integrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion requirements_test_all.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/components/sunricher_dali/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests for the Sunricher Sunricher DALI integration."""
Comment thread
frenck marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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])
Expand All @@ -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,
),
):
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Test the Dali Center integration initialization."""
"""Test the Sunricher DALI integration initialization."""

from unittest.mock import MagicMock

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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()

Expand Down
1 change: 0 additions & 1 deletion tests/components/sunricher_dali_center/__init__.py

This file was deleted.

Loading