22
33from __future__ import annotations
44
5+ from dataclasses import dataclass
56from typing import Any
67
78from chip .clusters import Objects as clusters
2930from homeassistant .util import color as color_util
3031
3132from .const import LOGGER
32- from .entity import MatterEntity
33+ from .entity import MatterEntity , MatterEntityDescription
3334from .helpers import get_matter
3435from .models import MatterDiscoverySchema
3536from .util import (
@@ -85,10 +86,15 @@ async def async_setup_entry(
8586 matter .register_platform_handler (Platform .LIGHT , async_add_entities )
8687
8788
89+ @dataclass (frozen = True )
90+ class MatterLightEntityDescription (LightEntityDescription , MatterEntityDescription ):
91+ """Describe Matter Light entities."""
92+ 93+ 8894class MatterLight (MatterEntity , LightEntity ):
8995 """Representation of a Matter light."""
9096
91- entity_description : LightEntityDescription
97+ entity_description : MatterLightEntityDescription
9298 _supports_brightness = False
9399 _supports_color = False
94100 _supports_color_temperature = False
@@ -458,7 +464,7 @@ def _check_transition_blocklist(self) -> None:
458464DISCOVERY_SCHEMAS = [
459465 MatterDiscoverySchema (
460466 platform = Platform .LIGHT ,
461- entity_description = LightEntityDescription (
467+ entity_description = MatterLightEntityDescription (
462468 key = "MatterLight" ,
463469 name = None ,
464470 ),
@@ -487,7 +493,7 @@ def _check_transition_blocklist(self) -> None:
487493 # Additional schema to match (HS Color) lights with incorrect/missing device type
488494 MatterDiscoverySchema (
489495 platform = Platform .LIGHT ,
490- entity_description = LightEntityDescription (
496+ entity_description = MatterLightEntityDescription (
491497 key = "MatterHSColorLightFallback" ,
492498 name = None ,
493499 ),
@@ -508,7 +514,7 @@ def _check_transition_blocklist(self) -> None:
508514 # Additional schema to match (XY Color) lights with incorrect/missing device type
509515 MatterDiscoverySchema (
510516 platform = Platform .LIGHT ,
511- entity_description = LightEntityDescription (
517+ entity_description = MatterLightEntityDescription (
512518 key = "MatterXYColorLightFallback" ,
513519 name = None ,
514520 ),
@@ -529,7 +535,7 @@ def _check_transition_blocklist(self) -> None:
529535 # Additional schema to match (color temperature) lights with incorrect/missing device type
530536 MatterDiscoverySchema (
531537 platform = Platform .LIGHT ,
532- entity_description = LightEntityDescription (
538+ entity_description = MatterLightEntityDescription (
533539 key = "MatterColorTemperatureLightFallback" ,
534540 name = None ,
535541 ),
0 commit comments