File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : " Intouch2-MQTT"
22description : " A bridge between intouch2, used in spa systems, and MQTT 3.3"
3- version : " 0.1.252 "
3+ version : " 0.1.253 "
44slug : " intouch2-mqtt"
55init : false
66arch :
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ pub struct ConfigureDevice {
66 pub name : Arc < str > ,
77 #[ serde( skip_serializing_if = "Option::is_none" ) ]
88 pub sw_version : Option < Arc < str > > ,
9- // #[serde(skip_serializing_if = "Option::is_none")]
10- // pub configuration_url: Option<Arc<str>>,
9+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
10+ pub configuration_url : Option < Arc < str > > ,
1111 #[ serde( flatten) ]
1212 pub extra_args : HashMap < & ' static str , serde_json:: Value > ,
1313}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ use serde_json::json;
1414use std:: {
1515 borrow:: Cow ,
1616 collections:: VecDeque ,
17+ env,
1718 net:: IpAddr ,
1819 path:: PathBuf ,
1920 pin:: pin,
@@ -561,10 +562,15 @@ async fn main() -> anyhow::Result<()> {
561562 name : spa_name. into ( ) ,
562563 sw_version : Some ( spa_version. into ( ) ) ,
563564 extra_args : Default :: default ( ) ,
564- // configuration_url: env::var("HOSTNAME")
565- // .map(|hostname| format!("homeassistant://hassio/addon/{hostname}/config"))
566- // .ok()
567- // .map(Into::into),
565+ configuration_url : env:: var ( "HOSTNAME" )
566+ . map ( |hostname| {
567+ format ! (
568+ "homeassistant://hassio/addon/{hostname}/config" ,
569+ hostname = hostname. replace( "_" , "-" )
570+ )
571+ } )
572+ . ok ( )
573+ . map ( Into :: into) ,
568574 } ) ?;
569575 let spa = spa. clone ( ) ;
570576 join_set. spawn ( async move {
You can’t perform that action at this time.
0 commit comments