+
    "i!                        R t ^ RIHt ^ RIHtHt ^ RIHtHt ^ RI	H
t
 ^RIHt ^RIHtHtHtHt ^RIHtHt ^RIHt ^R	IHt ^R
IHt ^RIHt ^RIHt ]'       d   ^RIHt  ! R R]4      t R# )zClass for integrations in HACS.)annotations)TYPE_CHECKINGAny)IssueSeverityasync_create_issue)async_get_custom_components)DOMAIN)HacsCategoryHacsDispatchEventHacsGitHubRepoRepositoryFile)AddonRepositoryExceptionHacsException)decode_content)
concurrent) get_first_directory_in_directory)
json_loads)HacsRepository)HacsBasec                     a  ] tR t^tRtR V 3R llt]R 4       tR tR R lt	R t
]! ^
^R	7      RR
 l4       tR tRR R lltR R ltRtV ;t# )HacsIntegrationRepositoryzIntegrations in HACS.c                    V ^8  d   QhRRRR/# )   hacsr   	full_namestr )formats   ":/config/custom_components/hacs/repositories/integration.py__annotate__&HacsIntegrationRepository.__annotate__   s     1 1X 1# 1    c                D  < \         SV `  VR7       W P                  n        VP	                  4       V P                  n        \        P                  V P                  n        RV P                  P                  n        V P                  V P                  P                  n        R# )zInitialize.)r   custom_componentsN)super__init__datar   lowerfull_name_lowerr	   INTEGRATIONcategorycontentpathremote	localpathlocal)selfr   r   	__class__s   &&&r   r%   "HacsIntegrationRepository.__init__   sj    d#'		$-OO$5		!)55		#6 "&..r!   c                t    V P                   P                  P                   RV P                  P                   2# )zReturn localpath.z/custom_components/)r   coreconfig_pathr&   domainr0   s   &r   r.   #HacsIntegrationRepository.localpath#   s0     ))..,,--@AQAQ@RSSr!   c                  "   RV n         V P                  P                  '       de   V P                  P                  \        P
                  8w  d   V P                  4       G Rj  xL
  V P                  P                  '       d   RV n         V P                   '       d   V P                  P                  RV P                  4       \        V P                  P                  \        RV P                  P                   RV P                    2RV P                  P"                  ;'       g    \        \$        P&                  RRV P(                  /R	7       R# R#  L5i)
zRun post installation steps.TNFz"%s Creating restart_required issuerestart_required__restart_requiredname)hassr6   issue_id
is_fixableissue_domainseveritytranslation_keytranslation_placeholders)pending_restartr&   config_flowr   r   r)   reload_custom_componentsfirst_installloggerdebugstringr   r   r>   r   idrefr6   r   WARNINGdisplay_namer7   s   &r   async_post_installation1HacsIntegrationRepository.async_post_installation(   s     #99   yy""n&@&@@33555yy&&&',$KKBDKKPYY^^,TYY\\N!DHH:F!YY--77&.. 2D--*  	 6s%   A E"E#EEBE$.Ec                   V ^8  d   QhRR/# )r   returnNoner   )r   s   "r   r   r    @   s     ( (D (r!   c                   "   V P                   P                  '       d   V P                  4       G Rj  xL
  R# RV n        R#  L5i)zRun post uninstall steps.NT)r&   rF   rG   rE   r7   s   &r   async_post_uninstall.HacsIntegrationRepository.async_post_uninstall@   s4     99   //111#'D  2s   0AAAc                (  "   V P                  4       G Rj  xL
  V P                  P                  '       d   RV P                  P                  n        V P                  P                  P
                  R8X  d   \        V P                  R4      pVfs   RV P                  9   g#   RV P                  9   g   RV P                  9   d   \        4       h\        V P                   RV P                  P                  RR4       R	24      hR
V 2V P                  P                  n        V P                  4       G Rj  xL
 ;p'       d    W n        VP!                  R. 4      V P"                  n        VR,          V P"                  n        VP!                  R4      V P"                  n        VP!                  RR4      V P"                  n        V P>                  V P                  P                  n         V P.                  P0                  '       dm   V P.                  P0                   FR  pV P8                  PB                  PD                  '       d   K+  V PF                  P=                  RV P                  V4       KT  	  V P.                  PH                  #  ELo ELT  \,         dz   pT P.                  P0                  P3                  RT R\4        P6                   24       T P8                  P:                  P=                  RT\4        P6                  4        Rp?ELHRp?ii ; i5i)z	Validate.N r#   zrepository.jsonzrepository.yamlzrepository.ymlz Repository structure for ztags/z is not compliantcustom_components/
codeownersr6   r=   rF   FMissing expected key '' in !Missing expected key '%s' in '%s'z%s %s)%common_validaterepository_manifestcontent_in_rootr+   r,   r-   r   tree	treefilesr   r   rK   rM   replaceasync_get_integration_manifestintegration_manifestgetr&   authorsr6   manifest_namerF   KeyErrorvalidateerrorsappendr   MAINIFEST_JSONr   logerrorr.   r/   statusstartuprI   success)r0   r=   manifest	exceptionrp   s   &    r   validate_repository-HacsIntegrationRepository.validate_repositoryG   sb    ""$$$ ##333')DLL$<<##'::3DII?RSD|%7(DNN:'4>>9244#{{m#=(("5>76GI  *<D6'BDLL$ "@@BBB8B,4)$,LLr$B		!#+H#5		 *2,,v*>		'(0]E(J		% #'.. ==--yy''///KK%%gt{{EB . }}$$$_ 	%, C  $$++,YKu&55=7 8 		##7NDaDa sa   LJLC=L4J5LB J A L<LALLLA.L
L
LL)concurrenttasksbackoff_timec                  "   V P                  W4      G Rj  xL
 '       g   V'       g   R# V P                  P                  '       d   RV P                  P                  n        V P                  P                  P
                  R8X  d5   \        V P                  R4      pRV 2V P                  P                  n        V P                  4       G Rj  xL
 ;p'       d    W@n	        VP                  R. 4      V P                  n        VR,          V P                  n        VP                  R4      V P                  n        VP                  RR	4      V P                  n        V P2                  V P                  P                  n        V P                  P6                  '       d]   V P,                  P9                  \:        P<                  RRRRRV P                  P>                  RV P                  P@                  /4       R# R#  EL EL0  \          dz   pT P"                  P$                  P'                  R
T R\(        P*                   24       T P,                  P.                  P1                  RT\(        P*                  4        Rp?EL$Rp?ii ; i5i)zUpdate.NrY   r#   rZ   r[   r6   r=   rF   Fr\   r]   r^   rL   i9  actionupdate
repositoryrepository_id)!common_updater`   ra   r+   r,   r-   r   rb   re   rf   rg   r&   rh   r6   ri   rF   rj   rk   rl   rm   r   rn   r   ro   rp   r.   r/   	installedasync_dispatchr
   
REPOSITORYr   rL   )r0   ignore_issuesforcer=   rt   ru   s   &&&   r   update_repository+HacsIntegrationRepository.update_repositoryz   s     ''===e##333')DLL$<<##'::3DII?RSD);D6'BDLL$ "@@BBB8B,4)$,LLr$B		!#+H#5		 *2,,v*>		'(0]E(J		% #'.. 99II$$!,,$h $))"5"5#TYY\\	 A > C  $$++,YKu&55=7 8 		##7NDaDa sf   J	G<	J	J	J	BJ	G?J	B H A J	AJ	?J	JA.J;J	JJ	c                  "   V P                   P                  R4       V P                  P                  P                  R \        V P                  P                  4      G Rj  xL
  V P                   P                  R4       R#  L!5i)z1Reload custom_components (and config flows)in HA.z Reloading custom_component cacher#   NzCustom_component cache reloaded)rI   infor   r>   r&   r   r7   s   &r   rG   2HacsIntegrationRepository.reload_custom_components   s]     ;<IINN 34)$))..999:; 	:s   AB!B""Bc                    V ^8  d   QhRRRR/# )r   rM   r   rS   dict[str, Any] | Noner   )r   s   "r   r   r       s     E E EG\ Er!   c           	       "   V P                   P                  '       d   RM2V P                  P                  P                   R\
        P                   2pVR V P                   4       9   g!   \        R\
        P                   RV R24      hV P                  P                  ! RRV P                  P                  P                  P                  P                  RV P                  P                   R	V/R
RT;'       g    V P#                  4       //B G Rj  xL
 pV'       d)   \%        \'        VP                  P                  4      4      # R#  L65i)*Get the content of the manifest.json file.manifest.json/c              3  8   "   T F  qP                   x  K  	  R # 5iN	full_path.0xs   & r   	<genexpr>KHacsIntegrationRepository.async_get_integration_manifest.<locals>.<genexpr>         @ii   No  file found ''methodr}   r,   paramsrM   Nr   )r`   ra   r+   r,   r-   r   rn   rb   r   r   async_github_api_method	githubapireposcontentsrg   r&   r   version_to_downloadr   r   )r0   rM   manifest_pathresponses   &&  r   re   8HacsIntegrationRepository.async_get_integration_manifest   s(     ''777 LL%%,,-Q~/L/L.MN 	  @dii @@#n&C&C%DMR_Q``a bcc:: 
99&&,,5599
yy**
 
 %!B!B(@(@(BCD	
 
 nX]]-B-BCDD 
s   C8E;EE
E +Ec                    V ^8  d   QhRRRR/# )r   versionr   rS   r   r   )r   s   "r   r   r       s       K` r!   c               :  "   V P                   P                  '       d   RM2V P                  P                  P                   R\
        P                   2pVR V P                   4       9  d!   \        R\
        P                   RV R24      hV P                  P                  RV P                  V4        V P                  P                  RV P                  P                   RV RV 2R	R
7      G Rj  xL
 pVf   R# \!        V4      #  L  \"         d     R# i ; i5i)r   r   r   c              3  8   "   T F  qP                   x  K  	  R # 5ir   r   r   s   & r   r   EHacsIntegrationRepository.get_integration_manifest.<locals>.<genexpr>   r   r   r   r   r   z'%s Getting manifest.json for version=%sz"https://raw.githubusercontent.com/T)nologN)r`   ra   r+   r,   r-   r   rn   rb   r   rI   rJ   rK   r   async_download_filer&   r   r   	Exception)r0   r   kwargsr   results   &$,  r   get_integration_manifest2HacsIntegrationRepository.get_integration_manifest   s     ''777 LL%%,,-Q~/L/L.MN 	  @dii @@#n&C&C%DMR_Q``a bccCT[[RYZ
	99884II''5)()'!M?D 9  F
 ~f%%  		sH   B1D4=D	 1D2D	 :D<
D	 DD	 	DDDD)rf   rE   )FFr   )__name__
__module____qualname____firstlineno____doc__r%   propertyr.   rP   rV   rv   r   r   rG   re   r   __static_attributes____classcell__)r1   s   @r   r   r      sg    1 1 T T0(1%f 3+ 4+Z<E( r!   r   N)!r   
__future__r   typingr   r   $homeassistant.helpers.issue_registryr   r   homeassistant.loaderr   constr   enumsr	   r
   r   r   
exceptionsr   r   utils.decoder   utils.decoratorr   utils.filtersr   
utils.jsonr   baser   r   r   r   r!   r   <module>r      sC    % " % R <  S S @ ) ( < #  B Br!   