Deserialize all properties of the light resource

This commit is contained in:
Daan Boerlage 2022-04-09 22:52:39 +02:00
parent f0e773a37e
commit 903582291c
Signed by: daan
GPG key ID: FCE070E1E4956606

View file

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