+
    2Jk  ã                   óh  € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	H
t
 ]P                  P                  ]P                  P                  ]4      4      t]P                  P!                  ]R4      tRtR]P&                  P)                  ]4      ,           tRtRtRt. ROtR	 tR
 t]R8X  dè   R]P:                  9   d$   ]! R]4       ]! ]4       ]P>                  ! ^ 4       ]! ]4      t R]]3,          t!]PD                  ! R4       R]P:                  9   dY   ^ RI#t ]PH                  PK                  R]]3,          ^R7      t&]! R]&PN                  ]!3,          4       ]P>                  ! ^ 4       ]! R]!4       ]! ]!4       ]PD                  ! ^4       R# R#   ]( d   t)]! R])4        Rt)A)LNRt)A)ii ; i)u  door_announce.py â€” announce a front-door visitor on the Google/Nest speakers.

Reusable by Project Doorman: when someone's at the door (AOA person-in-porch,
or the doorman trigger), cast a pre-generated Jarvis-voice clip
("Someone is at the front door.") to the Nest Wifi speaker points so Phil can
walk over and take it. Pre-cached clip â€” costs no TTS quota per fire.

Usage:
  python3 door_announce.py            # discover + cast to the speakers
  python3 door_announce.py --check   # serve the clip + verify it's reachable (no sound)
N)ÚBaseHTTPRequestHandlerÚThreadingHTTPServerzdoor_announce.mp3zSomeone is at the front door.zIhttps://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=en&q=z192.168.1.68z100.108.59.81iÏ   c                 ó    €  ! R  R\         4      p\        RV 3V4      p\        P                  ! VP                  RR7      P                  4        V# )c                   óZ   a € ] tR t^t o ]! ]R4      P                  4       tR tR t	Rt
V tR# )Ú_serve.<locals>.HÚrbc                ój  € R V P                   9   d�   V P                  pV P                  ^È4       V P                  RR4       V P                  R\	        \        V4      4      4       V P                  4        V P                  P                  V4       R# V P                  R4       V P                  4        R# )ÚdoorzContent-Typeú
audio/mpegzContent-Lengthi”  N)	ÚpathÚclipÚsend_responseÚsend_headerÚstrÚlenÚend_headersÚwfileÚwrite)ÚselfÚbs   & ÚNC:\Users\DEMO - JARVIS\AppData\Local\hermes\svc\door_announce\door_announce.pyÚdo_GETÚ_serve.<locals>.H.do_GET   s†   € Ø˜Ÿ™Ô"Ø—I‘I�Ø×"Ñ" 3Ô'¨×)9Ñ)9¸.È,Ô)WØ× Ñ Ð!1´3´s¸1³v³;Ô?À×AQÑAQÔASÐUY×U_ÑU_×UeÑUeÐfgÖUhà×"Ñ" 3Ô'¨×)9Ñ)9Ö);ó    c                ó   € R # ©N© )r   Úas   &*r   Úlog_messageÚ_serve.<locals>.H.log_message$   s   € Ùr   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__ÚopenÚCLIPÚreadr   r   r   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   ÚHr      s)   ø‡ € Ù�D˜$Ó×$Ñ$Ó&ˆò	<÷	ð 	r   r*   z0.0.0.0T)ÚtargetÚdaemon)r   r   Ú	threadingÚThreadÚserve_foreverÚstart)Úportr*   Úsrvs   &  r   Ú_server3      sF   € ô
Ô"ô 
ô ˜y¨$Ð/°Ó
3€CÜ×Ò˜C×-Ñ-°dÔ;×AÑAÔCØ€Jr   c                 ó®  a€ \         P                  ! ^R7      w  rV Uau. uFO  o\        ;QJ d#    V3R l\         4       F  '       g   K   RM	  RM! V3R l\         4       4      '       g   KM  SNKQ  	  ppV'       g+   \	        RRP                  R V 4       4      ,          4       R# V Ff  o SP                  ^
R7       SP                  pVP                  V R4       VP                  ^R7       \	        R	SP                  P                  4       Kh  	  R# u upi   \         d.   p\	        R
SP                  P                  RT4        Rp?K¤  Rp?ii ; i)é   ©Útimeoutc              3   óT   <"  € T F  qSP                   P                  9   x € K  	  R # 5ir   ©Ú	cast_infoÚfriendly_name)Ú.0ÚtÚcs   & €r   Ú	<genexpr>Úannounce.<locals>.<genexpr>,   s   øé € Ð!RÉ'ÀQ q§{¡{×'@Ñ'@Ö"@Ë'ùs   ƒ%(TFz#no speaker targets found (have: %s)z, c              3   óL   "  € T F  qP                   P                  x € K  	  R # 5ir   r9   )r<   r>   s   & r   r?   r@   /   s   é € ÐA¹S¸Ÿ+™+×3Ö3»Sùs   ‚"$r
   z  announced onz  cast fail onÚ-N)ÚpychromecastÚget_chromecastsÚanyÚTARGETSÚprintÚjoinÚwaitÚmedia_controllerÚ
play_mediaÚblock_until_activer:   r;   Ú	Exception)ÚurlÚccsÚ_r>   ÚhitsÚmcÚes   &  `   r   ÚannouncerT   *   s	  ø€ Ü×)Ò)°!Ô4�F€CÙÔS‘s�!Ÿc›cÔ!RÍ'Ó!RŸcŸcšcÔ!RÍ'Ó!R×R�AˆA‘s€DÐSßÜÐ3Ø—	‘	ÑA¹SÓAÓAõBô 	CÙKPÛˆð	GØ�F‰F˜2ˆFÔØ×#Ñ#ˆBØ�M‰M˜#˜|Ô,¨b×.CÑ.CÈBÐ.CÔ.OÜÐ" A§K¡K×$=Ñ$=Ö>ñ ñ ùò Tøô ô 	GÜÐ" A§K¡K×$=Ñ$=¸sÀA×FÒFûð	Gús/    D°DÁDÁ/DÂ/A"DÄEÄ'"EÅEÚ__main__z--cloudz"casting cloud voice (no firewall):zhttp://%s:%d/door_announce.mp3gš™™™™™Ù?z--checkr6   zUREADY: clip served %d bytes on %s (LAN). Speaker fetch depends on the firewall allow.zcheck failed:Úcasting)ÚKitchenÚDiningÚliving)*Ú__doc__ÚosÚsysr-   ÚtimeÚurllib.parseÚurllibrC   Úhttp.serverr   r   r   ÚdirnameÚabspathÚ__file__ÚBASErH   r%   ÚTEXTÚparseÚquoteÚCLOUDÚLANÚTAILÚPORTrF   r3   rT   r    ÚargvrG   Úexitr2   rN   ÚsleepÚurllib.requestÚrequestÚurlopenÚrÚstatusrM   rS   r   r   r   Ú<module>rt      s€  ðñ
÷ <× ;× ;ß Cà
�‰�‰˜Ÿ™Ÿ™¨Ó1Ó2€Ø
�‰�‰�TÐ.Ó/€Ø'€Ø	TØ�<‰<×Ñ˜dÓ#õ
$€à€Ø€Ø€Ú
)€òò ð  ˆzÔØ�C—H‘HÔÙÐ2°EÔ:Ù�Œ˜Ÿš !œÙ
�‹,€CØ
*¨c°4¨[Õ
8€CØ‡J‚Jˆs„OØ�C—H‘HÔÛð	&Ø—‘×&Ñ&Ð'GÈ3ÐPTÈ+Õ'UÐ_`Ð&ÓaˆAÙÐiÐmn×muÑmuÐwzÐl{Õ{Ô|ð 	�Š�ŒÙ	ˆ)�SÔÙˆS„MØ‡J‚Jˆq†Mñ# øð ô 	&Ù�/ 1×%Ñ%ûð	&ús   ÄAF ÆF1Æ	F,Æ,F1