diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ff090685f0c..159f92fb02b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: hooks: - id: codespell args: - - --ignore-words-list=additionals,alle,alot,ba,bre,bund,datas,dof,dur,ether,farenheit,falsy,fo,haa,hass,hist,iam,iff,iif,incomfort,ines,ist,lightsensor,mut,nam,nd,pres,pullrequests,referer,resset,rime,ser,serie,sur,te,technik,ue,uint,unsecure,visability,wan,wanna,withing,zar + - --ignore-words-list=additionals,alle,alot,ba,bre,bund,currenty,datas,dof,dur,ether,farenheit,falsy,fo,haa,hass,hist,iam,iff,iif,incomfort,ines,ist,lightsensor,mut,nam,nd,pres,pullrequests,referer,resset,rime,ser,serie,sur,te,technik,ue,uint,unsecure,visability,wan,wanna,withing,zar - --skip="./.*,*.csv,*.json" - --quiet-level=2 exclude_types: [csv, json] diff --git a/homeassistant/components/matter/light.py b/homeassistant/components/matter/light.py index 0136b74f32e..93d20a2de88 100644 --- a/homeassistant/components/matter/light.py +++ b/homeassistant/components/matter/light.py @@ -2,6 +2,7 @@ from __future__ import annotations from dataclasses import dataclass +from enum import Enum from functools import partial from typing import Any @@ -10,6 +11,9 @@ from matter_server.common.models import device_types from homeassistant.components.light import ( ATTR_BRIGHTNESS, + ATTR_COLOR_TEMP, + ATTR_HS_COLOR, + ATTR_XY_COLOR, ColorMode, LightEntity, LightEntityDescription, @@ -19,9 +23,41 @@ from homeassistant.const import Platform from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity_platform import AddEntitiesCallback +from .const import LOGGER from .entity import MatterEntity, MatterEntityDescriptionBaseClass from .helpers import get_matter -from .util import renormalize +from .util import ( + convert_to_hass_hs, + convert_to_hass_xy, + convert_to_matter_hs, + convert_to_matter_xy, + renormalize, +) + + +class MatterColorMode(Enum): + """Matter color mode.""" + + HS = 0 + XY = 1 + COLOR_TEMP = 2 + + +COLOR_MODE_MAP = { + MatterColorMode.HS: ColorMode.HS, + MatterColorMode.XY: ColorMode.XY, + MatterColorMode.COLOR_TEMP: ColorMode.COLOR_TEMP, +} + + +class MatterColorControlFeatures(Enum): + """Matter color control features.""" + + HS = 0 # Hue and saturation (Optional if device is color capable) + EHUE = 1 # Enhanced hue and saturation (Optional if device is color capable) + COLOR_LOOP = 2 # Color loop (Optional if device is color capable) + XY = 3 # XY (Mandatory if device is color capable) + COLOR_TEMP = 4 # Color temperature (Mandatory if device is color capable) async def async_setup_entry( @@ -39,79 +75,305 @@ class MatterLight(MatterEntity, LightEntity): entity_description: MatterLightEntityDescription + def _supports_feature( + self, feature_map: int, feature: MatterColorControlFeatures + ) -> bool: + """Return if device supports given feature.""" + + return (feature_map & (1 << feature.value)) != 0 + + def _supports_color_mode(self, color_feature: MatterColorControlFeatures) -> bool: + """Return if device supports given color mode.""" + + feature_map = self._device_type_instance.node.get_attribute( + self._device_type_instance.endpoint, + clusters.ColorControl, + clusters.ColorControl.Attributes.FeatureMap, + ) + + assert isinstance(feature_map.value, int) + + return self._supports_feature(feature_map.value, color_feature) + + def _supports_hs_color(self) -> bool: + """Return if device supports hs color.""" + + return self._supports_color_mode(MatterColorControlFeatures.HS) + + def _supports_xy_color(self) -> bool: + """Return if device supports xy color.""" + + return self._supports_color_mode(MatterColorControlFeatures.XY) + + def _supports_color_temperature(self) -> bool: + """Return if device supports color temperature.""" + + return self._supports_color_mode(MatterColorControlFeatures.COLOR_TEMP) + def _supports_brightness(self) -> bool: """Return if device supports brightness.""" + return ( clusters.LevelControl.Attributes.CurrentLevel in self.entity_description.subscribe_attributes ) - async def async_turn_on(self, **kwargs: Any) -> None: - """Turn light on.""" - if ATTR_BRIGHTNESS not in kwargs or not self._supports_brightness(): - await self.matter_client.send_device_command( - node_id=self._device_type_instance.node.node_id, - endpoint=self._device_type_instance.endpoint, - command=clusters.OnOff.Commands.On(), - ) - return + def _supports_color(self) -> bool: + """Return if device supports color.""" + return ( + clusters.ColorControl.Attributes.ColorMode + in self.entity_description.subscribe_attributes + ) + + async def _set_xy_color(self, xy_color: tuple[float, float]) -> None: + """Set xy color.""" + + matter_xy = convert_to_matter_xy(xy_color) + + LOGGER.debug("Setting xy color to %s", matter_xy) + await self.send_device_command( + clusters.ColorControl.Commands.MoveToColor( + colorX=int(matter_xy[0]), + colorY=int(matter_xy[1]), + # It's required in TLV. We don't implement transition time yet. + transitionTime=0, + ) + ) + + async def _set_hs_color(self, hs_color: tuple[float, float]) -> None: + """Set hs color.""" + + matter_hs = convert_to_matter_hs(hs_color) + + LOGGER.debug("Setting hs color to %s", matter_hs) + await self.send_device_command( + clusters.ColorControl.Commands.MoveToHueAndSaturation( + hue=int(matter_hs[0]), + saturation=int(matter_hs[1]), + # It's required in TLV. We don't implement transition time yet. + transitionTime=0, + ) + ) + + async def _set_color_temp(self, color_temp: int) -> None: + """Set color temperature.""" + + LOGGER.debug("Setting color temperature to %s", color_temp) + await self.send_device_command( + clusters.ColorControl.Commands.MoveToColorTemperature( + colorTemperature=color_temp, + # It's required in TLV. We don't implement transition time yet. + transitionTime=0, + ) + ) + + async def _set_brightness(self, brightness: int) -> None: + """Set brightness.""" + + LOGGER.debug("Setting brightness to %s", brightness) level_control = self._device_type_instance.get_cluster(clusters.LevelControl) - # We check above that the device supports brightness, ie level control. + assert level_control is not None level = round( renormalize( - kwargs[ATTR_BRIGHTNESS], + brightness, (0, 255), (level_control.minLevel, level_control.maxLevel), ) ) - await self.matter_client.send_device_command( - node_id=self._device_type_instance.node.node_id, - endpoint=self._device_type_instance.endpoint, - command=clusters.LevelControl.Commands.MoveToLevelWithOnOff( + await self.send_device_command( + clusters.LevelControl.Commands.MoveToLevelWithOnOff( level=level, # It's required in TLV. We don't implement transition time yet. transitionTime=0, - ), + ) + ) + + def _get_xy_color(self) -> tuple[float, float]: + """Get xy color from matter.""" + + x_color = self.get_matter_attribute(clusters.ColorControl.Attributes.CurrentX) + y_color = self.get_matter_attribute(clusters.ColorControl.Attributes.CurrentY) + + assert x_color is not None + assert y_color is not None + + xy_color = convert_to_hass_xy((x_color.value, y_color.value)) + LOGGER.debug( + "Got xy color %s for %s", + xy_color, + self._device_type_instance, + ) + + return xy_color + + def _get_hs_color(self) -> tuple[float, float]: + """Get hs color from matter.""" + + hue = self.get_matter_attribute(clusters.ColorControl.Attributes.CurrentHue) + + saturation = self.get_matter_attribute( + clusters.ColorControl.Attributes.CurrentSaturation + ) + + assert hue is not None + assert saturation is not None + + hs_color = convert_to_hass_hs((hue.value, saturation.value)) + + LOGGER.debug( + "Got hs color %s for %s", + hs_color, + self._device_type_instance, + ) + + return hs_color + + def _get_color_temperature(self) -> int: + """Get color temperature from matter.""" + + color_temp = self.get_matter_attribute( + clusters.ColorControl.Attributes.ColorTemperatureMireds + ) + + assert color_temp is not None + + LOGGER.debug( + "Got color temperature %s for %s", + color_temp.value, + self._device_type_instance, + ) + + return int(color_temp.value) + + def _get_brightness(self) -> int: + """Get brightness from matter.""" + + level_control = self._device_type_instance.get_cluster(clusters.LevelControl) + + # We should not get here if brightness is not supported. + assert level_control is not None + + LOGGER.debug( + "Got brightness %s for %s", + level_control.currentLevel, + self._device_type_instance, + ) + + return round( + renormalize( + level_control.currentLevel, + (level_control.minLevel, level_control.maxLevel), + (0, 255), + ) + ) + + def _get_color_mode(self) -> ColorMode: + """Get color mode from matter.""" + + color_mode = self.get_matter_attribute( + clusters.ColorControl.Attributes.ColorMode + ) + + assert color_mode is not None + + ha_color_mode = COLOR_MODE_MAP[MatterColorMode(color_mode.value)] + + LOGGER.debug( + "Got color mode (%s) for %s", ha_color_mode, self._device_type_instance + ) + + return ha_color_mode + + async def send_device_command(self, command: Any) -> None: + """Send device command.""" + await self.matter_client.send_device_command( + node_id=self._device_type_instance.node.node_id, + endpoint=self._device_type_instance.endpoint, + command=command, + ) + + async def async_turn_on(self, **kwargs: Any) -> None: + """Turn light on.""" + + hs_color = kwargs.get(ATTR_HS_COLOR) + xy_color = kwargs.get(ATTR_XY_COLOR) + color_temp = kwargs.get(ATTR_COLOR_TEMP) + brightness = kwargs.get(ATTR_BRIGHTNESS) + + if self._supports_color(): + if hs_color is not None and self._supports_hs_color(): + await self._set_hs_color(hs_color) + elif xy_color is not None and self._supports_xy_color(): + await self._set_xy_color(xy_color) + elif color_temp is not None and self._supports_color_temperature(): + await self._set_color_temp(color_temp) + + if brightness is not None and self._supports_brightness(): + await self._set_brightness(brightness) + return + + await self.send_device_command( + clusters.OnOff.Commands.On(), ) async def async_turn_off(self, **kwargs: Any) -> None: """Turn light off.""" - await self.matter_client.send_device_command( - node_id=self._device_type_instance.node.node_id, - endpoint=self._device_type_instance.endpoint, - command=clusters.OnOff.Commands.Off(), + await self.send_device_command( + clusters.OnOff.Commands.Off(), ) @callback def _update_from_device(self) -> None: """Update from device.""" - supports_brigthness = self._supports_brightness() - if self._attr_supported_color_modes is None and supports_brigthness: - self._attr_supported_color_modes = {ColorMode.BRIGHTNESS} + supports_color = self._supports_color() + supports_color_temperature = ( + self._supports_color_temperature() if supports_color else False + ) + supports_brightness = self._supports_brightness() + + if self._attr_supported_color_modes is None: + supported_color_modes = set() + if supports_color: + supported_color_modes.add(ColorMode.XY) + if self._supports_hs_color(): + supported_color_modes.add(ColorMode.HS) + + if supports_color_temperature: + supported_color_modes.add(ColorMode.COLOR_TEMP) + + if supports_brightness: + supported_color_modes.add(ColorMode.BRIGHTNESS) + + self._attr_supported_color_modes = ( + supported_color_modes if supported_color_modes else None + ) + + LOGGER.debug( + "Supported color modes: %s for %s", + self._attr_supported_color_modes, + self._device_type_instance, + ) + + if supports_color: + self._attr_color_mode = self._get_color_mode() + if self._attr_color_mode == ColorMode.HS: + self._attr_hs_color = self._get_hs_color() + else: + self._attr_xy_color = self._get_xy_color() + + if supports_color_temperature: + self._attr_color_temp = self._get_color_temperature() if attr := self.get_matter_attribute(clusters.OnOff.Attributes.OnOff): self._attr_is_on = attr.value - if supports_brigthness: - level_control = self._device_type_instance.get_cluster( - clusters.LevelControl - ) - # We check above that the device supports brightness, ie level control. - assert level_control is not None - - # Convert brightness to Home Assistant = 0..255 - self._attr_brightness = round( - renormalize( - level_control.currentLevel, - (level_control.minLevel, level_control.maxLevel), - (0, 255), - ) - ) + if supports_brightness: + self._attr_brightness = self._get_brightness() @dataclass @@ -159,7 +421,7 @@ DEVICE_ENTITY: dict[ subscribe_attributes=( clusters.OnOff.Attributes.OnOff, clusters.LevelControl.Attributes.CurrentLevel, - clusters.ColorControl, + clusters.ColorControl.Attributes.ColorTemperatureMireds, ), ), device_types.ExtendedColorLight: MatterLightEntityDescriptionFactory( @@ -167,7 +429,12 @@ DEVICE_ENTITY: dict[ subscribe_attributes=( clusters.OnOff.Attributes.OnOff, clusters.LevelControl.Attributes.CurrentLevel, - clusters.ColorControl, + clusters.ColorControl.Attributes.ColorMode, + clusters.ColorControl.Attributes.CurrentHue, + clusters.ColorControl.Attributes.CurrentSaturation, + clusters.ColorControl.Attributes.CurrentX, + clusters.ColorControl.Attributes.CurrentY, + clusters.ColorControl.Attributes.ColorTemperatureMireds, ), ), } diff --git a/homeassistant/components/matter/util.py b/homeassistant/components/matter/util.py index 9f51ee0c0e6..834c71a0307 100644 --- a/homeassistant/components/matter/util.py +++ b/homeassistant/components/matter/util.py @@ -1,6 +1,8 @@ """Provide integration utilities.""" from __future__ import annotations +XY_COLOR_FACTOR = 65536 + def renormalize( number: float, from_range: tuple[float, float], to_range: tuple[float, float] @@ -9,3 +11,33 @@ def renormalize( delta1 = from_range[1] - from_range[0] delta2 = to_range[1] - to_range[0] return (delta2 * (number - from_range[0]) / delta1) + to_range[0] + + +def convert_to_matter_hs(hass_hs: tuple[float, float]) -> tuple[float, float]: + """Convert Home Assistant HS to Matter HS.""" + + return ( + hass_hs[0] / 360 * 254, + renormalize(hass_hs[1], (0, 100), (0, 254)), + ) + + +def convert_to_hass_hs(matter_hs: tuple[float, float]) -> tuple[float, float]: + """Convert Matter HS to Home Assistant HS.""" + + return ( + matter_hs[0] * 360 / 254, + renormalize(matter_hs[1], (0, 254), (0, 100)), + ) + + +def convert_to_matter_xy(hass_xy: tuple[float, float]) -> tuple[float, float]: + """Convert Home Assistant XY to Matter XY.""" + + return (hass_xy[0] * XY_COLOR_FACTOR, hass_xy[1] * XY_COLOR_FACTOR) + + +def convert_to_hass_xy(matter_xy: tuple[float, float]) -> tuple[float, float]: + """Convert Matter XY to Home Assistant XY.""" + + return (matter_xy[0] / XY_COLOR_FACTOR, matter_xy[1] / XY_COLOR_FACTOR) diff --git a/tests/components/matter/fixtures/nodes/extended-color-light.json b/tests/components/matter/fixtures/nodes/extended-color-light.json new file mode 100644 index 00000000000..ea82358ea47 --- /dev/null +++ b/tests/components/matter/fixtures/nodes/extended-color-light.json @@ -0,0 +1,2110 @@ +{ + "node_id": 1, + "date_commissioned": "2023-01-31T03:59:47.454727", + "last_interview": "2023-01-31T03:59:47.454728", + "interview_version": 1, + "attributes": { + "0/29/0": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.DeviceTypeList", + "attribute_name": "DeviceTypeList", + "value": [ + { + "type": 22, + "revision": 1 + } + ] + }, + "0/29/1": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 1, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.ServerList", + "attribute_name": "ServerList", + "value": [29, 31, 40, 48, 49, 51, 60, 62, 63] + }, + "0/29/2": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 2, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.ClientList", + "attribute_name": "ClientList", + "value": [] + }, + "0/29/3": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 3, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.PartsList", + "attribute_name": "PartsList", + "value": [1, 2, 3, 4, 5, 6, 7] + }, + "0/29/65532": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 65532, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.FeatureMap", + "attribute_name": "FeatureMap", + "value": 0 + }, + "0/29/65533": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 1 + }, + "0/29/65528": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [] + }, + "0/29/65529": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [] + }, + "0/29/65531": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533] + }, + "0/31/0": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 31, + "cluster_type": "chip.clusters.Objects.AccessControl", + "cluster_name": "AccessControl", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.AccessControl.Attributes.Acl", + "attribute_name": "Acl", + "value": [ + { + "privilege": 5, + "authMode": 2, + "subjects": [112233], + "targets": null, + "fabricIndex": 52 + } + ] + }, + "0/31/1": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 31, + "cluster_type": "chip.clusters.Objects.AccessControl", + "cluster_name": "AccessControl", + "attribute_id": 1, + "attribute_type": "chip.clusters.Objects.AccessControl.Attributes.Extension", + "attribute_name": "Extension", + "value": [] + }, + "0/31/2": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 31, + "cluster_type": "chip.clusters.Objects.AccessControl", + "cluster_name": "AccessControl", + "attribute_id": 2, + "attribute_type": "chip.clusters.Objects.AccessControl.Attributes.SubjectsPerAccessControlEntry", + "attribute_name": "SubjectsPerAccessControlEntry", + "value": 4 + }, + "0/31/3": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 31, + "cluster_type": "chip.clusters.Objects.AccessControl", + "cluster_name": "AccessControl", + "attribute_id": 3, + "attribute_type": "chip.clusters.Objects.AccessControl.Attributes.TargetsPerAccessControlEntry", + "attribute_name": "TargetsPerAccessControlEntry", + "value": 3 + }, + "0/31/4": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 31, + "cluster_type": "chip.clusters.Objects.AccessControl", + "cluster_name": "AccessControl", + "attribute_id": 4, + "attribute_type": "chip.clusters.Objects.AccessControl.Attributes.AccessControlEntriesPerFabric", + "attribute_name": "AccessControlEntriesPerFabric", + "value": 3 + }, + "0/31/65532": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 31, + "cluster_type": "chip.clusters.Objects.AccessControl", + "cluster_name": "AccessControl", + "attribute_id": 65532, + "attribute_type": "chip.clusters.Objects.AccessControl.Attributes.FeatureMap", + "attribute_name": "FeatureMap", + "value": 0 + }, + "0/31/65533": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 31, + "cluster_type": "chip.clusters.Objects.AccessControl", + "cluster_name": "AccessControl", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.AccessControl.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 1 + }, + "0/31/65528": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 31, + "cluster_type": "chip.clusters.Objects.AccessControl", + "cluster_name": "AccessControl", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.AccessControl.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [] + }, + "0/31/65529": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 31, + "cluster_type": "chip.clusters.Objects.AccessControl", + "cluster_name": "AccessControl", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.AccessControl.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [] + }, + "0/31/65531": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 31, + "cluster_type": "chip.clusters.Objects.AccessControl", + "cluster_name": "AccessControl", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.AccessControl.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [0, 1, 2, 3, 4, 65528, 65529, 65531, 65532, 65533] + }, + "0/40/0": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.DataModelRevision", + "attribute_name": "DataModelRevision", + "value": 1 + }, + "0/40/1": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 1, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.VendorName", + "attribute_name": "VendorName", + "value": "Signify" + }, + "0/40/2": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 2, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.VendorID", + "attribute_name": "VendorID", + "value": 4107 + }, + "0/40/3": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 3, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.ProductName", + "attribute_name": "ProductName", + "value": "Mock Extended Color Light" + }, + "0/40/4": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 4, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.ProductID", + "attribute_name": "ProductID", + "value": 2 + }, + "0/40/5": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 5, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.NodeLabel", + "attribute_name": "NodeLabel", + "value": "Mock Extended Color Light" + }, + "0/40/6": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 6, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.Location", + "attribute_name": "Location", + "value": "**REDACTED**" + }, + "0/40/7": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 7, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.HardwareVersion", + "attribute_name": "HardwareVersion", + "value": 1 + }, + "0/40/8": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 8, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.HardwareVersionString", + "attribute_name": "HardwareVersionString", + "value": "1" + }, + "0/40/9": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 9, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.SoftwareVersion", + "attribute_name": "SoftwareVersion", + "value": 65536 + }, + "0/40/10": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 10, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.SoftwareVersionString", + "attribute_name": "SoftwareVersionString", + "value": "1.0.0" + }, + "0/40/17": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 17, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.Reachable", + "attribute_name": "Reachable", + "value": true + }, + "0/40/18": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 18, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.UniqueID", + "attribute_name": "UniqueID", + "value": "mock-extended-color-light" + }, + "0/40/19": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 19, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.CapabilityMinima", + "attribute_name": "CapabilityMinima", + "value": { + "caseSessionsPerFabric": 3, + "subscriptionsPerFabric": 65535 + } + }, + "0/40/65532": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 65532, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.FeatureMap", + "attribute_name": "FeatureMap", + "value": 0 + }, + "0/40/65533": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 1 + }, + "0/40/65528": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [] + }, + "0/40/65529": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [] + }, + "0/40/65531": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 40, + "cluster_type": "chip.clusters.Objects.BasicInformation", + "cluster_name": "BasicInformation", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.BasicInformation.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 17, 18, 19, 65528, 65529, 65531, + 65532, 65533 + ] + }, + "0/48/0": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 48, + "cluster_type": "chip.clusters.Objects.GeneralCommissioning", + "cluster_name": "GeneralCommissioning", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.GeneralCommissioning.Attributes.Breadcrumb", + "attribute_name": "Breadcrumb", + "value": 0 + }, + "0/48/1": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 48, + "cluster_type": "chip.clusters.Objects.GeneralCommissioning", + "cluster_name": "GeneralCommissioning", + "attribute_id": 1, + "attribute_type": "chip.clusters.Objects.GeneralCommissioning.Attributes.BasicCommissioningInfo", + "attribute_name": "BasicCommissioningInfo", + "value": { + "failSafeExpiryLengthSeconds": 60, + "maxCumulativeFailsafeSeconds": 900 + } + }, + "0/48/2": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 48, + "cluster_type": "chip.clusters.Objects.GeneralCommissioning", + "cluster_name": "GeneralCommissioning", + "attribute_id": 2, + "attribute_type": "chip.clusters.Objects.GeneralCommissioning.Attributes.RegulatoryConfig", + "attribute_name": "RegulatoryConfig", + "value": 2 + }, + "0/48/3": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 48, + "cluster_type": "chip.clusters.Objects.GeneralCommissioning", + "cluster_name": "GeneralCommissioning", + "attribute_id": 3, + "attribute_type": "chip.clusters.Objects.GeneralCommissioning.Attributes.LocationCapability", + "attribute_name": "LocationCapability", + "value": 2 + }, + "0/48/4": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 48, + "cluster_type": "chip.clusters.Objects.GeneralCommissioning", + "cluster_name": "GeneralCommissioning", + "attribute_id": 4, + "attribute_type": "chip.clusters.Objects.GeneralCommissioning.Attributes.SupportsConcurrentConnection", + "attribute_name": "SupportsConcurrentConnection", + "value": true + }, + "0/48/65532": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 48, + "cluster_type": "chip.clusters.Objects.GeneralCommissioning", + "cluster_name": "GeneralCommissioning", + "attribute_id": 65532, + "attribute_type": "chip.clusters.Objects.GeneralCommissioning.Attributes.FeatureMap", + "attribute_name": "FeatureMap", + "value": 0 + }, + "0/48/65533": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 48, + "cluster_type": "chip.clusters.Objects.GeneralCommissioning", + "cluster_name": "GeneralCommissioning", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.GeneralCommissioning.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 1 + }, + "0/48/65528": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 48, + "cluster_type": "chip.clusters.Objects.GeneralCommissioning", + "cluster_name": "GeneralCommissioning", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.GeneralCommissioning.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [1, 3, 5] + }, + "0/48/65529": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 48, + "cluster_type": "chip.clusters.Objects.GeneralCommissioning", + "cluster_name": "GeneralCommissioning", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.GeneralCommissioning.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [0, 2, 4] + }, + "0/48/65531": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 48, + "cluster_type": "chip.clusters.Objects.GeneralCommissioning", + "cluster_name": "GeneralCommissioning", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.GeneralCommissioning.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [0, 1, 2, 3, 4, 65528, 65529, 65531, 65532, 65533] + }, + "0/49/0": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 49, + "cluster_type": "chip.clusters.Objects.NetworkCommissioning", + "cluster_name": "NetworkCommissioning", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.NetworkCommissioning.Attributes.MaxNetworks", + "attribute_name": "MaxNetworks", + "value": 1 + }, + "0/49/1": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 49, + "cluster_type": "chip.clusters.Objects.NetworkCommissioning", + "cluster_name": "NetworkCommissioning", + "attribute_id": 1, + "attribute_type": "chip.clusters.Objects.NetworkCommissioning.Attributes.Networks", + "attribute_name": "Networks", + "value": [ + { + "networkID": "ZXRoMA==", + "connected": true + } + ] + }, + "0/49/4": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 49, + "cluster_type": "chip.clusters.Objects.NetworkCommissioning", + "cluster_name": "NetworkCommissioning", + "attribute_id": 4, + "attribute_type": "chip.clusters.Objects.NetworkCommissioning.Attributes.InterfaceEnabled", + "attribute_name": "InterfaceEnabled", + "value": true + }, + "0/49/5": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 49, + "cluster_type": "chip.clusters.Objects.NetworkCommissioning", + "cluster_name": "NetworkCommissioning", + "attribute_id": 5, + "attribute_type": "chip.clusters.Objects.NetworkCommissioning.Attributes.LastNetworkingStatus", + "attribute_name": "LastNetworkingStatus", + "value": null + }, + "0/49/6": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 49, + "cluster_type": "chip.clusters.Objects.NetworkCommissioning", + "cluster_name": "NetworkCommissioning", + "attribute_id": 6, + "attribute_type": "chip.clusters.Objects.NetworkCommissioning.Attributes.LastNetworkID", + "attribute_name": "LastNetworkID", + "value": null + }, + "0/49/7": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 49, + "cluster_type": "chip.clusters.Objects.NetworkCommissioning", + "cluster_name": "NetworkCommissioning", + "attribute_id": 7, + "attribute_type": "chip.clusters.Objects.NetworkCommissioning.Attributes.LastConnectErrorValue", + "attribute_name": "LastConnectErrorValue", + "value": null + }, + "0/49/65532": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 49, + "cluster_type": "chip.clusters.Objects.NetworkCommissioning", + "cluster_name": "NetworkCommissioning", + "attribute_id": 65532, + "attribute_type": "chip.clusters.Objects.NetworkCommissioning.Attributes.FeatureMap", + "attribute_name": "FeatureMap", + "value": 4 + }, + "0/49/65533": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 49, + "cluster_type": "chip.clusters.Objects.NetworkCommissioning", + "cluster_name": "NetworkCommissioning", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.NetworkCommissioning.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 1 + }, + "0/49/65528": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 49, + "cluster_type": "chip.clusters.Objects.NetworkCommissioning", + "cluster_name": "NetworkCommissioning", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.NetworkCommissioning.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [] + }, + "0/49/65529": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 49, + "cluster_type": "chip.clusters.Objects.NetworkCommissioning", + "cluster_name": "NetworkCommissioning", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.NetworkCommissioning.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [] + }, + "0/49/65531": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 49, + "cluster_type": "chip.clusters.Objects.NetworkCommissioning", + "cluster_name": "NetworkCommissioning", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.NetworkCommissioning.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [0, 1, 4, 5, 6, 7, 65528, 65529, 65531, 65532, 65533] + }, + "0/51/0": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 51, + "cluster_type": "chip.clusters.Objects.GeneralDiagnostics", + "cluster_name": "GeneralDiagnostics", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.GeneralDiagnostics.Attributes.NetworkInterfaces", + "attribute_name": "NetworkInterfaces", + "value": [ + { + "name": "eth1", + "isOperational": true, + "offPremiseServicesReachableIPv4": null, + "offPremiseServicesReachableIPv6": null, + "hardwareAddress": "ABeILIy4", + "IPv4Addresses": ["CjwBuw=="], + "IPv6Addresses": [ + "/VqgxiAxQiYCF4j//iyMuA==", + "IAEEcLs7AAYCF4j//iyMuA==", + "/oAAAAAAAAACF4j//iyMuA==" + ], + "type": 0 + }, + { + "name": "eth0", + "isOperational": false, + "offPremiseServicesReachableIPv4": null, + "offPremiseServicesReachableIPv6": null, + "hardwareAddress": "AAN/ESDO", + "IPv4Addresses": [], + "IPv6Addresses": [], + "type": 2 + }, + { + "name": "lo", + "isOperational": true, + "offPremiseServicesReachableIPv4": null, + "offPremiseServicesReachableIPv6": null, + "hardwareAddress": "AAAAAAAA", + "IPv4Addresses": ["fwAAAQ=="], + "IPv6Addresses": ["AAAAAAAAAAAAAAAAAAAAAQ=="], + "type": 0 + } + ] + }, + "0/51/1": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 51, + "cluster_type": "chip.clusters.Objects.GeneralDiagnostics", + "cluster_name": "GeneralDiagnostics", + "attribute_id": 1, + "attribute_type": "chip.clusters.Objects.GeneralDiagnostics.Attributes.RebootCount", + "attribute_name": "RebootCount", + "value": 4 + }, + "0/51/2": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 51, + "cluster_type": "chip.clusters.Objects.GeneralDiagnostics", + "cluster_name": "GeneralDiagnostics", + "attribute_id": 2, + "attribute_type": "chip.clusters.Objects.GeneralDiagnostics.Attributes.UpTime", + "attribute_name": "UpTime", + "value": 834681 + }, + "0/51/3": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 51, + "cluster_type": "chip.clusters.Objects.GeneralDiagnostics", + "cluster_name": "GeneralDiagnostics", + "attribute_id": 3, + "attribute_type": "chip.clusters.Objects.GeneralDiagnostics.Attributes.TotalOperationalHours", + "attribute_name": "TotalOperationalHours", + "value": 231 + }, + "0/51/4": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 51, + "cluster_type": "chip.clusters.Objects.GeneralDiagnostics", + "cluster_name": "GeneralDiagnostics", + "attribute_id": 4, + "attribute_type": "chip.clusters.Objects.GeneralDiagnostics.Attributes.BootReasons", + "attribute_name": "BootReasons", + "value": 0 + }, + "0/51/5": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 51, + "cluster_type": "chip.clusters.Objects.GeneralDiagnostics", + "cluster_name": "GeneralDiagnostics", + "attribute_id": 5, + "attribute_type": "chip.clusters.Objects.GeneralDiagnostics.Attributes.ActiveHardwareFaults", + "attribute_name": "ActiveHardwareFaults", + "value": [] + }, + "0/51/6": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 51, + "cluster_type": "chip.clusters.Objects.GeneralDiagnostics", + "cluster_name": "GeneralDiagnostics", + "attribute_id": 6, + "attribute_type": "chip.clusters.Objects.GeneralDiagnostics.Attributes.ActiveRadioFaults", + "attribute_name": "ActiveRadioFaults", + "value": [] + }, + "0/51/7": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 51, + "cluster_type": "chip.clusters.Objects.GeneralDiagnostics", + "cluster_name": "GeneralDiagnostics", + "attribute_id": 7, + "attribute_type": "chip.clusters.Objects.GeneralDiagnostics.Attributes.ActiveNetworkFaults", + "attribute_name": "ActiveNetworkFaults", + "value": [] + }, + "0/51/8": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 51, + "cluster_type": "chip.clusters.Objects.GeneralDiagnostics", + "cluster_name": "GeneralDiagnostics", + "attribute_id": 8, + "attribute_type": "chip.clusters.Objects.GeneralDiagnostics.Attributes.TestEventTriggersEnabled", + "attribute_name": "TestEventTriggersEnabled", + "value": false + }, + "0/51/65532": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 51, + "cluster_type": "chip.clusters.Objects.GeneralDiagnostics", + "cluster_name": "GeneralDiagnostics", + "attribute_id": 65532, + "attribute_type": "chip.clusters.Objects.GeneralDiagnostics.Attributes.FeatureMap", + "attribute_name": "FeatureMap", + "value": 0 + }, + "0/51/65533": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 51, + "cluster_type": "chip.clusters.Objects.GeneralDiagnostics", + "cluster_name": "GeneralDiagnostics", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.GeneralDiagnostics.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 1 + }, + "0/51/65528": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 51, + "cluster_type": "chip.clusters.Objects.GeneralDiagnostics", + "cluster_name": "GeneralDiagnostics", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.GeneralDiagnostics.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [] + }, + "0/51/65529": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 51, + "cluster_type": "chip.clusters.Objects.GeneralDiagnostics", + "cluster_name": "GeneralDiagnostics", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.GeneralDiagnostics.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [0] + }, + "0/51/65531": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 51, + "cluster_type": "chip.clusters.Objects.GeneralDiagnostics", + "cluster_name": "GeneralDiagnostics", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.GeneralDiagnostics.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [0, 1, 2, 3, 4, 5, 6, 7, 8, 65528, 65529, 65531, 65532, 65533] + }, + "0/60/0": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 60, + "cluster_type": "chip.clusters.Objects.AdministratorCommissioning", + "cluster_name": "AdministratorCommissioning", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.AdministratorCommissioning.Attributes.WindowStatus", + "attribute_name": "WindowStatus", + "value": 0 + }, + "0/60/1": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 60, + "cluster_type": "chip.clusters.Objects.AdministratorCommissioning", + "cluster_name": "AdministratorCommissioning", + "attribute_id": 1, + "attribute_type": "chip.clusters.Objects.AdministratorCommissioning.Attributes.AdminFabricIndex", + "attribute_name": "AdminFabricIndex", + "value": null + }, + "0/60/2": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 60, + "cluster_type": "chip.clusters.Objects.AdministratorCommissioning", + "cluster_name": "AdministratorCommissioning", + "attribute_id": 2, + "attribute_type": "chip.clusters.Objects.AdministratorCommissioning.Attributes.AdminVendorId", + "attribute_name": "AdminVendorId", + "value": null + }, + "0/60/65532": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 60, + "cluster_type": "chip.clusters.Objects.AdministratorCommissioning", + "cluster_name": "AdministratorCommissioning", + "attribute_id": 65532, + "attribute_type": "chip.clusters.Objects.AdministratorCommissioning.Attributes.FeatureMap", + "attribute_name": "FeatureMap", + "value": 0 + }, + "0/60/65533": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 60, + "cluster_type": "chip.clusters.Objects.AdministratorCommissioning", + "cluster_name": "AdministratorCommissioning", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.AdministratorCommissioning.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 1 + }, + "0/60/65528": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 60, + "cluster_type": "chip.clusters.Objects.AdministratorCommissioning", + "cluster_name": "AdministratorCommissioning", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.AdministratorCommissioning.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [] + }, + "0/60/65529": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 60, + "cluster_type": "chip.clusters.Objects.AdministratorCommissioning", + "cluster_name": "AdministratorCommissioning", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.AdministratorCommissioning.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [0, 1, 2] + }, + "0/60/65531": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 60, + "cluster_type": "chip.clusters.Objects.AdministratorCommissioning", + "cluster_name": "AdministratorCommissioning", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.AdministratorCommissioning.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [0, 1, 2, 65528, 65529, 65531, 65532, 65533] + }, + "0/62/0": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 62, + "cluster_type": "chip.clusters.Objects.OperationalCredentials", + "cluster_name": "OperationalCredentials", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.OperationalCredentials.Attributes.NOCs", + "attribute_name": "NOCs", + "value": [ + { + "noc": "FTABAQEkAgE3AyQTAhgmBIAigScmBYAlTTo3BiQVASQRARgkBwEkCAEwCUEEYGMAhVV+Adasucgyi++1D7eyBIfHs9xLKJPVJqJdMAqt0S8lQs+6v/NAyAVXsN8jdGlNgZQENRnfqC2gXv3COzcKNQEoARgkAgE2AwQCBAEYMAQUTK/GvAzp9yCT0ihFRaEyW8KuO0IwBRQ5RmCO0h/Cd/uv6Pe62ZSLBzXOtBgwC0CaO1hqAR9PQJUkSx4MQyHEDQND/3j7m6EPRImPCA53dKI7e4w7xZEQEW95oMhuUobdy3WbMcggAMTX46ninwqUGA==", + "icac": "FTABAQEkAgE3AyQUARgmBIAigScmBYAlTTo3BiQTAhgkBwEkCAEwCUEEqboEMvSYpJHvrznp5AQ1fHW0AVUrTajBHZ/2uba7+FTyPb+fqgf6K1zbuMqTxTOA/FwjzAL7hQTwG+HNnmLwNTcKNQEpARgkAmAwBBQ5RmCO0h/Cd/uv6Pe62ZSLBzXOtDAFFG02YRl97W++GsAiEiBzIhO0hzA6GDALQBl+ZyFbSXu3oXVJGBjtDcpwOCRC30OaVjDhUT7NbohDLaKuwxMhAgE+uHtSLKRZPGlQGSzYdnDGj/dWolGE+n4Y", + "fabricIndex": 52 + } + ] + }, + "0/62/1": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 62, + "cluster_type": "chip.clusters.Objects.OperationalCredentials", + "cluster_name": "OperationalCredentials", + "attribute_id": 1, + "attribute_type": "chip.clusters.Objects.OperationalCredentials.Attributes.Fabrics", + "attribute_name": "Fabrics", + "value": [ + { + "rootPublicKey": "BOI8+YJvCUh78+5WD4aHD7t1HQJS3WMrCEknk6n+5HXP2VRMB3SvK6+EEa8rR6UkHnCryIREeOmS0XYozzHjTQg=", + "vendorId": 65521, + "fabricId": 1, + "nodeId": 1, + "label": "", + "fabricIndex": 52 + } + ] + }, + "0/62/2": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 62, + "cluster_type": "chip.clusters.Objects.OperationalCredentials", + "cluster_name": "OperationalCredentials", + "attribute_id": 2, + "attribute_type": "chip.clusters.Objects.OperationalCredentials.Attributes.SupportedFabrics", + "attribute_name": "SupportedFabrics", + "value": 16 + }, + "0/62/3": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 62, + "cluster_type": "chip.clusters.Objects.OperationalCredentials", + "cluster_name": "OperationalCredentials", + "attribute_id": 3, + "attribute_type": "chip.clusters.Objects.OperationalCredentials.Attributes.CommissionedFabrics", + "attribute_name": "CommissionedFabrics", + "value": 4 + }, + "0/62/4": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 62, + "cluster_type": "chip.clusters.Objects.OperationalCredentials", + "cluster_name": "OperationalCredentials", + "attribute_id": 4, + "attribute_type": "chip.clusters.Objects.OperationalCredentials.Attributes.TrustedRootCertificates", + "attribute_name": "TrustedRootCertificates", + "value": [ + "FTABAQAkAgE3AycUF+1s7yUxl34kFQEYJgRAwC8rJgXA8xAtNwYnFBftbO8lMZd+JBUBGCQHASQIATAJQQRVFfH8a8Q6Ao7WLf+UWfO6Qs7yilIhKqD59s89ORO1UFw4ge7hwKMSFn8ixUw/SolOQBSsCF4L0mSEatBpsDFnNwo1ASkBGCQCYDAEFPrNGEmgHq6sOVn/hmBwy/Vue7r0MAUU+s0YSaAerqw5Wf+GYHDL9W57uvQYMAtAZthavHRZnzQlRYALrcnL/6oo5LlVEot5CBGjqdoD/j6tvJcsTbqGqtv2H5GL4DC5KRNAE5ZmyqaQDMp3hZMrMxg=", + "FTABAQAkAgE3AycUfHqQXNhPx0gkFQIYJgRtwC8rJgXt8xAtNwYnFHx6kFzYT8dIJBUCGCQHASQIATAJQQQNBDXlacZCe3oZcAfbwCvm06XcQzAC287XzRvF/RLV/fkpY0xOgTn6WYEYvThhqRF2B1WApMsQ59+WAo0X9igONwo1ASkBGCQCYDAEFEabr60b38Ymu5LyDvqUx3o0SI7xMAUURpuvrRvfxia7kvIO+pTHejRIjvEYMAtAhtqVBW7tg1C0F3w0a3mQ5uirN8UFAqgTYDh45HoqZv+NuAkF3tUI8bcIZZ/QxLu5C6GcK7KYlT3peRpNIyBCOBg=", + "FTABAQEkAgE3AyQUARgmBIAigScmBYAlTTo3BiQUARgkBwEkCAEwCUEE4jz5gm8JSHvz7lYPhocPu3UdAlLdYysISSeTqf7kdc/ZVEwHdK8rr4QRrytHpSQecKvIhER46ZLRdijPMeNNCDcKNQEpARgkAmAwBBRtNmEZfe1vvhrAIhIgcyITtIcwOjAFFG02YRl97W++GsAiEiBzIhO0hzA6GDALQPowt7QmngLyiuBmOVcu/kv3QR/+HhfRPxN5W8E811lBhPX4qEpvsBdEzJS0SpiQh+Fql+ARHzUGuIKP6SqjCnMY", + "FTABAQEkAgE3AyQUARgmBIAigScmBYAlTTo3BiQUARgkBwEkCAEwCUEEOXNb0qzX1XBSquJ+bK0cuBsQl9aY/aBJ5njrCywf1qBz9W+54CQc4Lz5FtNzAhV7B6C3NppGozNUiSoAsL55ATcKNQEpARgkAmAwBBSWJBXzLVqg+IBcPntxiV91YIS0yDAFFJYkFfMtWqD4gFw+e3GJX3VghLTIGDALQIx8UTwGL2Ios2ym0C36ZrBPU7x7dw9zxCMKiuiDeEtdqcrKE7W/aaQ8/Mg2jszd7mqe/qq5y3yq3V6a8tQjrD0Y" + ] + }, + "0/62/5": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 62, + "cluster_type": "chip.clusters.Objects.OperationalCredentials", + "cluster_name": "OperationalCredentials", + "attribute_id": 5, + "attribute_type": "chip.clusters.Objects.OperationalCredentials.Attributes.CurrentFabricIndex", + "attribute_name": "CurrentFabricIndex", + "value": 52 + }, + "0/62/65532": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 62, + "cluster_type": "chip.clusters.Objects.OperationalCredentials", + "cluster_name": "OperationalCredentials", + "attribute_id": 65532, + "attribute_type": "chip.clusters.Objects.OperationalCredentials.Attributes.FeatureMap", + "attribute_name": "FeatureMap", + "value": 0 + }, + "0/62/65533": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 62, + "cluster_type": "chip.clusters.Objects.OperationalCredentials", + "cluster_name": "OperationalCredentials", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.OperationalCredentials.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 1 + }, + "0/62/65528": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 62, + "cluster_type": "chip.clusters.Objects.OperationalCredentials", + "cluster_name": "OperationalCredentials", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.OperationalCredentials.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [1, 3, 5, 8] + }, + "0/62/65529": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 62, + "cluster_type": "chip.clusters.Objects.OperationalCredentials", + "cluster_name": "OperationalCredentials", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.OperationalCredentials.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [0, 2, 4, 6, 7, 9, 10, 11] + }, + "0/62/65531": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 62, + "cluster_type": "chip.clusters.Objects.OperationalCredentials", + "cluster_name": "OperationalCredentials", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.OperationalCredentials.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [0, 1, 2, 3, 4, 5, 65528, 65529, 65531, 65532, 65533] + }, + "0/63/0": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 63, + "cluster_type": "chip.clusters.Objects.GroupKeyManagement", + "cluster_name": "GroupKeyManagement", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.GroupKeyManagement.Attributes.GroupKeyMap", + "attribute_name": "GroupKeyMap", + "value": [] + }, + "0/63/1": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 63, + "cluster_type": "chip.clusters.Objects.GroupKeyManagement", + "cluster_name": "GroupKeyManagement", + "attribute_id": 1, + "attribute_type": "chip.clusters.Objects.GroupKeyManagement.Attributes.GroupTable", + "attribute_name": "GroupTable", + "value": [] + }, + "0/63/2": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 63, + "cluster_type": "chip.clusters.Objects.GroupKeyManagement", + "cluster_name": "GroupKeyManagement", + "attribute_id": 2, + "attribute_type": "chip.clusters.Objects.GroupKeyManagement.Attributes.MaxGroupsPerFabric", + "attribute_name": "MaxGroupsPerFabric", + "value": 3 + }, + "0/63/3": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 63, + "cluster_type": "chip.clusters.Objects.GroupKeyManagement", + "cluster_name": "GroupKeyManagement", + "attribute_id": 3, + "attribute_type": "chip.clusters.Objects.GroupKeyManagement.Attributes.MaxGroupKeysPerFabric", + "attribute_name": "MaxGroupKeysPerFabric", + "value": 3 + }, + "0/63/65533": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 63, + "cluster_type": "chip.clusters.Objects.GroupKeyManagement", + "cluster_name": "GroupKeyManagement", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.GroupKeyManagement.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 1 + }, + "0/63/65528": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 63, + "cluster_type": "chip.clusters.Objects.GroupKeyManagement", + "cluster_name": "GroupKeyManagement", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.GroupKeyManagement.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [2, 5] + }, + "0/63/65529": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 63, + "cluster_type": "chip.clusters.Objects.GroupKeyManagement", + "cluster_name": "GroupKeyManagement", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.GroupKeyManagement.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [0, 1, 3, 4] + }, + "0/63/65531": { + "node_id": 1, + "endpoint": 0, + "cluster_id": 63, + "cluster_type": "chip.clusters.Objects.GroupKeyManagement", + "cluster_name": "GroupKeyManagement", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.GroupKeyManagement.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [0, 1, 2, 3, 65528, 65529, 65531, 65533] + }, + "1/6/0": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 6, + "cluster_type": "chip.clusters.Objects.OnOff", + "cluster_name": "OnOff", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.OnOff.Attributes.OnOff", + "attribute_name": "OnOff", + "value": true + }, + "1/6/16384": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 6, + "cluster_type": "chip.clusters.Objects.OnOff", + "cluster_name": "OnOff", + "attribute_id": 16384, + "attribute_type": "chip.clusters.Objects.OnOff.Attributes.GlobalSceneControl", + "attribute_name": "GlobalSceneControl", + "value": true + }, + "1/6/16385": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 6, + "cluster_type": "chip.clusters.Objects.OnOff", + "cluster_name": "OnOff", + "attribute_id": 16385, + "attribute_type": "chip.clusters.Objects.OnOff.Attributes.OnTime", + "attribute_name": "OnTime", + "value": 0 + }, + "1/6/16386": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 6, + "cluster_type": "chip.clusters.Objects.OnOff", + "cluster_name": "OnOff", + "attribute_id": 16386, + "attribute_type": "chip.clusters.Objects.OnOff.Attributes.OffWaitTime", + "attribute_name": "OffWaitTime", + "value": 0 + }, + "1/6/16387": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 6, + "cluster_type": "chip.clusters.Objects.OnOff", + "cluster_name": "OnOff", + "attribute_id": 16387, + "attribute_type": "chip.clusters.Objects.OnOff.Attributes.StartUpOnOff", + "attribute_name": "StartUpOnOff", + "value": null + }, + "1/6/65532": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 6, + "cluster_type": "chip.clusters.Objects.OnOff", + "cluster_name": "OnOff", + "attribute_id": 65532, + "attribute_type": "chip.clusters.Objects.OnOff.Attributes.FeatureMap", + "attribute_name": "FeatureMap", + "value": 1 + }, + "1/6/65533": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 6, + "cluster_type": "chip.clusters.Objects.OnOff", + "cluster_name": "OnOff", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.OnOff.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 4 + }, + "1/6/65528": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 6, + "cluster_type": "chip.clusters.Objects.OnOff", + "cluster_name": "OnOff", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.OnOff.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [] + }, + "1/6/65529": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 6, + "cluster_type": "chip.clusters.Objects.OnOff", + "cluster_name": "OnOff", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.OnOff.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [0, 1, 2, 64, 65, 66] + }, + "1/6/65531": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 6, + "cluster_type": "chip.clusters.Objects.OnOff", + "cluster_name": "OnOff", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.OnOff.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [ + 0, 16384, 16385, 16386, 16387, 65528, 65529, 65531, 65532, 65533 + ] + }, + "1/29/0": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.DeviceTypeList", + "attribute_name": "DeviceTypeList", + "value": [ + { + "type": 269, + "revision": 1 + } + ] + }, + "1/29/1": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 1, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.ServerList", + "attribute_name": "ServerList", + "value": [6, 29, 57, 768, 8, 80, 3, 4] + }, + "1/29/2": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 2, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.ClientList", + "attribute_name": "ClientList", + "value": [] + }, + "1/29/3": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 3, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.PartsList", + "attribute_name": "PartsList", + "value": [] + }, + "1/29/65533": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 1 + }, + "1/29/65528": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [] + }, + "1/29/65529": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [] + }, + "1/29/65531": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 29, + "cluster_type": "chip.clusters.Objects.Descriptor", + "cluster_name": "Descriptor", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.Descriptor.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [0, 1, 2, 3, 65528, 65529, 65531, 65533] + }, + "1/768/0": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.CurrentHue", + "attribute_name": "CurrentHue", + "value": 36 + }, + "1/768/3": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 3, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.CurrentX", + "attribute_name": "CurrentX", + "value": 26515 + }, + "1/768/4": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 4, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.CurrentY", + "attribute_name": "CurrentY", + "value": 25657 + }, + "1/768/7": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 7, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.ColorTemperatureMireds", + "attribute_name": "ColorTemperatureMireds", + "value": 284 + }, + "1/768/1": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 1, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.CurrentSaturation", + "attribute_name": "CurrentSaturation", + "value": 51 + }, + "1/768/16384": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 16384, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.EnhancedCurrentHue", + "attribute_name": "EnhancedCurrentHue", + "value": 9305 + }, + "1/768/8": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 8, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.ColorMode", + "attribute_name": "ColorMode", + "value": 0 + }, + "1/768/15": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 15, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.Options", + "attribute_name": "Options", + "value": 0 + }, + "1/768/16385": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 16385, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.EnhancedColorMode", + "attribute_name": "EnhancedColorMode", + "value": 0 + }, + "1/768/16386": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 16386, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.ColorLoopActive", + "attribute_name": "ColorLoopActive", + "value": { + "TLVValue": null, + "Reason": null + } + }, + "1/768/16387": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 16387, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.ColorLoopDirection", + "attribute_name": "ColorLoopDirection", + "value": { + "TLVValue": null, + "Reason": null + } + }, + "1/768/16388": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 16388, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.ColorLoopTime", + "attribute_name": "ColorLoopTime", + "value": { + "TLVValue": null, + "Reason": null + } + }, + "1/768/16389": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 16389, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.ColorLoopStartEnhancedHue", + "attribute_name": "ColorLoopStartEnhancedHue", + "value": { + "TLVValue": null, + "Reason": null + } + }, + "1/768/16390": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 16390, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.ColorLoopStoredEnhancedHue", + "attribute_name": "ColorLoopStoredEnhancedHue", + "value": { + "TLVValue": null, + "Reason": null + } + }, + "1/768/16394": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 16394, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.ColorCapabilities", + "attribute_name": "ColorCapabilities", + "value": 25 + }, + "1/768/16": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 16, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.NumberOfPrimaries", + "attribute_name": "NumberOfPrimaries", + "value": { + "TLVValue": null, + "Reason": null + } + }, + "1/768/16395": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 16395, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.ColorTempPhysicalMinMireds", + "attribute_name": "ColorTempPhysicalMinMireds", + "value": 153 + }, + "1/768/16396": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 16396, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.ColorTempPhysicalMaxMireds", + "attribute_name": "ColorTempPhysicalMaxMireds", + "value": 500 + }, + "1/768/16397": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 16397, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.CoupleColorTempToLevelMinMireds", + "attribute_name": "CoupleColorTempToLevelMinMireds", + "value": 250 + }, + "1/768/16400": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 16400, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.StartUpColorTemperatureMireds", + "attribute_name": "StartUpColorTemperatureMireds", + "value": 65535 + }, + "1/768/2": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 2, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.RemainingTime", + "attribute_name": "RemainingTime", + "value": 0 + }, + "1/768/65532": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 65532, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.FeatureMap", + "attribute_name": "FeatureMap", + "value": 25 + }, + "1/768/65533": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 5 + }, + "1/768/65528": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [] + }, + "1/768/65529": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 71, 75, 76] + }, + "1/768/65531": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 768, + "cluster_type": "chip.clusters.Objects.ColorControl", + "cluster_name": "ColorControl", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.ColorControl.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [ + 0, 3, 4, 7, 1, 16384, 8, 15, 16385, 16386, 16387, 16388, 16389, 16390, + 16394, 16, 16395, 16396, 16397, 16400, 2, 65528, 65529, 65531, 65532, + 65533 + ] + }, + "1/8/0": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 8, + "cluster_type": "chip.clusters.Objects.LevelControl", + "cluster_name": "LevelControl", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.LevelControl.Attributes.CurrentLevel", + "attribute_name": "CurrentLevel", + "value": 128 + }, + "1/8/2": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 8, + "cluster_type": "chip.clusters.Objects.LevelControl", + "cluster_name": "LevelControl", + "attribute_id": 2, + "attribute_type": "chip.clusters.Objects.LevelControl.Attributes.MinLevel", + "attribute_name": "MinLevel", + "value": 1 + }, + "1/8/3": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 8, + "cluster_type": "chip.clusters.Objects.LevelControl", + "cluster_name": "LevelControl", + "attribute_id": 3, + "attribute_type": "chip.clusters.Objects.LevelControl.Attributes.MaxLevel", + "attribute_name": "MaxLevel", + "value": 254 + }, + "1/8/1": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 8, + "cluster_type": "chip.clusters.Objects.LevelControl", + "cluster_name": "LevelControl", + "attribute_id": 1, + "attribute_type": "chip.clusters.Objects.LevelControl.Attributes.RemainingTime", + "attribute_name": "RemainingTime", + "value": 0 + }, + "1/8/17": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 8, + "cluster_type": "chip.clusters.Objects.LevelControl", + "cluster_name": "LevelControl", + "attribute_id": 17, + "attribute_type": "chip.clusters.Objects.LevelControl.Attributes.OnLevel", + "attribute_name": "OnLevel", + "value": null + }, + "1/8/15": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 8, + "cluster_type": "chip.clusters.Objects.LevelControl", + "cluster_name": "LevelControl", + "attribute_id": 15, + "attribute_type": "chip.clusters.Objects.LevelControl.Attributes.Options", + "attribute_name": "Options", + "value": 0 + }, + "1/8/16384": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 8, + "cluster_type": "chip.clusters.Objects.LevelControl", + "cluster_name": "LevelControl", + "attribute_id": 16384, + "attribute_type": "chip.clusters.Objects.LevelControl.Attributes.StartUpCurrentLevel", + "attribute_name": "StartUpCurrentLevel", + "value": 1 + }, + "1/8/65532": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 8, + "cluster_type": "chip.clusters.Objects.LevelControl", + "cluster_name": "LevelControl", + "attribute_id": 65532, + "attribute_type": "chip.clusters.Objects.LevelControl.Attributes.FeatureMap", + "attribute_name": "FeatureMap", + "value": 3 + }, + "1/8/65533": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 8, + "cluster_type": "chip.clusters.Objects.LevelControl", + "cluster_name": "LevelControl", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.LevelControl.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 5 + }, + "1/8/65528": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 8, + "cluster_type": "chip.clusters.Objects.LevelControl", + "cluster_name": "LevelControl", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.LevelControl.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [] + }, + "1/8/65529": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 8, + "cluster_type": "chip.clusters.Objects.LevelControl", + "cluster_name": "LevelControl", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.LevelControl.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [0, 1, 2, 3, 4, 5, 6, 7] + }, + "1/8/65531": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 8, + "cluster_type": "chip.clusters.Objects.LevelControl", + "cluster_name": "LevelControl", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.LevelControl.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [0, 2, 3, 1, 17, 15, 16384, 65528, 65529, 65531, 65532, 65533] + }, + "1/80/0": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 80, + "cluster_type": "chip.clusters.Objects.ModeSelect", + "cluster_name": "ModeSelect", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.ModeSelect.Attributes.Description", + "attribute_name": "Description", + "value": "Lighting" + }, + "1/80/1": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 80, + "cluster_type": "chip.clusters.Objects.ModeSelect", + "cluster_name": "ModeSelect", + "attribute_id": 1, + "attribute_type": "chip.clusters.Objects.ModeSelect.Attributes.StandardNamespace", + "attribute_name": "StandardNamespace", + "value": 0 + }, + "1/80/2": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 80, + "cluster_type": "chip.clusters.Objects.ModeSelect", + "cluster_name": "ModeSelect", + "attribute_id": 2, + "attribute_type": "chip.clusters.Objects.ModeSelect.Attributes.SupportedModes", + "attribute_name": "SupportedModes", + "value": [ + { + "label": "Dark", + "mode": 0, + "semanticTags": [] + }, + { + "label": "Medium", + "mode": 1, + "semanticTags": [] + }, + { + "label": "Light", + "mode": 2, + "semanticTags": [] + } + ] + }, + "1/80/3": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 80, + "cluster_type": "chip.clusters.Objects.ModeSelect", + "cluster_name": "ModeSelect", + "attribute_id": 3, + "attribute_type": "chip.clusters.Objects.ModeSelect.Attributes.CurrentMode", + "attribute_name": "CurrentMode", + "value": 0 + }, + "1/80/5": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 80, + "cluster_type": "chip.clusters.Objects.ModeSelect", + "cluster_name": "ModeSelect", + "attribute_id": 5, + "attribute_type": "chip.clusters.Objects.ModeSelect.Attributes.OnMode", + "attribute_name": "OnMode", + "value": 0 + }, + "1/80/65532": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 80, + "cluster_type": "chip.clusters.Objects.ModeSelect", + "cluster_name": "ModeSelect", + "attribute_id": 65532, + "attribute_type": "chip.clusters.Objects.ModeSelect.Attributes.FeatureMap", + "attribute_name": "FeatureMap", + "value": 1 + }, + "1/80/65533": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 80, + "cluster_type": "chip.clusters.Objects.ModeSelect", + "cluster_name": "ModeSelect", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.ModeSelect.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 1 + }, + "1/80/65528": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 80, + "cluster_type": "chip.clusters.Objects.ModeSelect", + "cluster_name": "ModeSelect", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.ModeSelect.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [] + }, + "1/80/65529": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 80, + "cluster_type": "chip.clusters.Objects.ModeSelect", + "cluster_name": "ModeSelect", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.ModeSelect.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [0] + }, + "1/80/65531": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 80, + "cluster_type": "chip.clusters.Objects.ModeSelect", + "cluster_name": "ModeSelect", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.ModeSelect.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [0, 1, 2, 3, 5, 65528, 65529, 65531, 65532, 65533] + }, + "1/3/0": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 3, + "cluster_type": "chip.clusters.Objects.Identify", + "cluster_name": "Identify", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.Identify.Attributes.IdentifyTime", + "attribute_name": "IdentifyTime", + "value": 0 + }, + "1/3/1": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 3, + "cluster_type": "chip.clusters.Objects.Identify", + "cluster_name": "Identify", + "attribute_id": 1, + "attribute_type": "chip.clusters.Objects.Identify.Attributes.IdentifyType", + "attribute_name": "IdentifyType", + "value": 1 + }, + "1/3/65532": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 3, + "cluster_type": "chip.clusters.Objects.Identify", + "cluster_name": "Identify", + "attribute_id": 65532, + "attribute_type": "chip.clusters.Objects.Identify.Attributes.FeatureMap", + "attribute_name": "FeatureMap", + "value": 0 + }, + "1/3/65533": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 3, + "cluster_type": "chip.clusters.Objects.Identify", + "cluster_name": "Identify", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.Identify.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 4 + }, + "1/3/65528": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 3, + "cluster_type": "chip.clusters.Objects.Identify", + "cluster_name": "Identify", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.Identify.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [] + }, + "1/3/65529": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 3, + "cluster_type": "chip.clusters.Objects.Identify", + "cluster_name": "Identify", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.Identify.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [0, 64] + }, + "1/3/65531": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 3, + "cluster_type": "chip.clusters.Objects.Identify", + "cluster_name": "Identify", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.Identify.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [0, 1, 65528, 65529, 65531, 65532, 65533] + }, + "1/4/0": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 4, + "cluster_type": "chip.clusters.Objects.Groups", + "cluster_name": "Groups", + "attribute_id": 0, + "attribute_type": "chip.clusters.Objects.Groups.Attributes.NameSupport", + "attribute_name": "NameSupport", + "value": 0 + }, + "1/4/65532": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 4, + "cluster_type": "chip.clusters.Objects.Groups", + "cluster_name": "Groups", + "attribute_id": 65532, + "attribute_type": "chip.clusters.Objects.Groups.Attributes.FeatureMap", + "attribute_name": "FeatureMap", + "value": 0 + }, + "1/4/65533": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 4, + "cluster_type": "chip.clusters.Objects.Groups", + "cluster_name": "Groups", + "attribute_id": 65533, + "attribute_type": "chip.clusters.Objects.Groups.Attributes.ClusterRevision", + "attribute_name": "ClusterRevision", + "value": 4 + }, + "1/4/65528": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 4, + "cluster_type": "chip.clusters.Objects.Groups", + "cluster_name": "Groups", + "attribute_id": 65528, + "attribute_type": "chip.clusters.Objects.Groups.Attributes.GeneratedCommandList", + "attribute_name": "GeneratedCommandList", + "value": [0, 1, 2, 3] + }, + "1/4/65529": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 4, + "cluster_type": "chip.clusters.Objects.Groups", + "cluster_name": "Groups", + "attribute_id": 65529, + "attribute_type": "chip.clusters.Objects.Groups.Attributes.AcceptedCommandList", + "attribute_name": "AcceptedCommandList", + "value": [0, 5, 2, 4, 3, 1] + }, + "1/4/65531": { + "node_id": 1, + "endpoint": 1, + "cluster_id": 4, + "cluster_type": "chip.clusters.Objects.Groups", + "cluster_name": "Groups", + "attribute_id": 65531, + "attribute_type": "chip.clusters.Objects.Groups.Attributes.AttributeList", + "attribute_name": "AttributeList", + "value": [0, 65528, 65529, 65531, 65532, 65533] + } + }, + "endpoints": [0, 1], + "root_device_type_instance": null, + "aggregator_device_type_instance": null, + "device_type_instances": [null], + "node_devices": [null], + "_type": "matter_server.common.models.node.MatterNode" +} diff --git a/tests/components/matter/test_light.py b/tests/components/matter/test_light.py index 883eedaefb7..1a55bf770cb 100644 --- a/tests/components/matter/test_light.py +++ b/tests/components/matter/test_light.py @@ -20,7 +20,7 @@ async def light_node_fixture( ) -> MatterNode: """Fixture for a light node.""" return await setup_integration_with_node_fixture( - hass, "dimmable-light", matter_client + hass, "extended-color-light", matter_client ) @@ -30,22 +30,13 @@ async def test_turn_on( light_node: MatterNode, ) -> None: """Test turning on a light.""" - state = hass.states.get("light.mock_dimmable_light") - assert state - assert state.state == "on" - - set_node_attribute(light_node, 1, 6, 0, False) - await trigger_subscription_callback(hass, matter_client) - - state = hass.states.get("light.mock_dimmable_light") - assert state - assert state.state == "off" + # OnOff test await hass.services.async_call( "light", "turn_on", { - "entity_id": "light.mock_dimmable_light", + "entity_id": "light.mock_extended_color_light", }, blocking=True, ) @@ -58,11 +49,12 @@ async def test_turn_on( ) matter_client.send_device_command.reset_mock() + # Brightness test await hass.services.async_call( "light", "turn_on", { - "entity_id": "light.mock_dimmable_light", + "entity_id": "light.mock_extended_color_light", "brightness": 128, }, blocking=True, @@ -77,6 +69,154 @@ async def test_turn_on( transitionTime=0, ), ) + matter_client.send_device_command.reset_mock() + + # HS Color test + await hass.services.async_call( + "light", + "turn_on", + { + "entity_id": "light.mock_extended_color_light", + "hs_color": [0, 0], + }, + blocking=True, + ) + + assert matter_client.send_device_command.call_count == 2 + matter_client.send_device_command.assert_has_calls( + [ + call( + node_id=light_node.node_id, + endpoint=1, + command=clusters.ColorControl.Commands.MoveToHueAndSaturation( + hue=0, + saturation=0, + transitionTime=0, + ), + ), + call( + node_id=light_node.node_id, + endpoint=1, + command=clusters.OnOff.Commands.On(), + ), + ] + ) + matter_client.send_device_command.reset_mock() + + # XY Color test + await hass.services.async_call( + "light", + "turn_on", + { + "entity_id": "light.mock_extended_color_light", + "xy_color": [0.5, 0.5], + }, + blocking=True, + ) + + assert matter_client.send_device_command.call_count == 2 + matter_client.send_device_command.assert_has_calls( + [ + call( + node_id=light_node.node_id, + endpoint=1, + command=clusters.ColorControl.Commands.MoveToColor( + colorX=(0.5 * 65536), + colorY=(0.5 * 65536), + transitionTime=0, + ), + ), + call( + node_id=light_node.node_id, + endpoint=1, + command=clusters.OnOff.Commands.On(), + ), + ] + ) + matter_client.send_device_command.reset_mock() + + # Color Temperature test + await hass.services.async_call( + "light", + "turn_on", + { + "entity_id": "light.mock_extended_color_light", + "color_temp": 300, + }, + blocking=True, + ) + + assert matter_client.send_device_command.call_count == 2 + matter_client.send_device_command.assert_has_calls( + [ + call( + node_id=light_node.node_id, + endpoint=1, + command=clusters.ColorControl.Commands.MoveToColorTemperature( + colorTemperature=300, + transitionTime=0, + ), + ), + call( + node_id=light_node.node_id, + endpoint=1, + command=clusters.OnOff.Commands.On(), + ), + ] + ) + matter_client.send_device_command.reset_mock() + + state = hass.states.get("light.mock_extended_color_light") + assert state + assert state.state == "on" + + # HS Color Test + set_node_attribute(light_node, 1, 768, 8, 0) + set_node_attribute(light_node, 1, 768, 1, 50) + set_node_attribute(light_node, 1, 768, 0, 100) + await trigger_subscription_callback(hass, matter_client) + + state = hass.states.get("light.mock_extended_color_light") + assert state + assert state.attributes["color_mode"] == "hs" + assert state.attributes["hs_color"] == (141.732, 19.685) + + # XY Color Test + set_node_attribute(light_node, 1, 768, 8, 1) + set_node_attribute(light_node, 1, 768, 3, 50) + set_node_attribute(light_node, 1, 768, 4, 100) + await trigger_subscription_callback(hass, matter_client) + + state = hass.states.get("light.mock_extended_color_light") + assert state + assert state.attributes["color_mode"] == "xy" + assert state.attributes["xy_color"] == (0.0007630, 0.001526) + + # Color Temperature Test + set_node_attribute(light_node, 1, 768, 8, 2) + set_node_attribute(light_node, 1, 768, 7, 100) + await trigger_subscription_callback(hass, matter_client) + + state = hass.states.get("light.mock_extended_color_light") + assert state + assert state.attributes["color_mode"] == "color_temp" + assert state.attributes["color_temp"] == 100 + + # Brightness state test + set_node_attribute(light_node, 1, 8, 0, 50) + await trigger_subscription_callback(hass, matter_client) + + state = hass.states.get("light.mock_extended_color_light") + assert state + assert state.attributes["brightness"] == 49 + + # Off state test + set_node_attribute(light_node, 1, 6, 0, False) + await trigger_subscription_callback(hass, matter_client) + + state = hass.states.get("light.mock_extended_color_light") + assert state + assert state.state == "off" async def test_turn_off( @@ -85,7 +225,7 @@ async def test_turn_off( light_node: MatterNode, ) -> None: """Test turning off a light.""" - state = hass.states.get("light.mock_dimmable_light") + state = hass.states.get("light.mock_extended_color_light") assert state assert state.state == "on" @@ -93,7 +233,7 @@ async def test_turn_off( "light", "turn_off", { - "entity_id": "light.mock_dimmable_light", + "entity_id": "light.mock_extended_color_light", }, blocking=True, )