File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
zha/application/platforms/light Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -798,6 +798,21 @@ async def test_zha_group_light_entity(
798
798
# test that the lights were created and are off
799
799
assert bool (entity .state ["on" ]) is False
800
800
801
+ # Group entities do not support state restoration
802
+ entity .restore_external_state_attributes (
803
+ state = True ,
804
+ off_with_transition = False ,
805
+ off_brightness = 12 ,
806
+ brightness = 34 ,
807
+ color_temp = 500 ,
808
+ xy_color = (1 , 2 ),
809
+ hs_color = (3 , 4 ),
810
+ color_mode = ColorMode .XY ,
811
+ effect = "colorloop" ,
812
+ )
813
+
814
+ assert bool (entity .state ["on" ]) is False
815
+
801
816
# test turning the lights on and off from the client
802
817
await async_test_on_off_from_client (zha_gateway , group_cluster_on_off , entity )
803
818
await _async_shift_time (zha_gateway )
Original file line number Diff line number Diff line change @@ -1394,3 +1394,19 @@ def _make_members_assume_group_state(
1394
1394
1395
1395
for platform_entity in self .group .get_platform_entities (Light .PLATFORM ):
1396
1396
platform_entity ._assume_group_state (update_params )
1397
+
1398
+ def restore_external_state_attributes (
1399
+ self ,
1400
+ * ,
1401
+ state : bool | None ,
1402
+ off_with_transition : bool | None ,
1403
+ off_brightness : int | None ,
1404
+ brightness : int | None ,
1405
+ color_temp : int | None ,
1406
+ xy_color : tuple [float , float ] | None ,
1407
+ hs_color : tuple [float , float ] | None ,
1408
+ color_mode : ColorMode | None ,
1409
+ effect : str | None ,
1410
+ ) -> None :
1411
+ """Restore extra state attributes."""
1412
+ # Groups do not restore external state attributes
You can’t perform that action at this time.
0 commit comments