+
     viy(  c                   s>   R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ]P                  ! ]4      tRt^t^t^t^?t^`tRR"RR#R	R$R
R%RR&RR'RR(RR)/tRR*RR+RR,RR-RR.RR//tRR0RR1RR2RR3RR4RR5/tRR6RR0RR1RR2RR3RR4/tRR7RR8RR9RR:RR;RR</t]! R. R=O4      t]! R^R^ ^ ^ RRR7      ]! R^R^ ^ ^ZRRR7      ]! R^R^ ^ ^ZR]R7      ]! R^R^^ ^dR]R7      ]! R^R^^ ^dR]R7      ]! R^R^ ^^dR]R7      3 U u/ uF  p V P4                  V bK  	  up t ! R  R!]4      tR# u up i )>a  liquidctl driver for Gigabyte RGB Fusion 2.0 USB controllers.

Supported controllers:

- ITE 5702: found in Gigabyte Z490 Vision D
- ITE 8297: found in Gigabyte X570 Aorus Elite

Copyright CaseySJ, Jonas Malaco and contributors
SPDX-License-Identifier: GPL-3.0-or-later
N)
namedtuple)UsbHidDriverNotSupportedByDevice)clampi  Zled1Zled2Zled3Zled4Zled5Zled6Zled7Zled8ZslowestZslowernormalZfasterZfastestZ	ludicrouszslower 
_ColorModeZoffF)pulsesflash_countcycle_countmax_brightnesstakes_colorspeed_valuesZfixedTZpulseZflashzdouble-flashzcolor-cyclec                   s   a a ] tR t^ct oRtRRR/ 3RRR/ 3.t]V 3R l4       tR tR	 t	RR
 lt
R tR tR tR tR tR tR tRtVtV ;t# )
RgbFusion2z=liquidctl driver for Gigabyte RGB Fusion 2.0 USB controllers.i  iW  z'Gigabyte RGB Fusion 2.0 5702 Controlleri  z'Gigabyte RGB Fusion 2.0 8297 Controllerc              +  s   <"   VP                   R,          \        8X  d   VP                   R,          \        8X  d   R# \        SV `  ! V3/ VB  Rj  xL
  R#  L5i)zProbe `handle` and yield corresponding driver instances.

These devices have multiple top-level HID usages, and HidapiDevice
handles matching other usages have to be ignored.
Z
usage_pageZusageN)Zhidinfo_USAGE_PAGE_OTHER_USAGEZsuperprobe)ZclsZhandlekwargs	__class__s   &&,A/usr/lib/python3.14/site-packages/liquidctl/driver/rgb_fusion2.pyr   ZRgbFusion2.probek   sD      NN<(K7w'<77=26222s   AAAAc                sV   V P                  \        \        .4       V P                  \        4      pV^ ,          \        ^ 39   d   V^,          ^8X  g   Q hVP	                  ^ ^4      p\        \        V^V 4      RRR7      p\        VR,          4      pRVR3RRP                  ! V!  R3.# )	zInitialize the device.

Returns a list of `(property, value, unit)` tuples, containing the
firmware version and other useful information provided by the hardware.
ZasciiZreplace)Zerrors:      NzHardware nameZ zFirmware versionz{}.{}.{}.{})	_send_feature_report
_REPORT_ID	_INIT_CMD_get_feature_reportZindexZstrZbytesZtupleZformat)selfr   dataZnullZdev_nameZ
fw_versions   &,    r   
initializeZRgbFusion2.initialize   s     	!!:y"9:''
3 Aw:q/)d1go==zz!R uT"T]+WYG49%
h+!5!5z!BBG
 	
    c                sF    \         P                  RV P                  4       . # )zGet a status report.

Currently returns an empty list, but this behavior is not guaranteed as
in the future the device may start to report useful information.  A
non-empty list would contain `(property, value, unit)` tuples.
z$status reports not available from %s)_LOGGERZinfoZdescription)r   r   s   &,r   
get_statusZRgbFusion2.get_status   s     	;T=M=MN	r   c                sl   \         V,          p\        V4      pVP                  '       d    \        V4      w  rgpWV3p	MRp	\        R V 4       4      p
V
'       d"   \        P                  RVP                  V
4       \        ^d^ VP                  4      p\        ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ VP                  V^ .pW,          pV. RO,          pVP                  '       d   WP                  V,          ,          pMV. R	O,          pV^ ^ VP                  \!        VP"                  4      VP$                  .,          pVR8X  d   \&        P)                  4       pM\&        V,          3pV F  w  rW3VR&   V P+                  V4       K  	  V P-                  4        R#   \         d    \        RTP                   24      Rhi ; i)
u  Set the color mode for a specific channel.

Up to eight individual channels are available, named 'led1' through
'led8'.  In addition to these, the 'sync' channel can be used to apply
the same settings to all channels.

The table bellow summarizes the available channels.

| Mode         | Colors required | Speed is customizable |
| ------------ | --------------- | --------------------- |
| off          |            zero |                    no |
| fixed        |             one |                    no |
| pulse        |             one |                   yes |
| flash        |             one |                   yes |
| double-flash |             one |                   yes |
| color-cycle  |            zero |                   yes |

`colors` should be an iterable of zero or one `[red, blue, green]`
triples, where each red/blue/green component is a value in the range
0–255.

`speed`, when supported by the `mode`, can be one of: `slowest`,
`slower`, `normal` (default), `faster`, `fastest` or `ludicrous`.
zone color required for mode=Nc              3   s&   "   T F  p^x  K	  	  R# 5i)   N )Z.0_s   & r   Z	<genexpr>Z'RgbFusion2.set_color.<locals>.<genexpr>   s     *6a6s   z(too many colors for mode=%s, dropping %dZsync:r       N)    r$   r$   )r$   r$   r$   r$   r$   )r$   r$   r$   r$   r$   r$   )_COLOR_MODESZiterr   ZnextZStopIterationZ
ValueErrornameZsumr   Zwarningr   r
   r   valuer   r	   Zintr   r   _COLOR_CHANNELSvaluesr   _execute_report)r   channelmodeZcolorsZspeedr   ZrZgZbZsingle_colorZ	remainingZ
brightnessr   Zselected_channelsaddr1Zaddr2s   &&&&&,          r   	set_colorZRgbFusion2.set_color   s   4 D!fWv,a !ay %L*6**	OOF		S\]34#6#67
D$dD$dD$**j$@..%%e,,D88DtT--s4;;/?AQAQRRf / 6 6 8!0!9 ;-LEDI%%d+ . 	5 ! W #?		{!KLRVVWs   F %F3c                    \        4       hzNot supported by this device.r   )r   r+   Zprofiler      &&&,r   set_speed_profileZRgbFusion2.set_speed_profile       "$$r   c                r/   r0   r   )r   r+   Zdutyr   r1   r   set_fixed_speedZRgbFusion2.set_fixed_speed   r3   r   c                s    \         P                  4        F  w  rV P                  \        V^ .4       K  	  V P	                  4        R# )zReset all LED channels.N)r(   r)   r   r   r*   )r   r-   r"   s   &  r   reset_all_channelsZRgbFusion2.reset_all_channels   s8    '..0HE%%z5!&<= 1r   c                sP    V P                   P                  V\        ^,           4      # )r    )deviceZget_feature_report_REPORT_BYTE_LENGTH)r   Z	report_ids   &&r   r   ZRgbFusion2._get_feature_report   s    {{--i9Lq9PQQr   c                s    ^ .\         ^,           \        V4      ,
          ,          pV P                  P                  W,           4       R# )r$   N)r7   Zlenr6   Zsend_feature_report)r   r   Zpaddings   && r   r   ZRgbFusion2._send_feature_report   s1    %,q03t9<=''7r   c                s6    V P                  \        ^(^.4       R# )z@Request for the previously sent lighting settings to be applied.N)r   r   )r   s   &r   r*   ZRgbFusion2._execute_report   s    !!:tT":;r   c                r/   r0   r   )r   r+   r,   r'   r   s   &&&&,r   
set_screenZRgbFusion2.set_screen   r3   r   r!   )r   )__name__Z
__module__Z__qualname__Z__firstlineno____doc__Z_MATCHESZclassmethodr   r   r   r.   r2   r4   r5   r   r   r*   r8   Z__static_attributes__Z__classdictcell__Z__classcell__)r   Z__classdict__s   @@r   r   r   c   sx     G 
BBG	BBGH
 3 3(
*	;z%%R8<% %r   r   )    r    )i!      )i"   r   )i#   r   )i$   i   )i%   r;   )&   @   )i'   i   )r>      r>   r?   r;   r#   )x      r@   rA   i   r<   )   r   rB   r      r    )   r#   rD   r#   rC   r    )   r#   rE   r#      r    )r;   r#   r;   r#      r    )d   r$   rH   r$   i`   i	   )rH   r$   rH   r$   rG   r   )rH   r$   rH   r$   i      )rH   r$   rH   r$   r   rI   )rH   r$   rH   r$   r>   r?   )rH   r$   rH   r$   r@   rA   )rH   r$   rH   r$   i(   i
   )r@   rA   rB   r   r$   r$   )i~   r   i   r   r$   r$   )iR   r#   i   r<   r$   r$   )i   r<   i   r<   r$   r$   )r=   r<   rF   r    r$   r$   )i   r    ih   r    r$   r$   )r&   r'   r   r   r	   r
   r   r   )r:   ZloggingZsysZcollectionsr    Zliquidctl.driver.usbr   Zliquidctl.errorr   Zliquidctl.utilr   Z	getLoggerr9   r   r   Z_RGB_CONTROL_USAGEr   r   r7   r   r(   Z_PULSE_SPEEDSZ_FLASH_SPEEDSZ_DOUBLE_FLASH_SPEEDSZ_COLOR_CYCLE_SPEEDSr   r&   r%   r   )r,   s   0r   <module>rJ      s(  	  
 " - 0  


H
% 
 	 L
L
L
L
L
L
L
L	 (L(L(L(L(L(L (L(L(L(L(L(L (L(L(L(L(L(L  (L(L(L(L(L(L   '7 8
 	5$u!"#T	K7DA1"$$T	K7D1!"$$]	T7D1!"%4m	U>4!QR"%4FZ	\=$u!QR"%5GZ	\ 	IItO&U% U%'s   4D