Added temperature to air_filter
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#![allow(non_snake_case)]
|
||||
use automation_cast::Cast;
|
||||
use google_home_macro::traits;
|
||||
use serde::Serialize;
|
||||
@@ -33,6 +34,13 @@ traits! {
|
||||
query_only_humidity_setting: Option<bool>,
|
||||
|
||||
fn humidity_ambient_percent(&self) -> Result<isize, ErrorCode>,
|
||||
},
|
||||
"action.devices.traits.TemperatureControl" => trait TemperatureSetting {
|
||||
query_only_temperature_control: Option<bool>,
|
||||
// TODO: Add rename
|
||||
temperatureUnitForUX: TemperatureUnit,
|
||||
|
||||
fn temperature_ambient_celsius(&self) -> f32,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,3 +61,11 @@ pub struct AvailableSpeeds {
|
||||
pub speeds: Vec<Speed>,
|
||||
pub ordered: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub enum TemperatureUnit {
|
||||
#[serde(rename = "C")]
|
||||
Celsius,
|
||||
#[serde(rename = "F")]
|
||||
Fahrenheit,
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ fn get_state_struct(t: &Trait) -> proc_macro2::TokenStream {
|
||||
|
||||
let name = get_state_struct_ident(t);
|
||||
quote! {
|
||||
#[derive(Debug, Default, serde::Serialize)]
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct #name {
|
||||
#(#fields,)*
|
||||
|
||||
Reference in New Issue
Block a user