Deserialize all properties of the light resource
This commit is contained in:
parent
f0e773a37e
commit
903582291c
1 changed files with 22 additions and 20 deletions
|
@ -2,26 +2,27 @@ use serde::{Deserialize, Serialize};
|
|||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Light {
|
||||
// #[serde(rename = "alert")]
|
||||
// pub alert: Alert,
|
||||
#[serde(rename = "alert")]
|
||||
pub alert: Alert,
|
||||
|
||||
// #[serde(rename = "color")]
|
||||
// pub color: Option<Color>,
|
||||
#[serde(rename = "color")]
|
||||
pub color: Option<Color>,
|
||||
|
||||
// #[serde(rename = "color_temperature")]
|
||||
// pub color_temperature: ColorTemperature,
|
||||
#[serde(rename = "color_temperature")]
|
||||
pub color_temperature: ColorTemperature,
|
||||
|
||||
// #[serde(rename = "color_temperature_delta")]
|
||||
// pub color_temperature_delta: Delta,
|
||||
#[serde(rename = "color_temperature_delta")]
|
||||
pub color_temperature_delta: Delta,
|
||||
|
||||
// #[serde(rename = "dimming")]
|
||||
// pub dimming: Dimming,
|
||||
#[serde(rename = "dimming")]
|
||||
pub dimming: Dimming,
|
||||
|
||||
// #[serde(rename = "dimming_delta")]
|
||||
// pub dimming_delta: Delta,
|
||||
#[serde(rename = "dimming_delta")]
|
||||
pub dimming_delta: Delta,
|
||||
|
||||
#[serde(rename = "dynamics")]
|
||||
pub dynamics: Dynamics,
|
||||
|
||||
// #[serde(rename = "dynamics")]
|
||||
// pub dynamics: Dynamics,
|
||||
#[serde(rename = "id")]
|
||||
pub id: String,
|
||||
|
||||
|
@ -39,11 +40,12 @@ pub struct Light {
|
|||
|
||||
#[serde(rename = "owner")]
|
||||
pub owner: Owner,
|
||||
// #[serde(rename = "type")]
|
||||
// pub datum_type: String,
|
||||
//
|
||||
// #[serde(rename = "effects")]
|
||||
// pub effects: Option<Effects>,
|
||||
|
||||
#[serde(rename = "type")]
|
||||
pub datum_type: String,
|
||||
|
||||
#[serde(rename = "effects")]
|
||||
pub effects: Option<Effects>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
|
@ -121,7 +123,7 @@ pub struct Dimming {
|
|||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Dynamics {
|
||||
#[serde(rename = "speed")]
|
||||
pub speed: i64,
|
||||
pub speed: f64,
|
||||
|
||||
#[serde(rename = "speed_valid")]
|
||||
pub speed_valid: bool,
|
||||
|
|
Loading…
Reference in a new issue