LoRa Cloud: use default if value is not present.

This commit is contained in:
Orne Brocaar 2022-09-27 11:03:49 +01:00
parent e81e57a020
commit 1867140272
2 changed files with 9 additions and 5 deletions

View File

@ -386,13 +386,17 @@ pub struct LocationResult {
#[derive(Deserialize, Clone)]
pub struct LocationSolverResult {
#[serde(default)]
pub ecef: Vec<f64>,
#[serde(default)]
pub llh: Vec<f64>,
#[serde(default)]
pub gdop: f64,
#[serde(default)]
pub accuracy: f64,
#[serde(rename = "capture_time_gps")]
#[serde(default, rename = "capture_time_gps")]
pub capture_time_gps: f64,
#[serde(rename = "capture_time_utc")]
#[serde(default, rename = "capture_time_utc")]
pub capture_time_utc: f64,
}

View File

@ -192,6 +192,9 @@ impl Integration {
return Err(anyhow!("{}", resp.error));
}
self.handle_response_integration_event(vars, pl, &resp.result)
.await?;
if self.config.modem_geolocation_services.parse_tlv && resp.result.stream_records.is_some()
{
self.handle_response_tlv_records(
@ -202,9 +205,6 @@ impl Integration {
.await?;
}
self.handle_response_integration_event(vars, pl, &resp.result)
.await?;
if let Some(v) = &resp.result.downlink {
self.handle_response_downlink(pl, v).await?;
}