zigbee2mqtt_types_vendor_lidl/
lib.rs

1use serde::Deserialize;
2use serde::de::Unexpected;
3use serde::de;
4use serde::Deserializer;
5use zigbee2mqtt_types_base_types::LastSeen;
6/// lidl:HG06335/HG07310 [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/HG06335/HG07310.html)
7///
8/// 
9#[cfg_attr(feature = "debug", derive(Debug))]
10#[cfg_attr(feature = "clone", derive(Clone))]
11#[derive(Deserialize)]
12pub struct ZigbeeHg06335hg07310 {
13    ///Remaining battery in %, can take up to 24 hours before reported.
14    pub battery: f64,
15    ///Zigbee herdsman description: "Indicates if the battery of this device is almost empty"
16    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
17    pub battery_low: bool,
18    ///Link quality (signal strength)
19    pub linkquality: f64,
20    ///Zigbee herdsman description: "Indicates whether the device detected occupancy"
21    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
22    pub occupancy: bool,
23    ///Zigbee herdsman description: "Indicates whether the device is tampered"
24    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
25    pub tamper: bool,
26    /// Optional last_seen type, set as a global zigbee2mqtt setting
27    pub last_seen: Option<LastSeen>,
28    /// Optional elapsed type
29    pub elapsed: Option<u64>,
30}/// lidl:HG06336 [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/HG06336.html)
31///
32/// 
33#[cfg_attr(feature = "debug", derive(Debug))]
34#[cfg_attr(feature = "clone", derive(Clone))]
35#[derive(Deserialize)]
36pub struct ZigbeeHg06336 {
37    ///Remaining battery in %, can take up to 24 hours before reported.
38    pub battery: f64,
39    ///Zigbee herdsman description: "Indicates if the battery of this device is almost empty"
40    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
41    pub battery_low: bool,
42    ///Zigbee herdsman description: "Indicates if the contact is closed (= true) or open (= false)"
43    ///Boolean values can be an unintuitive way round: value_on = false and value_off = true, consider double checking Zigbee2MQTT to understand what they mean
44    pub contact: bool,
45    ///Link quality (signal strength)
46    pub linkquality: f64,
47    ///Zigbee herdsman description: "Indicates whether the device is tampered"
48    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
49    pub tamper: bool,
50    /// Optional last_seen type, set as a global zigbee2mqtt setting
51    pub last_seen: Option<LastSeen>,
52    /// Optional elapsed type
53    pub elapsed: Option<u64>,
54}/// lidl:HG06668 [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/HG06668.html)
55///
56/// 
57#[cfg_attr(feature = "debug", derive(Debug))]
58#[cfg_attr(feature = "clone", derive(Clone))]
59#[derive(Deserialize)]
60pub struct ZigbeeHg06668 {
61    ///Triggered action (e.g. a button click)
62    pub action: ZigbeeHg06668Action,
63    ///Remaining battery in %, can take up to 24 hours before reported.
64    pub battery: f64,
65    ///Zigbee herdsman description: "Indicates if the battery of this device is almost empty"
66    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
67    pub battery_low: bool,
68    ///Link quality (signal strength)
69    pub linkquality: f64,
70    ///Zigbee herdsman description: "Indicates whether the device is tampered"
71    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
72    pub tamper: bool,
73    /// Optional last_seen type, set as a global zigbee2mqtt setting
74    pub last_seen: Option<LastSeen>,
75    /// Optional elapsed type
76    pub elapsed: Option<u64>,
77}
78#[cfg_attr(feature = "debug", derive(Debug))]
79#[cfg_attr(feature = "clone", derive(Clone))]
80#[derive(Deserialize, PartialEq)]
81pub enum ZigbeeHg06668Action {
82    #[serde(rename = "pressed")]
83    Pressed,
84}
85#[cfg(all(feature = "last_seen_epoch", feature = "last_seen_iso_8601"))]
86compile_error!{"Feature last_seen epoch and iso_8601 are mutually exclusive and cannot be enabled together.
87This was done because it is a global setting in zigbee2mqtt and therefor can't see a reason both would be enabled.
88If you have a any reason to have both ways enabled please submit an issue to https://gitlab.com/seam345/zigbee2mqtt-types/-/issues"}