diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs index 6c353e6..5dc84eb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,12 +36,8 @@ async fn main() { .await?; let mut lock = state_clone.lock().await; lock.entry(name.clone()) - .and_modify(|prs| prs.bed_temp = response.printer.temp_bed) - .or_insert_with(|| PrinterState { - name: name.clone(), - bed_temp: response.printer.temp_bed, - ..Default::default() - }); + .and_modify(|prs| *prs = extract_status_from_prusa(&response)) + .or_insert_with(|| { extract_status_from_prusa(&response) } ); Ok(()) } .await; @@ -91,7 +87,6 @@ async fn main() { lock.entry(name.clone()) .and_modify(|prs| prs.bed_temp = msg.print.bed_temper) .or_insert_with(|| PrinterState { - name: name.clone(), bed_temp: msg.print.bed_temper, ..Default::default() }); |
