Store devices wrapped in Arc RwLock

This commit is contained in:
2023-08-11 02:24:58 +02:00
parent 7733e8cc8f
commit 330523166f
13 changed files with 538 additions and 457 deletions

View File

@@ -2,7 +2,7 @@ use serde::Serialize;
use crate::{errors::ErrorCode, response::State};
#[derive(Debug, Serialize)]
#[derive(Debug, Serialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct Payload {
#[serde(skip_serializing_if = "Option::is_none")]
@@ -34,7 +34,7 @@ impl Default for Payload {
}
}
#[derive(Debug, Serialize)]
#[derive(Debug, Serialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct Command {
#[serde(skip_serializing_if = "Option::is_none")]
@@ -65,7 +65,7 @@ impl Command {
}
}
#[derive(Debug, Serialize)]
#[derive(Debug, Serialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct States {
pub online: bool,
@@ -74,7 +74,7 @@ pub struct States {
pub state: State,
}
#[derive(Debug, Serialize)]
#[derive(Debug, Serialize, Clone)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum Status {
Success,