Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Oct 17, 2024
1 parent 15cc583 commit ad7003a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
44 changes: 44 additions & 0 deletions openapi/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,19 @@
],
"description": "The current stage of the machine as defined by Bambu which can include errors, etc.",
"nullable": true
},
"nozzle_diameter": {
"allOf": [
{
"$ref": "#/components/schemas/NozzleDiameter"
}
],
"description": "The nozzle diameter of the machine."
}
},
"required": [
"nozzle_diameter"
],
"type": "object"
}
},
Expand Down Expand Up @@ -304,6 +315,39 @@
}
]
},
"NozzleDiameter": {
"description": "A nozzle diameter.",
"oneOf": [
{
"description": "0.2mm.",
"enum": [
"0.2"
],
"type": "string"
},
{
"description": "0.4mm.",
"enum": [
"0.4"
],
"type": "string"
},
{
"description": "0.6mm.",
"enum": [
"0.6"
],
"type": "string"
},
{
"description": "0.8mm.",
"enum": [
"0.8"
],
"type": "string"
}
]
},
"Pong": {
"description": "The response from the `/ping` endpoint.",
"properties": {
Expand Down
3 changes: 3 additions & 0 deletions src/server/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ pub enum ExtraMachineInfoResponse {
Bambu {
/// The current stage of the machine as defined by Bambu which can include errors, etc.
current_stage: Option<bambulabs::message::Stage>,
/// The nozzle diameter of the machine.
nozzle_diameter: bambulabs::message::NozzleDiameter,
// Only run in debug mode. This is just to help us know what information we have.
#[cfg(debug_assertions)]
#[cfg(not(test))]
Expand Down Expand Up @@ -107,6 +109,7 @@ impl MachineInfoResponse {
.ok_or_else(|| anyhow::anyhow!("no status for bambu"))?;
Some(ExtraMachineInfoResponse::Bambu {
current_stage: status.stg_cur,
nozzle_diameter: status.nozzle_diameter,
#[cfg(debug_assertions)]
#[cfg(not(test))]
raw_status: status,
Expand Down

0 comments on commit ad7003a

Please sign in to comment.