Notify devices of available updates through sync endpoint

This commit is contained in:
2024-10-05 19:44:32 +02:00
parent d38040cb98
commit 37844ae5fa
3 changed files with 33 additions and 3 deletions

View File

@ -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 {