Skip to content

Commit 637538b

Browse files
committed
listen on both IPv6 and IPv4
1 parent 3252dea commit 637538b

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/handlers.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ pub async fn device_info_request(
175175
// FIXME: I'd send my own version, but am sending the version I'm
176176
// mimicking, since I had some issues getting HomeAssistant to register
177177
// the proxy with my own version.
178-
esphome_version: "2024.8.3".to_string(),
178+
// esphome_version: "2024.8.3".to_string(),
179+
esphome_version: ctx.version.to_string(),
179180

180181
// A string describing the date of compilation, this is generated by the compiler
181182
// and therefore may not be in the same format all the time.

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ struct Cli {
3030
#[arg(short = 'a', long, default_value_t = 0)]
3131
hci: u16,
3232

33-
/// TCP listen address (default: 0.0.0.0:6053)
34-
#[arg(short, long, default_value = "0.0.0.0:6053")]
33+
/// TCP listen address (default: [::]:6053)
34+
#[arg(short, long, default_value = "[::]:6053")]
3535
listen: SocketAddr,
3636

3737
/// Hostname to advertise (default: system hostname)

src/utils.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ pub fn get_bt_mac(hci_index: u16) -> Option<[u8; 6]> {
3737
}
3838

3939
if ret < 0 {
40-
log::error!(
41-
"ioctl HCIGETDEVINFO failed for hci{hci_index} (ret = {ret})"
42-
);
40+
log::error!("ioctl HCIGETDEVINFO failed for hci{hci_index} (ret = {ret})");
4341
return None;
4442
}
4543

@@ -76,8 +74,7 @@ pub fn parse_mac(s: &str) -> Result<[u8; 6], String> {
7674

7775
let mut mac = [0u8; 6];
7876
for (i, part) in parts.iter().enumerate() {
79-
mac[i] =
80-
u8::from_str_radix(part, 16).map_err(|_| format!("Invalid hex byte: '{part}'"))?;
77+
mac[i] = u8::from_str_radix(part, 16).map_err(|_| format!("Invalid hex byte: '{part}'"))?;
8178
}
8279
Ok(mac)
8380
}

0 commit comments

Comments
 (0)