@@ -11,7 +11,7 @@ use std::env;
1111use std:: str:: FromStr ;
1212use std:: time:: Duration ;
1313use uc_api:: intg:: ws:: { R2Event , R2Request } ;
14- use uc_intg_hass:: configuration:: { get_configuration, Settings , DEF_HA_URL , ENV_HASS_MSG_TRACING } ;
14+ use uc_intg_hass:: configuration:: { get_configuration, Settings , ENV_HASS_MSG_TRACING } ;
1515use uc_intg_hass:: {
1616 configuration, Controller , NewR2Session , R2EventMsg , R2RequestMsg , SendWsMessage , APP_VERSION ,
1717} ;
@@ -21,6 +21,14 @@ use url::Url;
2121async fn main ( ) -> anyhow:: Result < ( ) > {
2222 let cfg = parse_args_load_cfg ( ) ?;
2323
24+ println ! (
25+ "Connecting to Home Assistant WebSocket server: {} (timeout={}s, request-timeout={}s, disable-cert={})" ,
26+ cfg. hass. get_url( ) ,
27+ cfg. hass. connection_timeout,
28+ cfg. hass. request_timeout,
29+ cfg. hass. disable_cert_validation,
30+ ) ;
31+
2432 let driver_metadata = configuration:: get_driver_metadata ( ) ?;
2533 let controller = Controller :: new ( cfg, driver_metadata. clone ( ) ) . start ( ) ;
2634
@@ -59,9 +67,14 @@ fn parse_args_load_cfg() -> anyhow::Result<Settings> {
5967 . arg (
6068 Arg :: new ( "url" )
6169 . short ( 'u' )
62- . default_value ( DEF_HA_URL )
6370 . help ( "Home Assistant WebSocket API URL (overrides home-assistant.json)" ) ,
6471 )
72+ . arg (
73+ Arg :: new ( "disable_cert_validation" )
74+ . long ( "disable-cert-validation" )
75+ . num_args ( 0 )
76+ . help ( "Disable SSL certificate verification (overrides home-assistant.json)" ) ,
77+ )
6578 . arg (
6679 Arg :: new ( "token" )
6780 . short ( 't' )
@@ -96,6 +109,9 @@ fn parse_args_load_cfg() -> anyhow::Result<Settings> {
96109 if let Some ( url) = args. get_one :: < String > ( "url" ) {
97110 cfg. hass . set_url ( Url :: parse ( url) ?) ;
98111 }
112+ if let Some ( disable_cert_validation) = args. get_one :: < bool > ( "disable_cert_validation" ) {
113+ cfg. hass . disable_cert_validation = * disable_cert_validation;
114+ }
99115 if let Some ( token) = args. get_one :: < String > ( "token" ) {
100116 cfg. hass . set_token ( token) ;
101117 }
0 commit comments