Skip to content

Commit 12efe64

Browse files
authored
Merge pull request #20 from vxshug/main
feat: add period
2 parents 5bdb1c1 + 0926a98 commit 12efe64

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

devices_manager/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ async-trait.workspace = true
1717
arc-swap.workspace = true
1818
x509-parser.workspace = true
1919
rustls-pemfile.workspace = true
20-
async-tungstenite = { workspace = true, default-features = false, features = ["tokio-runtime"] }
21-
ws_stream_tungstenite = { workspace = true, default-features = false, features = ["tokio_io"] }
20+
async-tungstenite = { workspace = true, features = ["tokio-runtime"] }
21+
ws_stream_tungstenite = { workspace = true, features = ["tokio_io"] }
2222
parking_lot.workspace = true
2323
flume.workspace = true
2424
slab.workspace = true

snap_api/src/service/device/device.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ pub(crate) struct LoRaNodeDeviceInfo {
205205
pub struct DeviceModify {
206206
pub name: Option<String>,
207207
pub description: Option<String>,
208+
pub period: Option<i32>,
208209
pub script: Option<Id>,
209210
pub reset_script: Option<bool>,
210211
pub region: Option<LoRaRegion>,
@@ -891,6 +892,11 @@ impl DeviceService {
891892
device_active.product_id = ActiveValue::Set(Some(product_id));
892893
}
893894
}
895+
if let Some(period) = info.period {
896+
if period != device_with_auth.device.period {
897+
device_active.period = ActiveValue::Set(period);
898+
}
899+
}
894900
if let Some(script_id) = info.script {
895901
if device_with_auth.device.device_type == DeviceType::LoRaNode
896902
&& device_with_auth.device.script != info.script

0 commit comments

Comments
 (0)