Notify devices of available updates through sync endpoint
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
use std::fmt::{Display, Formatter};
|
||||
use std::str::FromStr;
|
||||
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Copy, Clone, Eq, PartialEq)]
|
||||
pub enum OTAPlatform {
|
||||
@ -13,6 +14,14 @@ impl Display for OTAPlatform {
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for OTAPlatform {
|
||||
type Err = anyhow::Error;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
Ok(serde_json::from_str::<Self>(&format!("\"{s}\""))?)
|
||||
}
|
||||
}
|
||||
|
||||
/// Single OTA update information
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, Eq, PartialEq)]
|
||||
pub struct OTAUpdate {
|
||||
|
Reference in New Issue
Block a user