Skip to content

Commit 201e839

Browse files
committed
feat: use hw version instead of chip
1 parent 74ac0b2 commit 201e839

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ btleplug = "0.11.7"
2121
chrono = "0.4.39"
2222
dotenvy = "0.15.7"
2323
local-ip-address = "0.6.3"
24-
mdns-sd = "0.13.1"
24+
mdns-sd = "0.13.2"
2525
reqwest = { version = "0.12.12", features = ["json", "rustls-tls"], default-features = false }
2626
serde = { version = "1.0.217", features = ["derive"] }
2727
serde_json = "1.0.138"

src/http.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ use tokio::net::TcpListener;
1111
use tower_http::trace::{DefaultMakeSpan, TraceLayer};
1212
use tracing::{error, info};
1313

14-
fn default_chip() -> String {
15-
"no-chip".to_string()
16-
}
17-
1814
fn default_firmware() -> String {
1915
"no-firmware".to_string()
2016
}
@@ -26,11 +22,10 @@ pub struct EspConnectInfo {
2622
#[serde(rename = "ver")]
2723
pub version: String,
2824

29-
#[serde(default = "default_chip")]
30-
pub chip: String,
31-
3225
#[serde(default = "default_firmware")]
3326
pub firmware: String,
27+
28+
pub hw: String,
3429
}
3530

3631
pub async fn start_server(port: u16, state: SharedAppState) -> Result<()> {

src/updater.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ pub async fn should_update(
4646
continue;
4747
}
4848

49-
let (chip, firmware, version) = (
49+
let (hw, firmware, version) = (
5050
name_split[0],
5151
name_split[1],
5252
Version::from_str(name_split[2]),
5353
);
5454

55-
if chip != esp_connect_info.chip || firmware != esp_connect_info.firmware {
55+
if hw != esp_connect_info.hw || firmware != esp_connect_info.firmware {
5656
continue;
5757
}
5858

0 commit comments

Comments
 (0)