@@ -720,25 +720,23 @@ def is_on(self) -> bool | None:
720720
721721 def turn_on (self , ** kwargs : Any ) -> None :
722722 """Turn on or control the light."""
723- commands = [
724- self ._switch_wrapper .get_update_command (self .device , True ),
725- ]
723+ commands = self ._switch_wrapper .get_update_commands (self .device , True )
726724
727725 if self ._color_mode_wrapper and (
728726 ATTR_WHITE in kwargs or ATTR_COLOR_TEMP_KELVIN in kwargs
729727 ):
730- commands += [
731- self ._color_mode_wrapper .get_update_command (
728+ commands . extend (
729+ self ._color_mode_wrapper .get_update_commands (
732730 self .device , WorkMode .WHITE
733731 ),
734- ]
732+ )
735733
736734 if self ._color_temp_wrapper and ATTR_COLOR_TEMP_KELVIN in kwargs :
737- commands += [
738- self ._color_temp_wrapper .get_update_command (
735+ commands . extend (
736+ self ._color_temp_wrapper .get_update_commands (
739737 self .device , kwargs [ATTR_COLOR_TEMP_KELVIN ]
740738 )
741- ]
739+ )
742740
743741 if self ._color_data_wrapper and (
744742 ATTR_HS_COLOR in kwargs
@@ -750,23 +748,23 @@ def turn_on(self, **kwargs: Any) -> None:
750748 )
751749 ):
752750 if self ._color_mode_wrapper :
753- commands += [
754- self ._color_mode_wrapper .get_update_command (
751+ commands . extend (
752+ self ._color_mode_wrapper .get_update_commands (
755753 self .device , WorkMode .COLOUR
756754 ),
757- ]
755+ )
758756
759757 if not (brightness := kwargs .get (ATTR_BRIGHTNESS )):
760758 brightness = self .brightness or 0
761759
762760 if not (color := kwargs .get (ATTR_HS_COLOR )):
763761 color = self .hs_color or (0 , 0 )
764762
765- commands += [
766- self ._color_data_wrapper .get_update_command (
763+ commands . extend (
764+ self ._color_data_wrapper .get_update_commands (
767765 self .device , (color , brightness )
768766 ),
769- ]
767+ )
770768
771769 elif self ._brightness_wrapper and (
772770 ATTR_BRIGHTNESS in kwargs or ATTR_WHITE in kwargs
@@ -776,9 +774,9 @@ def turn_on(self, **kwargs: Any) -> None:
776774 else :
777775 brightness = kwargs [ATTR_WHITE ]
778776
779- commands += [
780- self ._brightness_wrapper .get_update_command (self .device , brightness ),
781- ]
777+ commands . extend (
778+ self ._brightness_wrapper .get_update_commands (self .device , brightness ),
779+ )
782780
783781 self ._send_command (commands )
784782
0 commit comments