File tree Expand file tree Collapse file tree
snap_api/src/service/device Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ async-trait.workspace = true
1717arc-swap.workspace = true
1818x509-parser.workspace = true
1919rustls-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" ] }
2222parking_lot.workspace = true
2323flume.workspace = true
2424slab.workspace = true
Original file line number Diff line number Diff line change @@ -205,6 +205,7 @@ pub(crate) struct LoRaNodeDeviceInfo {
205205pub 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
You can’t perform that action at this time.
0 commit comments