diff --git a/custom_components/powercalc/__init__.py b/custom_components/powercalc/__init__.py index acbf72a0d..374cbed97 100644 --- a/custom_components/powercalc/__init__.py +++ b/custom_components/powercalc/__init__.py @@ -3,6 +3,7 @@ from __future__ import annotations import logging +import re from typing import Optional import homeassistant.helpers.config_validation as cv @@ -336,6 +337,7 @@ async def start_discovery(self): if ( model_info.manufacturer == MANUFACTURER_WLED and entity_entry.domain == LIGHT_DOMAIN + and not re.search("master|segment", str(entity_entry.original_name), flags=re.IGNORECASE) ): self._init_entity_discovery( source_entity, diff --git a/tests/strategy/test_wled.py b/tests/strategy/test_wled.py index 61a9d3681..bbd2eb97e 100644 --- a/tests/strategy/test_wled.py +++ b/tests/strategy/test_wled.py @@ -136,6 +136,20 @@ async def test_wled_autodiscovery_flow(hass: HomeAssistant): platform="light", device_id="wled-device", ), + "light.test_master": RegistryEntry( + entity_id="light.test_master", + unique_id="1234-master", + platform="light", + original_name="Master", + device_id="wled-device", + ), + "light.test_segment1": RegistryEntry( + entity_id="light.test_segment1", + unique_id="1234-segment", + platform="light", + original_name="WLED Segment1", + device_id="wled-device", + ), "sensor.test_current": RegistryEntry( entity_id="sensor.test_current", unique_id="1234",