use serde::Deserialize;
use serde::de::Unexpected;
use serde::de;
use serde::Deserializer;
use zigbee2mqtt_types_base_types::LastSeen;
#[cfg_attr(feature = "debug", derive(Debug))]
#[cfg_attr(feature = "clone", derive(Clone))]
#[derive(Deserialize)]
pub struct ZigbeeSpzb0001 {
pub battery: f64,
pub linkquality: f64,
pub local_temperature: f64,
pub local_temperature_calibration: f64,
pub occupied_heating_setpoint: f64,
pub pi_heating_demand: f64,
pub running_state: ZigbeeSpzb0001Runningstate,
pub system_mode: ZigbeeSpzb0001Systemmode,
pub trv_mode: ZigbeeSpzb0001Trvmode,
pub valve_position: f64,
pub last_seen: Option<LastSeen>,
pub elapsed: Option<u64>,
}
#[cfg_attr(feature = "debug", derive(Debug))]
#[cfg_attr(feature = "clone", derive(Clone))]
#[derive(Deserialize, PartialEq)]
pub enum ZigbeeSpzb0001Runningstate {
#[serde(rename = "heat")]
Heat,
#[serde(rename = "idle")]
Idle,
}
#[cfg_attr(feature = "debug", derive(Debug))]
#[cfg_attr(feature = "clone", derive(Clone))]
#[derive(Deserialize, PartialEq)]
pub enum ZigbeeSpzb0001Systemmode {
#[serde(rename = "auto")]
Auto,
#[serde(rename = "heat")]
Heat,
#[serde(rename = "off")]
Off,
}
#[cfg_attr(feature = "debug", derive(Debug))]
#[cfg_attr(feature = "clone", derive(Clone))]
#[derive(Deserialize, PartialEq)]
pub enum ZigbeeSpzb0001Trvmode {
#[serde(rename = "1")]
Number1UnparseableForNow,
#[serde(rename = "2")]
Number2UnparseableForNow,
}
#[cfg(all(feature = "last_seen_epoch", feature = "last_seen_iso_8601"))]
compile_error!{"Feature last_seen epoch and iso_8601 are mutually exclusive and cannot be enabled together.
This was done because it is a global setting in zigbee2mqtt and therefor can't see a reason both would be enabled.
If you have a any reason to have both ways enabled please submit an issue to https://gitlab.com/seam345/zigbee2mqtt-types/-/issues"}