+
     ph:%  c                   s    ^ RI t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIH t  ^ RI!H"t" ^ RI#H$t$  ! R R4      t%R# )    N)sleep)Configuration) ConfigurationReloadCommandResult)PrintActiveCommandResult)!PrintCurrentStrategyCommandResult)PrintFanSpeedCommandResult)PrintStrategyListCommandResult)ServicePauseCommandResult)ServiceResumeCommandResult)SetConfigurationCommandResult)StrategyChangeCommandResult)StrategyResetCommandResult)RuntimeResult)StatusRuntimeResult)CommandStatus)InvalidStrategyException)UnknownCommandExceptionc                   s   a  ] tR t^t o RtRtRtRtRt^ t	]
P                  ! ^ .^d,          ^dR7      tRt^ tR tR tR tR tR tR	 tR
 tR tR tR tR tR tR tR tR tRR ltRtV t R# )FanControllerN)ZmaxlenTc                s   Wn         W n        \        V4      V n        Ve   VR8w  d   V P	                  V4       WPn        \        P                  ! V P                  P                  V P                  .R7      pRVn
        VP                  4        R # )NZ )ZtargetargsT)hardware_controllersocket_controllerr   configurationoverwrite_strategyoutput_format	threadingZThreadZstart_server_socketcommand_managerZdaemonZstart)selfr   r   Zconfig_pathstrategy_namer   Zts   &&&&&& =/usr/lib/python3.14/site-packages/fw_fanctrl/FanController.py__init__ZFanController.__init__#   sy    #6 !2*;7$")<##M2*))==&&'
 		    c                6    V P                   P                  4       # N)r   Zget_temperaturer      &r   get_actual_temperatureZ$FanController.get_actual_temperature4   s    ''7799r   c                sH    Wn         V P                  P                  V4       R # r!   )speedr   	set_speed)r   r%      &&r   r&   ZFanController.set_speed7   s    
  **51r   c                r    r!   )r   is_on_acr"   r#   r   r(   ZFanController.is_on_ac;   s    ''0022r   c                H    R V n         V P                  P                  4        R# )FN)activer   pauser"   r#   r   r+   ZFanController.pause>   s      &&(r   c                r)   )TN)r*   r   resumer"   r#   r   r,   ZFanController.resumeB   s      '')r   c                s    WP                   P                  4       9  d   V P                  4        R # V P                   P                  V4      V n        ^ V n        R # r!   )r   get_strategiesclear_overwritten_strategyZget_strategyoverwritten_strategy	timecount)r   r   r'   r   r   Z FanController.overwrite_strategyF   sF     2 2 A A CC++-$($6$6$C$CM$R!r   c                s"    R V n         ^ V n        R # r!   )r/   r0   r"   r#   r   r.   Z(FanController.clear_overwritten_strategyM   s    $(!r   c                s    V P                   e   V P                   # V P                  4       '       d   V P                  P                  4       # V P                  P	                  4       # r!   )r/   r(   r   Zget_default_strategyZget_discharging_strategyr"   r#   r   get_current_strategyZ"FanController.get_current_strategyQ   sO    $$0,,,==??%%::<<!!::<<r   c                s    VP                   R 8X  g#   VP                   R8X  dR   VP                  R8X  dA   V P                  4        \        V P	                  4       P
                  V P                  RJ 4      # VP                   R8X  d   VP                  V P                  P                  4       9  d   \        RVP                   24      hV P                  VP                  4       \        V P	                  4       P
                  V P                  RJ 4      # VP                   R8X  d~   V P                  P                  4        V P                  e&   V P                  V P                  P
                  4       \        V P	                  4       P
                  V P                  RJ 4      # VP                   R8X  d   V P                  4        \        4       # VP                   R8X  dA   V P!                  4        \#        V P	                  4       P
                  V P                  RJ 4      # VP                   R8X  d   VP$                  R	8X  d   V P'                  4       # VP$                  R
8X  d   \)        V P*                  4      # VP$                  R8X  d1   \-        V P	                  4       P
                  V P                  RJ 4      # VP$                  R8X  d-   \/        \1        V P                  P                  4       4      4      # VP$                  R8X  d   \3        \5        V P6                  4      4      # MVP                   R8X  d   V P                  P9                  VP:                  4      V P                  n        V P                  e&   V P                  V P                  P
                  4       V P                  P?                  4        \A        V P	                  4       P
                  \C        V P                  4      V P                  RJ 4      # \E        RVP                    R24      h)ZresetZuseZdefaultStrategyNz#The specified strategy is invalid: reloadr+   r,   printZallr*   Zcurrentlistr%   Z
set_configzUnknown command: 'z', unexpected.)#ZcommandZstrategyr.   r   r1   namer/   r   r-   r   r   r   r2   r   r+   r   r,   r	   Zprint_selectiondump_detailsr   r*   r   r   r4   r   Zstrr%   ZparseZprovided_configZdataZsaver
   varsr   )r   r   r'   r   r   ZFanController.command_managerX   s4   <<7"t||u'<RcAc++--d.G.G.I.N.NPTPiPimqPqrr\\U"}}D$6$6$E$E$GG.1TUYUbUbTc/dee##DMM2.t/H/H/J/O/OQUQjQjnrQrss\\X%%%'((4''(A(A(F(FG3D4M4M4O4T4TVZVoVoswVwxx\\W$JJL,..\\X%KKM-d.G.G.I.N.NPTPiPimqPqrr\\W$##u,((**%%1/<<%%28--/44d6O6OSW6W  %%/5d4;M;M;\;\;^6_``%%01#djj/BB 1\\\)&*&8&8&>&>t?S?S&TD#((4''(A(A(F(FG##%0))+00$t7I7I2JDLeLeimLm  &(:4<<.&WXXr   c                s    V P                    Uu. uF  q"^ 8  g   K  VNK  	  upV) R p\        V4      ^ 8X  d   V P                  4       # \        \	        \        V4      \        V4      ,          ^4      4      # u upi )r    N)temp_historyZlenr$   floatroundZsum)r   time_intervalZxZsliced_temp_historys   &&  r   get_moving_average_temperatureZ,FanController.get_moving_average_temperature   su    *.*;*;E*;Q1uqq*;E}noV"#q(..00U323c:M6NNPQRSS Fs
   A7A7c           	     s^    \        \        \        V P                  V4      V4      ^4      4      # )i   )r9   r:   Zminr<   )r   current_tempr;   s   &&&r   get_effective_temperatureZ'FanController.get_effective_temperature   s(    U3tBB=QS_`bcdeer   c                s   V P                  4       pV P                  WP                  4      pVP                  ^ ,          pVP                  R,          pVP                   F  pWR,          8  d   TpK  Tp M	  W48X  d   VR,          pM`VR,          VR,          ,
          VR,          VR,          ,
          ,          p\	        VR,          WR,          ,
          V,          ,           4      pV P
                  '       d   V P                  V4       R# R# )r    tempr%   Ni)r1   r>   moving_average_intervalZspeed_curveZintr*   r&   )r   r=   current_strategyZ	min_pointZ	max_pointeZ	new_speedZslopes   &&      r   adapt_speedZFanController.adapt_speed   s    44655lDlDlm$003	$004	!--Ai'		 . !!'*Iw')G*<<6ARU^_eUfAfgEIg.,6AR2RV[1[[\I;;;NN9% r   c                sL   V P                  4       pV P                  4       pV P                  VP                  4      pV P	                  W!P                  4      p\        VP                  V P                  R J V P                  VVVV P                  \        V P                  4      4      # r!   )r1   r$   r<   r@   r>   r   r5   r/   r%   r*   r7   r   )r   rA   Zcurrent_temperatureZmoving_average_tempZeffective_temps   &    r   r6   ZFanController.dump_details   s    446"99;"AABRBjBjk778KMuMuv"!!%%-JJKK##$	
 		
r   c                sj    \        V P                  4       P                  V P                  4      4       R # r!   )r3   r6   to_output_formatr   r"   r#   r   print_stateZFanController.print_state   s$    d!2243E3EFGr   c                s|     V P                   '       d   V P                  4       pV P                  V P                  4       P                  ,          ^ 8X  d   V P                  V4       ^ V n        V P                  P                  V4       V'       d   V P                  4        V ;P                  ^,          un        \        ^4       K  \        ^4       K    \         dm   p\        \        P                  RTP                  ^ ,           24      p\        TP!                  T P"                  4      \$        P&                  R7        Rp?MlRp?i\(         d\   p\        \        P                  RT 24      p\        TP!                  T P"                  4      \$        P&                  R7        Rp?MRp?ii ; i\+        ^4       R# )Tz.Missing strategy, exiting for safety reasons: )ZfileNz,Critical error, exiting for safety reasons: )r*   r$   r0   r1   Zfan_speed_update_frequencyrC   r8   ZappendrE   r   r   r   r   ZERRORr   r3   rD   r   sysZstderrZ	ExceptionZexit)r   Zdebugr?   rB   Z_rtes   &&   r   runZFanController.run   sD   	N;;;668D~~(A(A(C(^(^^bcc((.)*%%,,T2((*NNa'N!H!H' 	N !4!48fghgmgmnogpfq6rsD$''(:(:;#**MM 	N !4!48defdg6hiD$''(:(:;#**MM	N 	Qs8   C A:C AC F.A"EF.F.AF))F.)r*   r   r   r   r/   r   r%   r0   )T)!Z__name__Z
__module__Z__qualname__Z__firstlineno__r   r   r   r/   r   r%   collectionsZdequer8   r*   r0   r   r$   r&   r(   r+   r,   r   r.   r1   r   r<   r>   rC   r6   rE   rG   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r      s     MME$$aS3Ys;LFI":23)*=)YXTf&(
"H r   r   )&rH   rF   r   Ztimer   Zfw_fanctrl.Configurationr   Z>fw_fanctrl.dto.command_result.ConfigurationReloadCommandResultr   Z6fw_fanctrl.dto.command_result.PrintActiveCommandResultr   Z?fw_fanctrl.dto.command_result.PrintCurrentStrategyCommandResultr   Z8fw_fanctrl.dto.command_result.PrintFanSpeedCommandResultr   Z<fw_fanctrl.dto.command_result.PrintStrategyListCommandResultr   Z7fw_fanctrl.dto.command_result.ServicePauseCommandResultr   Z8fw_fanctrl.dto.command_result.ServiceResumeCommandResultr	   Z;fw_fanctrl.dto.command_result.SetConfigurationCommandResultr
   Z9fw_fanctrl.dto.command_result.StrategyChangeCommandResultr   Z8fw_fanctrl.dto.command_result.StrategyResetCommandResultr   Z+fw_fanctrl.dto.runtime_result.RuntimeResultr   Z1fw_fanctrl.dto.runtime_result.StatusRuntimeResultr   Zfw_fanctrl.enum.CommandStatusr   Z-fw_fanctrl.exception.InvalidStrategyExceptionr   Z,fw_fanctrl.exception.UnknownCommandExceptionr   r   ) r   r   <module>rI      sM     
   2 k [ m _ g ] _ e a _ E Q 7 R Pv vr   