+
     vi4  c                   s    R t ^ RIt^ RIHt ^ RIHt ^ RIHtHt ^ RI	H
t
HtHtHt ]P                  ! ]4      t^At^tRtRtRtRtRt^t^!tRtRtRtR	tR
tRtRt Rt! ! R R]4      t"R# )zliquidctl driver for the ASUS Ryujin II and Ryujin III EXTREME / 360 liquid coolers.

Copyright Florian Freudiger and contributors
SPDX-License-Identifier: GPL-3.0-or-later
N)List)UsbHidDriver)ExpectationNotMetNotSupportedByDriver)clamp
u16le_fromrpadlistfraction_of_bytezFirmware versionzLiquid temperaturez
Pump speedz	Pump dutyzPump fan speedzPump fan dutyzExternal fan {} speedzExternal fan dutyc                   s  a a ] tR t^(t oRtRRRR^R^R^R^R	^ /3RR
RR^ R^R^
R^R	^/3RRRR^ R^R^
R^R	^/3RRRR^ R^R^
R^R	^/3RRRR^ R^R^
R^R	^/3.tV 3R ltR tV3R lR ltV3R lR lt	V3R lR lt
V3R lR ltR tV3R lR ltV3R lR  ltV3R! lR" ltV3R# lR$ ltR% tR& tV3R' lR( ltR.V3R) lR* lltV3R+ lR, ltR-tVtV ;t# )/
AsusRyujinzIASUS Ryujin II & Ryujin III Extreme / 360 / White Edition liquid coolers.i  i  zASUS Ryujin II 360	fan_countpump_speed_offsetpump_fan_speed_offsettemp_offsetduty_channeli  zASUS Ryujin III Extremei  zASUS Ryujin III 360i  zASUS Ryujin III EVAi  zASUS Ryujin III Whitec                sf   < \         S	V `  ! W3/ VB  W0n        W@n        WPn        W`n        Wpn        R # N)Zsuper__init__
_fan_count_pump_speed_offset_pump_fan_speed_offset_temp_offset_duty_channel)
selfdeviceZdescriptionr	   r
   r   r   r   kwargs	__class__s
   &&&&&&&&,A/usr/lib/python3.14/site-packages/liquidctl/driver/asus_ryujin.pyr   ZAsusRyujin.__init__j   s4     	77#"3&;#')    c                s    V P                   ! \         p\        R P                  \	        \
        VR,          4      4      R 3.# )Z :i   i   N)_request_REQUEST_GET_FIRMWARE_STATUS_FIRMWAREZjoinZmapZchr)r   r   msgs   &, r   
initializeZAsusRyujin.initialize}   s5    mm23!2773sCI+>#?DEEr   c                s&   < V ^8  d   QhRS[ S[ 3/#    returnintformat__classdict__   "r   __annotate__AsusRyujin.__annotate__   s      3* r   c                sL    V P                   ! \         pV^,          V^,          3# )z,Get current pump and embedded fan duty in %.)r   _REQUEST_GET_COOLER_DUTYr   r      & r   _get_cooler_dutyZAsusRyujin._get_cooler_duty   s#    mm561vs1v~r   c                s*   < V ^8  d   QhRS[ S[ S[ 3/# r    r#   r%   r(   r   r)   r*      s     7 7S#sO 7r   c                s    V P                   ! \         pWP                  ,          WP                  ^,           ,          ^
,          ,           p\        WP                  4      p\        WP
                  4      pW#V3# )z<Get current liquid temperature, pump and embedded fan speed.)r   _REQUEST_GET_COOLER_STATUSr   r   r   r   )r   r   liquid_temp
pump_speedpump_fan_speeds   &    r   _get_cooler_statusZAsusRyujin._get_cooler_status   sb    mm78++,s3D3Dq3H/IB/NN%<%<=
#C)D)DE66r   c                0   < V ^8  d   QhRS[ S[,          /# r    r    r$   r%   r(   r   r)   r*      s     0 0S	 0r   c                s    V P                   ! \         p\        V^4      p\        V^4      p\        V^	4      p\        V^4      pW#WE.# )z%Get AIO controller fan speeds in rpm.)r   _REQUEST_GET_CONTROLLER_SPEEDr   )r   r   Zspeed1Zspeed2Zspeed3Zspeed4s   &     r   _get_controller_speedsZ!AsusRyujin._get_controller_speeds   sL    mm:;C#C#C#C#//r   c                    < V ^8  d   QhRS[ /# r    r#   r%   r(   r   r)   r*      s     * *c *r   c                sh    V P                   ! \         p\        V^,          ^,          ^d,          4      # )z!Get AIO controller fan duty in %.)r   _REQUEST_GET_CONTROLLER_DUTYZroundr,   r-   r   _get_controller_dutyZAsusRyujin._get_controller_duty   s)    mm9:SVd]S())r   c                s   V P                  4       w  r#V P                  4       w  rEp\        VR 3\        VR3\        VR3\
        VR3\        VR3.pV P                  ^ 8X  d   V# V P                  4       pV P                  4       p	VP                  \        VR34       \        V	4       F3  w  rVP                  \        P                  V
^,           4      VR34       K5  	  V# )u   °CZ%Zrpm)r.   r3   _STATUS_TEMPERATURE_STATUS_PUMP_DUTY_STATUS_PUMP_SPEED_STATUS_COOLER_FAN_DUTY_STATUS_COOLER_FAN_SPEEDr   r:   r7   Zappend_STATUS_CONTROLLER_FAN_DUTYZ	enumerate_STATUS_CONTROLLER_FAN_SPEEDr&   )r   r   	pump_dutyfan_dutyr0   r1   r2   ZstatusZcontroller_dutyZcontroller_speedsZiZcontroller_speeds   &,          r   
get_statusZAsusRyujin.get_status   s    "335	262I2I2K/ !+u5	3/U3$h4%~u=
 ??aM335 7792OSIJ#,->#?AMM7>>q1uEGWY^_` $@ r   c                s&   < V ^8  d   QhRS[ RS[ /# )r!   rB   rC   r#   r%   r(   r   r)   r*      s     _ _C _3 _r   c                sT    V P                  \        \        V P                  W.4       R # r   )_write_PREFIX_CMD_SET_COOLER_SPEEDr   )r   rB   rC      &&&r   _set_cooler_dutiesZAsusRyujin._set_cooler_duties   s    W3T5G5G]^r   c                r8   r!   dutyr#   r%   r(   r   r)   r*      s     0 0# 0r   c                s\    V P                  4       w  r#W8X  d   R # V P                  W4       R # r   r.   rI   r   rK   rB   rC      &&  r   _set_cooler_pump_dutyZ AsusRyujin._set_cooler_pump_duty   s*    "335	/r   c                r8   rJ   r#   r%   r(   r   r)   r*      s     1 1 1r   c                s\    V P                  4       w  r#W8X  d   R # V P                  W!4       R # r   rL   rM   rN   r   _set_cooler_fan_dutyZAsusRyujin._set_cooler_fan_duty   s*    "335		0r   c                r8   rJ   r#   r%   r(   r   r)   r*      s     L L Lr   c                sZ    \        VR 7      pV P                  \        \        ^ ^ V.4       R# ))Z
percentageN)r   rE   rF   _CMD_SET_CONTROLLER_SPEED)r   rK      &&r   _set_controller_dutyZAsusRyujin._set_controller_duty   s$    40W7tTJKr   c                sN   \        V^ ^d4      pRV P                  .RV P                  ./pV P                  ^ 8  d7   VP	                  RV P                  V P
                  .RV P
                  ./4       VP                  V4      pVf   \        RV 24      hV F  pV! V4       K  	  R# )    Zpumpzpump-fanZfanszexternal-fansNzinvalid channel: )r   rO   rP   r   ZupdaterS   ZgetZ
ValueError)r   channelrK   r   Zchannel_handlersZhandlersZhandlers   &&&,   r   set_fixed_speedZAsusRyujin.set_fixed_speed   s    T1c"T//0223

 ??Q##T668Q8QR#d&?&?%@ $''00	:;;GDM  r   c                s    \        4       hr   )r   )r   rU   ZmodeZvaluer   s   &&&&,r   
set_screenZAsusRyujin.set_screen   s    "$$r   c                s<   < V ^8  d   QhRS[ RS[ RS[S[ ,          /# )r!   request_headerresponse_headerr"   )r$   r    r%   r(   r   r)   r*      s&     + +s +S +T#Y +r   c                s    V P                   P                  4        V P                  \        V.4       V P	                  V4      # r   )r   Zclear_enqueued_reportsrE   rF   _read)r   rX   rY   rH   r   r   ZAsusRyujin._request   s2    **,Wn-.zz/**r   c                r4   r    r5   r%   r(   r   r)   r*      s      T#Y r   c                s    V P                   P                  \        4      pV^ ,          \        8w  d   \	        R4      hVe   V^,          V8w  d   \	        R4      hV# )rT   zUnexpected report prefixzUnexpected report header)r   Zread_REPORT_LENGTHrF   r   )r   Zexpected_headerr   s   && r   rZ   ZAsusRyujin._read   sP    kk~.q6W#$>??&3q6_+D#$>??
r   c                r4   )r!   datar5   r%   r(   r   r)   r*      s     = =49 =r   c                sZ    V P                   P                  \        V\        ^ 4      4       R# )rT   N)r   Zwriter   r[   )r   r\   rR   r   rE   ZAsusRyujin._write   s    (4;<r   )r   r   r   r   r   r   )__name__Z
__module__Z__qualname__Z__firstlineno____doc__Z_MATCHESr   r   r.   r3   r7   r:   rD   rI   rO   rP   rS   rV   rW   r   rZ   rE   Z__static_attributes__Z__classdictcell__Z__classcell__)r   r'   s   @@r   r   r   (   s    S  Q#Q'q		
 %Q#Q'q		
 !Q#Q'q		
 !Q#Q'q		
 #Q#Q'q		
c=H~*&F 
7 70 0* *
2_ _0 01 1L L,%+ +
 = = =r   r   )i   r!   )i   i   )i   i   )i   i!   )i   i    )#r^   ZloggingZtypingr    Zliquidctl.driver.usbr   Zliquidctl.errorr   r   Zliquidctl.utilr   r   r   r   Z	getLoggerr]   Z_LOGGERr[   rF   r   r/   r+   r9   r6   rG   rQ   r   r;   r=   r<   r?   r>   rA   r@   r   ) r   r   <module>r_      s      - C H H


H
%
 % ) ' +  ,     % * !  + ) 6 1 P= P=r   