1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
use serde::Deserialize;
use serde::de::Unexpected;
use serde::de;
use serde::Deserializer;
use zigbee2mqtt_types_base_types::LastSeen;
/// eurotronic:SPZB0001 [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/SPZB0001.html)
///
/// 
#[cfg_attr(feature = "debug", derive(Debug))]
#[cfg_attr(feature = "clone", derive(Clone))]
#[derive(Deserialize)]
pub struct ZigbeeSpzb0001 {
    ///Remaining battery in %, can take up to 24 hours before reported.
    pub battery: f64,
    ///Link quality (signal strength)
    pub linkquality: f64,
    ///Current temperature measured on the device
    pub local_temperature: f64,
    ///Offset to be used in the local_temperature
    pub local_temperature_calibration: f64,
    ///Temperature setpoint
    pub occupied_heating_setpoint: f64,
    ///Position of the valve (= demanded heat) where 0% is fully closed and 100% is fully open
    pub pi_heating_demand: f64,
    ///The current running state
    pub running_state: ZigbeeSpzb0001Runningstate,
    ///Mode of this device
    pub system_mode: ZigbeeSpzb0001Systemmode,
    ///Select between direct control of the valve via the `valve_position` or automatic control of the valve based on the `current_heating_setpoint`. For manual control set the value to 1, for automatic control set the value to 2 (the default). When switched to manual mode the display shows a value from 0 (valve closed) to 100 (valve fully open) and the buttons on the device are disabled.
    pub trv_mode: ZigbeeSpzb0001Trvmode,
    ///Directly control the radiator valve when `trv_mode` is set to 1. The values range from 0 (valve closed) to 255 (valve fully open)
    pub valve_position: f64,
    /// Optional last_seen type, set as a global zigbee2mqtt setting
    pub last_seen: Option<LastSeen>,
    /// Optional elapsed type
    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"}