
    g                        S r SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSKrSSKJr  S	S
KJr   " S S\5      r S           SS jjrg)zRepairs platform for HACS.    )annotations)Any)data_entry_flow)RepairsFlow)HomeAssistantN)HacsBase   )DOMAINc                  N    \ rS rSrSrSS jr S	   S
S jjr S	   S
S jjrSrg)RestartRequiredFixFlow   z!Handler for an issue fixing flow.c                    Xl         g Nissue_id)selfr   s     )/config/custom_components/hacs/repairs.py__init__RestartRequiredFixFlow.__init__   s         Nc                >   #    U R                  5       I Sh  vN $  N7f)z$Handle the first step of a fix flow.N)async_step_confirm_restart)r   
user_inputs     r   async_step_init&RestartRequiredFixFlow.async_step_init   s     
 446666s   c                  #    Ub>  U R                   R                  R                  SS5      I Sh  vN   U R                  S0 S9$ U R                   R                  [
           nUR                  R                  U R                  R                  S5      S   5      nU R                  S[        R                  " 0 5      S	UR                  0S
9$  N7f)z&Handle the confirm step of a fix flow.Nhomeassistantrestart )titledata_   confirm_restartname)step_iddata_schemadescription_placeholders)hassservices
async_callasync_create_entryr!   r
   repositories	get_by_idr   splitasync_show_formvolSchemadisplay_name)r   r   hacsintegrations       r   r   1RestartRequiredFixFlow.async_step_confirm_restart   s      !))$$//KKK**"*==/''11$--2E2Ec2J12MN##%

2&,k.F.F%G $ 
 	
 Ls   -CC	BCr   )r   strreturnNoner   )r   zdict[str, str] | Noner8   zdata_entry_flow.FlowResult)	__name__
__module____qualname____firstlineno____doc__r   r   r   __static_attributes__ r   r   r   r      sC    +! 377/7	#7 37
/
	#
 
r   r   c                N   #    UR                  S5      (       a  [        U5      $ g7f)zCreate flow.restart_requiredN)
startswithr   )r)   r   r!   argskwargss        r   async_create_fix_flowrF   0   s'      -..%h//s   #%r   )r)   r   r   r7   r!   z*dict[str, str | int | float | None] | NonerD   r   rE   r   r8   zRepairsFlow | None)r>   
__future__r   typingr   r   r    homeassistant.components.repairsr   homeassistant.corer   
voluptuousr1   custom_components.hacs.baser   constr
   r   rF   r@   r   r   <module>rN      so      "  ) 8 ,  0 
[ 
D 8<



 5
 	

 
 
r   