zigbee2mqtt_types_vendor_orvibo/
lib.rs

1use serde::Deserialize;
2use serde::de::Unexpected;
3use serde::de;
4use serde::Deserializer;
5use zigbee2mqtt_types_base_types::LastSeen;
6/// orvibo:AM25 [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/AM25.html)
7///
8/// 
9#[cfg_attr(feature = "debug", derive(Debug))]
10#[cfg_attr(feature = "clone", derive(Clone))]
11#[derive(Deserialize)]
12pub struct ZigbeeAm25 {
13    ///Remaining battery in %, can take up to 24 hours before reported.
14    pub battery: f64,
15    ///Link quality (signal strength)
16    pub linkquality: f64,
17    ///Position of this cover
18    pub position: f64,
19    pub state: ZigbeeAm25State,
20    /// Optional last_seen type, set as a global zigbee2mqtt setting
21    pub last_seen: Option<LastSeen>,
22    /// Optional elapsed type
23    pub elapsed: Option<u64>,
24}/// orvibo:CM10ZW [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/CM10ZW.html)
25///
26/// 
27#[cfg_attr(feature = "debug", derive(Debug))]
28#[cfg_attr(feature = "clone", derive(Clone))]
29#[derive(Deserialize)]
30pub struct ZigbeeCm10zw {
31    ///Link quality (signal strength)
32    pub linkquality: f64,
33    ///Zigbee herdsman description: "On/off state of the switch"
34    ///The string values get converted into boolean with: ON = true and OFF = false
35    #[serde(deserialize_with = "zigbeecm10zw_state_l1_deserializer")]
36    pub state_l1: bool,
37    ///Zigbee herdsman description: "On/off state of the switch"
38    ///The string values get converted into boolean with: ON = true and OFF = false
39    #[serde(deserialize_with = "zigbeecm10zw_state_l2_deserializer")]
40    pub state_l2: bool,
41    ///Zigbee herdsman description: "On/off state of the switch"
42    ///The string values get converted into boolean with: ON = true and OFF = false
43    #[serde(deserialize_with = "zigbeecm10zw_state_l3_deserializer")]
44    pub state_l3: bool,
45    /// Optional last_seen type, set as a global zigbee2mqtt setting
46    pub last_seen: Option<LastSeen>,
47    /// Optional elapsed type
48    pub elapsed: Option<u64>,
49}
50/// Deserialize bool from String with custom value mapping
51fn zigbeecm10zw_state_l1_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
52where
53    D: Deserializer<'de>,
54{
55    match String::deserialize(deserializer)?.as_ref() {
56        "ON" => Ok(true),
57        "OFF" => Ok(false),
58        other => Err(de::Error::invalid_value(
59            Unexpected::Str(other),
60            &"Value expected was either ON or OFF",
61        )),
62    }
63}
64
65
66/// Deserialize bool from String with custom value mapping
67fn zigbeecm10zw_state_l2_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
68where
69    D: Deserializer<'de>,
70{
71    match String::deserialize(deserializer)?.as_ref() {
72        "ON" => Ok(true),
73        "OFF" => Ok(false),
74        other => Err(de::Error::invalid_value(
75            Unexpected::Str(other),
76            &"Value expected was either ON or OFF",
77        )),
78    }
79}
80
81
82/// Deserialize bool from String with custom value mapping
83fn zigbeecm10zw_state_l3_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
84where
85    D: Deserializer<'de>,
86{
87    match String::deserialize(deserializer)?.as_ref() {
88        "ON" => Ok(true),
89        "OFF" => Ok(false),
90        other => Err(de::Error::invalid_value(
91            Unexpected::Str(other),
92            &"Value expected was either ON or OFF",
93        )),
94    }
95}
96
97/// orvibo:CR11S8UZ [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/CR11S8UZ.html)
98///
99/// 
100#[cfg_attr(feature = "debug", derive(Debug))]
101#[cfg_attr(feature = "clone", derive(Clone))]
102#[derive(Deserialize)]
103pub struct ZigbeeCr11s8uz {
104    ///Triggered action (e.g. a button click)
105    pub action: ZigbeeCr11s8uzAction,
106    ///Link quality (signal strength)
107    pub linkquality: f64,
108    /// Optional last_seen type, set as a global zigbee2mqtt setting
109    pub last_seen: Option<LastSeen>,
110    /// Optional elapsed type
111    pub elapsed: Option<u64>,
112}/// orvibo:DD10Z [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/DD10Z.html)
113///
114/// 
115#[cfg_attr(feature = "debug", derive(Debug))]
116#[cfg_attr(feature = "clone", derive(Clone))]
117#[derive(Deserialize)]
118pub struct ZigbeeDd10z {
119    ///Brightness of this light
120    pub brightness: f64,
121    ///Color temperature of this light
122    pub color_temp: f64,
123    ///Link quality (signal strength)
124    pub linkquality: f64,
125    ///Zigbee herdsman description: "On/off state of this light"
126    ///The string values get converted into boolean with: ON = true and OFF = false
127    #[serde(deserialize_with = "zigbeedd10z_state_deserializer")]
128    pub state: bool,
129    /// Optional last_seen type, set as a global zigbee2mqtt setting
130    pub last_seen: Option<LastSeen>,
131    /// Optional elapsed type
132    pub elapsed: Option<u64>,
133}
134/// Deserialize bool from String with custom value mapping
135fn zigbeedd10z_state_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
136where
137    D: Deserializer<'de>,
138{
139    match String::deserialize(deserializer)?.as_ref() {
140        "ON" => Ok(true),
141        "OFF" => Ok(false),
142        other => Err(de::Error::invalid_value(
143            Unexpected::Str(other),
144            &"Value expected was either ON or OFF",
145        )),
146    }
147}
148
149/// orvibo:DM10ZW [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/DM10ZW.html)
150///
151/// 
152#[cfg_attr(feature = "debug", derive(Debug))]
153#[cfg_attr(feature = "clone", derive(Clone))]
154#[derive(Deserialize)]
155pub struct ZigbeeDm10zw {
156    ///Brightness of this light
157    pub brightness: f64,
158    ///Color temperature of this light
159    pub color_temp: f64,
160    ///Color temperature after cold power on of this light
161    pub color_temp_startup: f64,
162    ///Link quality (signal strength)
163    pub linkquality: f64,
164    ///Controls the behavior when the device is powered on after power loss
165    pub power_on_behavior: ZigbeeDm10zwPoweronbehavior,
166    ///Zigbee herdsman description: "On/off state of this light"
167    ///The string values get converted into boolean with: ON = true and OFF = false
168    #[serde(deserialize_with = "zigbeedm10zw_state_deserializer")]
169    pub state: bool,
170    /// Optional last_seen type, set as a global zigbee2mqtt setting
171    pub last_seen: Option<LastSeen>,
172    /// Optional elapsed type
173    pub elapsed: Option<u64>,
174}
175/// Deserialize bool from String with custom value mapping
176fn zigbeedm10zw_state_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
177where
178    D: Deserializer<'de>,
179{
180    match String::deserialize(deserializer)?.as_ref() {
181        "ON" => Ok(true),
182        "OFF" => Ok(false),
183        other => Err(de::Error::invalid_value(
184            Unexpected::Str(other),
185            &"Value expected was either ON or OFF",
186        )),
187    }
188}
189
190/// orvibo:DS20Z07B [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/DS20Z07B.html)
191///
192/// 
193#[cfg_attr(feature = "debug", derive(Debug))]
194#[cfg_attr(feature = "clone", derive(Clone))]
195#[derive(Deserialize)]
196pub struct ZigbeeDs20z07b {
197    ///Brightness of this light
198    pub brightness: f64,
199    ///Color temperature of this light
200    pub color_temp: f64,
201    ///Color temperature after cold power on of this light
202    pub color_temp_startup: f64,
203    ///Link quality (signal strength)
204    pub linkquality: f64,
205    ///Controls the behavior when the device is powered on after power loss
206    pub power_on_behavior: ZigbeeDs20z07bPoweronbehavior,
207    ///Zigbee herdsman description: "On/off state of this light"
208    ///The string values get converted into boolean with: ON = true and OFF = false
209    #[serde(deserialize_with = "zigbeeds20z07b_state_deserializer")]
210    pub state: bool,
211    /// Optional last_seen type, set as a global zigbee2mqtt setting
212    pub last_seen: Option<LastSeen>,
213    /// Optional elapsed type
214    pub elapsed: Option<u64>,
215}
216/// Deserialize bool from String with custom value mapping
217fn zigbeeds20z07b_state_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
218where
219    D: Deserializer<'de>,
220{
221    match String::deserialize(deserializer)?.as_ref() {
222        "ON" => Ok(true),
223        "OFF" => Ok(false),
224        other => Err(de::Error::invalid_value(
225            Unexpected::Str(other),
226            &"Value expected was either ON or OFF",
227        )),
228    }
229}
230
231/// orvibo:DTZ09039 [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/DTZ09039.html)
232///
233/// 
234#[cfg_attr(feature = "debug", derive(Debug))]
235#[cfg_attr(feature = "clone", derive(Clone))]
236#[derive(Deserialize)]
237pub struct ZigbeeDtz09039 {
238    ///Brightness of this light
239    pub brightness: f64,
240    ///Link quality (signal strength)
241    pub linkquality: f64,
242    ///Controls the behavior when the device is powered on after power loss
243    pub power_on_behavior: ZigbeeDtz09039Poweronbehavior,
244    ///Zigbee herdsman description: "On/off state of this light"
245    ///The string values get converted into boolean with: ON = true and OFF = false
246    #[serde(deserialize_with = "zigbeedtz09039_state_deserializer")]
247    pub state: bool,
248    /// Optional last_seen type, set as a global zigbee2mqtt setting
249    pub last_seen: Option<LastSeen>,
250    /// Optional elapsed type
251    pub elapsed: Option<u64>,
252}
253/// Deserialize bool from String with custom value mapping
254fn zigbeedtz09039_state_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
255where
256    D: Deserializer<'de>,
257{
258    match String::deserialize(deserializer)?.as_ref() {
259        "ON" => Ok(true),
260        "OFF" => Ok(false),
261        other => Err(de::Error::invalid_value(
262            Unexpected::Str(other),
263            &"Value expected was either ON or OFF",
264        )),
265    }
266}
267
268/// orvibo:OR-ZB-S010-3C [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/OR-ZB-S010-3C.html)
269///
270/// 
271#[cfg_attr(feature = "debug", derive(Debug))]
272#[cfg_attr(feature = "clone", derive(Clone))]
273#[derive(Deserialize)]
274pub struct ZigbeeOrDzbDs010D3c {
275    ///Link quality (signal strength)
276    pub linkquality: f64,
277    ///Controls the behavior when the device is powered on after power loss
278    pub power_on_behavior: ZigbeeOrDzbDs010D3cPoweronbehavior,
279    ///Zigbee herdsman description: "On/off state of the switch"
280    ///The string values get converted into boolean with: ON = true and OFF = false
281    #[serde(deserialize_with = "zigbeeordzbds010d3c_state_deserializer")]
282    pub state: bool,
283    /// Optional last_seen type, set as a global zigbee2mqtt setting
284    pub last_seen: Option<LastSeen>,
285    /// Optional elapsed type
286    pub elapsed: Option<u64>,
287}
288/// Deserialize bool from String with custom value mapping
289fn zigbeeordzbds010d3c_state_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
290where
291    D: Deserializer<'de>,
292{
293    match String::deserialize(deserializer)?.as_ref() {
294        "ON" => Ok(true),
295        "OFF" => Ok(false),
296        other => Err(de::Error::invalid_value(
297            Unexpected::Str(other),
298            &"Value expected was either ON or OFF",
299        )),
300    }
301}
302
303/// orvibo:R11W2Z [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/R11W2Z.html)
304///
305/// 
306#[cfg_attr(feature = "debug", derive(Debug))]
307#[cfg_attr(feature = "clone", derive(Clone))]
308#[derive(Deserialize)]
309pub struct ZigbeeR11w2z {
310    ///Link quality (signal strength)
311    pub linkquality: f64,
312    ///Zigbee herdsman description: "On/off state of the switch"
313    ///The string values get converted into boolean with: ON = true and OFF = false
314    #[serde(deserialize_with = "zigbeer11w2z_state_l1_deserializer")]
315    pub state_l1: bool,
316    ///Zigbee herdsman description: "On/off state of the switch"
317    ///The string values get converted into boolean with: ON = true and OFF = false
318    #[serde(deserialize_with = "zigbeer11w2z_state_l2_deserializer")]
319    pub state_l2: bool,
320    /// Optional last_seen type, set as a global zigbee2mqtt setting
321    pub last_seen: Option<LastSeen>,
322    /// Optional elapsed type
323    pub elapsed: Option<u64>,
324}
325/// Deserialize bool from String with custom value mapping
326fn zigbeer11w2z_state_l1_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
327where
328    D: Deserializer<'de>,
329{
330    match String::deserialize(deserializer)?.as_ref() {
331        "ON" => Ok(true),
332        "OFF" => Ok(false),
333        other => Err(de::Error::invalid_value(
334            Unexpected::Str(other),
335            &"Value expected was either ON or OFF",
336        )),
337    }
338}
339
340
341/// Deserialize bool from String with custom value mapping
342fn zigbeer11w2z_state_l2_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
343where
344    D: Deserializer<'de>,
345{
346    match String::deserialize(deserializer)?.as_ref() {
347        "ON" => Ok(true),
348        "OFF" => Ok(false),
349        other => Err(de::Error::invalid_value(
350            Unexpected::Str(other),
351            &"Value expected was either ON or OFF",
352        )),
353    }
354}
355
356/// orvibo:R20W2Z [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/R20W2Z.html)
357///
358/// 
359#[cfg_attr(feature = "debug", derive(Debug))]
360#[cfg_attr(feature = "clone", derive(Clone))]
361#[derive(Deserialize)]
362pub struct ZigbeeR20w2z {
363    ///Link quality (signal strength)
364    pub linkquality: f64,
365    ///Zigbee herdsman description: "On/off state of the switch"
366    ///The string values get converted into boolean with: ON = true and OFF = false
367    #[serde(deserialize_with = "zigbeer20w2z_state_l1_deserializer")]
368    pub state_l1: bool,
369    ///Zigbee herdsman description: "On/off state of the switch"
370    ///The string values get converted into boolean with: ON = true and OFF = false
371    #[serde(deserialize_with = "zigbeer20w2z_state_l2_deserializer")]
372    pub state_l2: bool,
373    /// Optional last_seen type, set as a global zigbee2mqtt setting
374    pub last_seen: Option<LastSeen>,
375    /// Optional elapsed type
376    pub elapsed: Option<u64>,
377}
378/// Deserialize bool from String with custom value mapping
379fn zigbeer20w2z_state_l1_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
380where
381    D: Deserializer<'de>,
382{
383    match String::deserialize(deserializer)?.as_ref() {
384        "ON" => Ok(true),
385        "OFF" => Ok(false),
386        other => Err(de::Error::invalid_value(
387            Unexpected::Str(other),
388            &"Value expected was either ON or OFF",
389        )),
390    }
391}
392
393
394/// Deserialize bool from String with custom value mapping
395fn zigbeer20w2z_state_l2_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
396where
397    D: Deserializer<'de>,
398{
399    match String::deserialize(deserializer)?.as_ref() {
400        "ON" => Ok(true),
401        "OFF" => Ok(false),
402        other => Err(de::Error::invalid_value(
403            Unexpected::Str(other),
404            &"Value expected was either ON or OFF",
405        )),
406    }
407}
408
409/// orvibo:R30W3Z [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/R30W3Z.html)
410///
411/// 
412#[cfg_attr(feature = "debug", derive(Debug))]
413#[cfg_attr(feature = "clone", derive(Clone))]
414#[derive(Deserialize)]
415pub struct ZigbeeR30w3z {
416    ///Link quality (signal strength)
417    pub linkquality: f64,
418    ///Zigbee herdsman description: "On/off state of the switch"
419    ///The string values get converted into boolean with: ON = true and OFF = false
420    #[serde(deserialize_with = "zigbeer30w3z_state_center_deserializer")]
421    pub state_center: bool,
422    ///Zigbee herdsman description: "On/off state of the switch"
423    ///The string values get converted into boolean with: ON = true and OFF = false
424    #[serde(deserialize_with = "zigbeer30w3z_state_left_deserializer")]
425    pub state_left: bool,
426    ///Zigbee herdsman description: "On/off state of the switch"
427    ///The string values get converted into boolean with: ON = true and OFF = false
428    #[serde(deserialize_with = "zigbeer30w3z_state_right_deserializer")]
429    pub state_right: bool,
430    /// Optional last_seen type, set as a global zigbee2mqtt setting
431    pub last_seen: Option<LastSeen>,
432    /// Optional elapsed type
433    pub elapsed: Option<u64>,
434}
435/// Deserialize bool from String with custom value mapping
436fn zigbeer30w3z_state_center_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
437where
438    D: Deserializer<'de>,
439{
440    match String::deserialize(deserializer)?.as_ref() {
441        "ON" => Ok(true),
442        "OFF" => Ok(false),
443        other => Err(de::Error::invalid_value(
444            Unexpected::Str(other),
445            &"Value expected was either ON or OFF",
446        )),
447    }
448}
449
450
451/// Deserialize bool from String with custom value mapping
452fn zigbeer30w3z_state_left_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
453where
454    D: Deserializer<'de>,
455{
456    match String::deserialize(deserializer)?.as_ref() {
457        "ON" => Ok(true),
458        "OFF" => Ok(false),
459        other => Err(de::Error::invalid_value(
460            Unexpected::Str(other),
461            &"Value expected was either ON or OFF",
462        )),
463    }
464}
465
466
467/// Deserialize bool from String with custom value mapping
468fn zigbeer30w3z_state_right_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
469where
470    D: Deserializer<'de>,
471{
472    match String::deserialize(deserializer)?.as_ref() {
473        "ON" => Ok(true),
474        "OFF" => Ok(false),
475        other => Err(de::Error::invalid_value(
476            Unexpected::Str(other),
477            &"Value expected was either ON or OFF",
478        )),
479    }
480}
481
482/// orvibo:RL804CZB [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/RL804CZB.html)
483///
484/// 
485#[cfg_attr(feature = "debug", derive(Debug))]
486#[cfg_attr(feature = "clone", derive(Clone))]
487#[derive(Deserialize)]
488pub struct ZigbeeRl804czb {
489    ///Brightness of this light
490    pub brightness: f64,
491    ///Color temperature of this light
492    pub color_temp: f64,
493    ///Color temperature after cold power on of this light
494    pub color_temp_startup: f64,
495    ///Link quality (signal strength)
496    pub linkquality: f64,
497    ///Controls the behavior when the device is powered on after power loss
498    pub power_on_behavior: ZigbeeRl804czbPoweronbehavior,
499    ///Zigbee herdsman description: "On/off state of this light"
500    ///The string values get converted into boolean with: ON = true and OFF = false
501    #[serde(deserialize_with = "zigbeerl804czb_state_deserializer")]
502    pub state: bool,
503    /// Optional last_seen type, set as a global zigbee2mqtt setting
504    pub last_seen: Option<LastSeen>,
505    /// Optional elapsed type
506    pub elapsed: Option<u64>,
507}
508/// Deserialize bool from String with custom value mapping
509fn zigbeerl804czb_state_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
510where
511    D: Deserializer<'de>,
512{
513    match String::deserialize(deserializer)?.as_ref() {
514        "ON" => Ok(true),
515        "OFF" => Ok(false),
516        other => Err(de::Error::invalid_value(
517            Unexpected::Str(other),
518            &"Value expected was either ON or OFF",
519        )),
520    }
521}
522
523/// orvibo:RL804QZB [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/RL804QZB.html)
524///
525/// 
526#[cfg_attr(feature = "debug", derive(Debug))]
527#[cfg_attr(feature = "clone", derive(Clone))]
528#[derive(Deserialize)]
529pub struct ZigbeeRl804qzb {
530    ///Link quality (signal strength)
531    pub linkquality: f64,
532    ///Zigbee herdsman description: "On/off state of the switch"
533    ///The string values get converted into boolean with: ON = true and OFF = false
534    #[serde(deserialize_with = "zigbeerl804qzb_state_l1_deserializer")]
535    pub state_l1: bool,
536    ///Zigbee herdsman description: "On/off state of the switch"
537    ///The string values get converted into boolean with: ON = true and OFF = false
538    #[serde(deserialize_with = "zigbeerl804qzb_state_l2_deserializer")]
539    pub state_l2: bool,
540    ///Zigbee herdsman description: "On/off state of the switch"
541    ///The string values get converted into boolean with: ON = true and OFF = false
542    #[serde(deserialize_with = "zigbeerl804qzb_state_l3_deserializer")]
543    pub state_l3: bool,
544    /// Optional last_seen type, set as a global zigbee2mqtt setting
545    pub last_seen: Option<LastSeen>,
546    /// Optional elapsed type
547    pub elapsed: Option<u64>,
548}
549/// Deserialize bool from String with custom value mapping
550fn zigbeerl804qzb_state_l1_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
551where
552    D: Deserializer<'de>,
553{
554    match String::deserialize(deserializer)?.as_ref() {
555        "ON" => Ok(true),
556        "OFF" => Ok(false),
557        other => Err(de::Error::invalid_value(
558            Unexpected::Str(other),
559            &"Value expected was either ON or OFF",
560        )),
561    }
562}
563
564
565/// Deserialize bool from String with custom value mapping
566fn zigbeerl804qzb_state_l2_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
567where
568    D: Deserializer<'de>,
569{
570    match String::deserialize(deserializer)?.as_ref() {
571        "ON" => Ok(true),
572        "OFF" => Ok(false),
573        other => Err(de::Error::invalid_value(
574            Unexpected::Str(other),
575            &"Value expected was either ON or OFF",
576        )),
577    }
578}
579
580
581/// Deserialize bool from String with custom value mapping
582fn zigbeerl804qzb_state_l3_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
583where
584    D: Deserializer<'de>,
585{
586    match String::deserialize(deserializer)?.as_ref() {
587        "ON" => Ok(true),
588        "OFF" => Ok(false),
589        other => Err(de::Error::invalid_value(
590            Unexpected::Str(other),
591            &"Value expected was either ON or OFF",
592        )),
593    }
594}
595
596/// orvibo:SE21 [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/SE21.html)
597///
598/// 
599#[cfg_attr(feature = "debug", derive(Debug))]
600#[cfg_attr(feature = "clone", derive(Clone))]
601#[derive(Deserialize)]
602pub struct ZigbeeSe21 {
603    ///Triggered action (e.g. a button click)
604    pub action: ZigbeeSe21Action,
605    ///Link quality (signal strength)
606    pub linkquality: f64,
607    /// Optional last_seen type, set as a global zigbee2mqtt setting
608    pub last_seen: Option<LastSeen>,
609    /// Optional elapsed type
610    pub elapsed: Option<u64>,
611}/// orvibo:SM10ZW [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/SM10ZW.html)
612///
613/// 
614#[cfg_attr(feature = "debug", derive(Debug))]
615#[cfg_attr(feature = "clone", derive(Clone))]
616#[derive(Deserialize)]
617pub struct ZigbeeSm10zw {
618    ///Remaining battery in %, can take up to 24 hours before reported.
619    pub battery: f64,
620    ///Zigbee herdsman description: "Indicates if the battery of this device is almost empty"
621    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
622    pub battery_low: bool,
623    ///Zigbee herdsman description: "Indicates if the contact is closed (= true) or open (= false)"
624    ///Boolean values can be an unintuitive way round: value_on = false and value_off = true, consider double checking Zigbee2MQTT to understand what they mean
625    pub contact: bool,
626    ///Link quality (signal strength)
627    pub linkquality: f64,
628    ///Zigbee herdsman description: "Indicates whether the device is tampered"
629    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
630    pub tamper: bool,
631    /// Optional last_seen type, set as a global zigbee2mqtt setting
632    pub last_seen: Option<LastSeen>,
633    /// Optional elapsed type
634    pub elapsed: Option<u64>,
635}/// orvibo:SM20 [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/SM20.html)
636///
637/// 
638#[cfg_attr(feature = "debug", derive(Debug))]
639#[cfg_attr(feature = "clone", derive(Clone))]
640#[derive(Deserialize)]
641pub struct ZigbeeSm20 {
642    ///Remaining battery in %, can take up to 24 hours before reported.
643    pub battery: f64,
644    ///Zigbee herdsman description: "Indicates if the battery of this device is almost empty"
645    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
646    pub battery_low: bool,
647    ///Zigbee herdsman description: "Indicates if the contact is closed (= true) or open (= false)"
648    ///Boolean values can be an unintuitive way round: value_on = false and value_off = true, consider double checking Zigbee2MQTT to understand what they mean
649    pub contact: bool,
650    ///Link quality (signal strength)
651    pub linkquality: f64,
652    ///Zigbee herdsman description: "Indicates whether the device is tampered"
653    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
654    pub tamper: bool,
655    /// Optional last_seen type, set as a global zigbee2mqtt setting
656    pub last_seen: Option<LastSeen>,
657    /// Optional elapsed type
658    pub elapsed: Option<u64>,
659}/// orvibo:SN10ZW [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/SN10ZW.html)
660///
661/// 
662#[cfg_attr(feature = "debug", derive(Debug))]
663#[cfg_attr(feature = "clone", derive(Clone))]
664#[derive(Deserialize)]
665pub struct ZigbeeSn10zw {
666    ///Remaining battery in %, can take up to 24 hours before reported.
667    pub battery: f64,
668    ///Zigbee herdsman description: "Indicates if the battery of this device is almost empty"
669    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
670    pub battery_low: bool,
671    ///Link quality (signal strength)
672    pub linkquality: f64,
673    ///Zigbee herdsman description: "Indicates whether the device detected occupancy"
674    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
675    pub occupancy: bool,
676    ///Zigbee herdsman description: "Indicates whether the device is tampered"
677    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
678    pub tamper: bool,
679    /// Optional last_seen type, set as a global zigbee2mqtt setting
680    pub last_seen: Option<LastSeen>,
681    /// Optional elapsed type
682    pub elapsed: Option<u64>,
683}/// orvibo:ST20 [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/ST20.html)
684///
685/// 
686#[cfg_attr(feature = "debug", derive(Debug))]
687#[cfg_attr(feature = "clone", derive(Clone))]
688#[derive(Deserialize)]
689pub struct ZigbeeSt20 {
690    ///Remaining battery in %, can take up to 24 hours before reported.
691    pub battery: f64,
692    ///Measured relative humidity
693    pub humidity: f64,
694    ///Link quality (signal strength)
695    pub linkquality: f64,
696    ///Measured temperature value
697    pub temperature: f64,
698    /// Optional last_seen type, set as a global zigbee2mqtt setting
699    pub last_seen: Option<LastSeen>,
700    /// Optional elapsed type
701    pub elapsed: Option<u64>,
702}/// orvibo:ST21 [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/ST21.html)
703///
704/// 
705#[cfg_attr(feature = "debug", derive(Debug))]
706#[cfg_attr(feature = "clone", derive(Clone))]
707#[derive(Deserialize)]
708pub struct ZigbeeSt21 {
709    ///Remaining battery in %, can take up to 24 hours before reported.
710    pub battery: f64,
711    ///Measured relative humidity
712    pub humidity: f64,
713    ///Link quality (signal strength)
714    pub linkquality: f64,
715    ///Measured temperature value
716    pub temperature: f64,
717    /// Optional last_seen type, set as a global zigbee2mqtt setting
718    pub last_seen: Option<LastSeen>,
719    /// Optional elapsed type
720    pub elapsed: Option<u64>,
721}/// orvibo:ST30 [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/ST30.html)
722///
723/// 
724#[cfg_attr(feature = "debug", derive(Debug))]
725#[cfg_attr(feature = "clone", derive(Clone))]
726#[derive(Deserialize)]
727pub struct ZigbeeSt30 {
728    ///Remaining battery in %, can take up to 24 hours before reported.
729    pub battery: f64,
730    ///Measured relative humidity
731    pub humidity: f64,
732    ///Link quality (signal strength)
733    pub linkquality: f64,
734    ///Measured temperature value
735    pub temperature: f64,
736    /// Optional last_seen type, set as a global zigbee2mqtt setting
737    pub last_seen: Option<LastSeen>,
738    /// Optional elapsed type
739    pub elapsed: Option<u64>,
740}/// orvibo:SW21 [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/SW21.html)
741///
742/// 
743#[cfg_attr(feature = "debug", derive(Debug))]
744#[cfg_attr(feature = "clone", derive(Clone))]
745#[derive(Deserialize)]
746pub struct ZigbeeSw21 {
747    ///Zigbee herdsman description: "Indicates if the battery of this device is almost empty"
748    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
749    pub battery_low: bool,
750    ///Link quality (signal strength)
751    pub linkquality: f64,
752    ///Zigbee herdsman description: "Indicates whether the device is tampered"
753    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
754    pub tamper: bool,
755    ///Zigbee herdsman description: "Indicates whether the device detected a water leak"
756    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
757    pub water_leak: bool,
758    /// Optional last_seen type, set as a global zigbee2mqtt setting
759    pub last_seen: Option<LastSeen>,
760    /// Optional elapsed type
761    pub elapsed: Option<u64>,
762}/// orvibo:SW30 [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/SW30.html)
763///
764/// 
765#[cfg_attr(feature = "debug", derive(Debug))]
766#[cfg_attr(feature = "clone", derive(Clone))]
767#[derive(Deserialize)]
768pub struct ZigbeeSw30 {
769    ///Zigbee herdsman description: "Indicates if the battery of this device is almost empty"
770    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
771    pub battery_low: bool,
772    ///Link quality (signal strength)
773    pub linkquality: f64,
774    ///Zigbee herdsman description: "Indicates whether the device is tampered"
775    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
776    pub tamper: bool,
777    ///Zigbee herdsman description: "Indicates whether the device detected a water leak"
778    ///Boolean values can be an unintuitive way round: value_on = true and value_off = false, consider double checking Zigbee2MQTT to understand what they mean
779    pub water_leak: bool,
780    /// Optional last_seen type, set as a global zigbee2mqtt setting
781    pub last_seen: Option<LastSeen>,
782    /// Optional elapsed type
783    pub elapsed: Option<u64>,
784}/// orvibo:T18W3Z [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/T18W3Z.html)
785///
786/// 
787#[cfg_attr(feature = "debug", derive(Debug))]
788#[cfg_attr(feature = "clone", derive(Clone))]
789#[derive(Deserialize)]
790pub struct ZigbeeT18w3z {
791    ///Link quality (signal strength)
792    pub linkquality: f64,
793    ///Zigbee herdsman description: "On/off state of the switch"
794    ///The string values get converted into boolean with: ON = true and OFF = false
795    #[serde(deserialize_with = "zigbeet18w3z_state_l1_deserializer")]
796    pub state_l1: bool,
797    ///Zigbee herdsman description: "On/off state of the switch"
798    ///The string values get converted into boolean with: ON = true and OFF = false
799    #[serde(deserialize_with = "zigbeet18w3z_state_l2_deserializer")]
800    pub state_l2: bool,
801    ///Zigbee herdsman description: "On/off state of the switch"
802    ///The string values get converted into boolean with: ON = true and OFF = false
803    #[serde(deserialize_with = "zigbeet18w3z_state_l3_deserializer")]
804    pub state_l3: bool,
805    /// Optional last_seen type, set as a global zigbee2mqtt setting
806    pub last_seen: Option<LastSeen>,
807    /// Optional elapsed type
808    pub elapsed: Option<u64>,
809}
810/// Deserialize bool from String with custom value mapping
811fn zigbeet18w3z_state_l1_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
812where
813    D: Deserializer<'de>,
814{
815    match String::deserialize(deserializer)?.as_ref() {
816        "ON" => Ok(true),
817        "OFF" => Ok(false),
818        other => Err(de::Error::invalid_value(
819            Unexpected::Str(other),
820            &"Value expected was either ON or OFF",
821        )),
822    }
823}
824
825
826/// Deserialize bool from String with custom value mapping
827fn zigbeet18w3z_state_l2_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
828where
829    D: Deserializer<'de>,
830{
831    match String::deserialize(deserializer)?.as_ref() {
832        "ON" => Ok(true),
833        "OFF" => Ok(false),
834        other => Err(de::Error::invalid_value(
835            Unexpected::Str(other),
836            &"Value expected was either ON or OFF",
837        )),
838    }
839}
840
841
842/// Deserialize bool from String with custom value mapping
843fn zigbeet18w3z_state_l3_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
844where
845    D: Deserializer<'de>,
846{
847    match String::deserialize(deserializer)?.as_ref() {
848        "ON" => Ok(true),
849        "OFF" => Ok(false),
850        other => Err(de::Error::invalid_value(
851            Unexpected::Str(other),
852            &"Value expected was either ON or OFF",
853        )),
854    }
855}
856
857/// orvibo:T21W1Z [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/T21W1Z.html)
858///
859/// 
860#[cfg_attr(feature = "debug", derive(Debug))]
861#[cfg_attr(feature = "clone", derive(Clone))]
862#[derive(Deserialize)]
863pub struct ZigbeeT21w1z {
864    ///Link quality (signal strength)
865    pub linkquality: f64,
866    ///Controls the behavior when the device is powered on after power loss
867    pub power_on_behavior: ZigbeeT21w1zPoweronbehavior,
868    ///Zigbee herdsman description: "On/off state of the switch"
869    ///The string values get converted into boolean with: ON = true and OFF = false
870    #[serde(deserialize_with = "zigbeet21w1z_state_deserializer")]
871    pub state: bool,
872    /// Optional last_seen type, set as a global zigbee2mqtt setting
873    pub last_seen: Option<LastSeen>,
874    /// Optional elapsed type
875    pub elapsed: Option<u64>,
876}
877/// Deserialize bool from String with custom value mapping
878fn zigbeet21w1z_state_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
879where
880    D: Deserializer<'de>,
881{
882    match String::deserialize(deserializer)?.as_ref() {
883        "ON" => Ok(true),
884        "OFF" => Ok(false),
885        other => Err(de::Error::invalid_value(
886            Unexpected::Str(other),
887            &"Value expected was either ON or OFF",
888        )),
889    }
890}
891
892/// orvibo:T21W2Z [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/T21W2Z.html)
893///
894/// 
895#[cfg_attr(feature = "debug", derive(Debug))]
896#[cfg_attr(feature = "clone", derive(Clone))]
897#[derive(Deserialize)]
898pub struct ZigbeeT21w2z {
899    ///Link quality (signal strength)
900    pub linkquality: f64,
901    ///Zigbee herdsman description: "On/off state of the switch"
902    ///The string values get converted into boolean with: ON = true and OFF = false
903    #[serde(deserialize_with = "zigbeet21w2z_state_bottom_deserializer")]
904    pub state_bottom: bool,
905    ///Zigbee herdsman description: "On/off state of the switch"
906    ///The string values get converted into boolean with: ON = true and OFF = false
907    #[serde(deserialize_with = "zigbeet21w2z_state_top_deserializer")]
908    pub state_top: bool,
909    /// Optional last_seen type, set as a global zigbee2mqtt setting
910    pub last_seen: Option<LastSeen>,
911    /// Optional elapsed type
912    pub elapsed: Option<u64>,
913}
914/// Deserialize bool from String with custom value mapping
915fn zigbeet21w2z_state_bottom_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
916where
917    D: Deserializer<'de>,
918{
919    match String::deserialize(deserializer)?.as_ref() {
920        "ON" => Ok(true),
921        "OFF" => Ok(false),
922        other => Err(de::Error::invalid_value(
923            Unexpected::Str(other),
924            &"Value expected was either ON or OFF",
925        )),
926    }
927}
928
929
930/// Deserialize bool from String with custom value mapping
931fn zigbeet21w2z_state_top_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
932where
933    D: Deserializer<'de>,
934{
935    match String::deserialize(deserializer)?.as_ref() {
936        "ON" => Ok(true),
937        "OFF" => Ok(false),
938        other => Err(de::Error::invalid_value(
939            Unexpected::Str(other),
940            &"Value expected was either ON or OFF",
941        )),
942    }
943}
944
945/// orvibo:T30W3Z [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/T30W3Z.html)
946///
947/// 
948#[cfg_attr(feature = "debug", derive(Debug))]
949#[cfg_attr(feature = "clone", derive(Clone))]
950#[derive(Deserialize)]
951pub struct ZigbeeT30w3z {
952    ///Link quality (signal strength)
953    pub linkquality: f64,
954    ///Zigbee herdsman description: "On/off state of the switch"
955    ///The string values get converted into boolean with: ON = true and OFF = false
956    #[serde(deserialize_with = "zigbeet30w3z_state_bottom_deserializer")]
957    pub state_bottom: bool,
958    ///Zigbee herdsman description: "On/off state of the switch"
959    ///The string values get converted into boolean with: ON = true and OFF = false
960    #[serde(deserialize_with = "zigbeet30w3z_state_center_deserializer")]
961    pub state_center: bool,
962    ///Zigbee herdsman description: "On/off state of the switch"
963    ///The string values get converted into boolean with: ON = true and OFF = false
964    #[serde(deserialize_with = "zigbeet30w3z_state_top_deserializer")]
965    pub state_top: bool,
966    /// Optional last_seen type, set as a global zigbee2mqtt setting
967    pub last_seen: Option<LastSeen>,
968    /// Optional elapsed type
969    pub elapsed: Option<u64>,
970}
971/// Deserialize bool from String with custom value mapping
972fn zigbeet30w3z_state_bottom_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
973where
974    D: Deserializer<'de>,
975{
976    match String::deserialize(deserializer)?.as_ref() {
977        "ON" => Ok(true),
978        "OFF" => Ok(false),
979        other => Err(de::Error::invalid_value(
980            Unexpected::Str(other),
981            &"Value expected was either ON or OFF",
982        )),
983    }
984}
985
986
987/// Deserialize bool from String with custom value mapping
988fn zigbeet30w3z_state_center_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
989where
990    D: Deserializer<'de>,
991{
992    match String::deserialize(deserializer)?.as_ref() {
993        "ON" => Ok(true),
994        "OFF" => Ok(false),
995        other => Err(de::Error::invalid_value(
996            Unexpected::Str(other),
997            &"Value expected was either ON or OFF",
998        )),
999    }
1000}
1001
1002
1003/// Deserialize bool from String with custom value mapping
1004fn zigbeet30w3z_state_top_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1005where
1006    D: Deserializer<'de>,
1007{
1008    match String::deserialize(deserializer)?.as_ref() {
1009        "ON" => Ok(true),
1010        "OFF" => Ok(false),
1011        other => Err(de::Error::invalid_value(
1012            Unexpected::Str(other),
1013            &"Value expected was either ON or OFF",
1014        )),
1015    }
1016}
1017
1018/// orvibo:T40S6Z [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/T40S6Z.html)
1019///
1020/// 
1021#[cfg_attr(feature = "debug", derive(Debug))]
1022#[cfg_attr(feature = "clone", derive(Clone))]
1023#[derive(Deserialize)]
1024pub struct ZigbeeT40s6z {
1025    ///Triggered action (e.g. a button click)
1026    pub action: ZigbeeT40s6zAction,
1027    ///Link quality (signal strength)
1028    pub linkquality: f64,
1029    /// Optional last_seen type, set as a global zigbee2mqtt setting
1030    pub last_seen: Option<LastSeen>,
1031    /// Optional elapsed type
1032    pub elapsed: Option<u64>,
1033}/// orvibo:T40W1Z [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/T40W1Z.html)
1034///
1035/// 
1036#[cfg_attr(feature = "debug", derive(Debug))]
1037#[cfg_attr(feature = "clone", derive(Clone))]
1038#[derive(Deserialize)]
1039pub struct ZigbeeT40w1z {
1040    ///Link quality (signal strength)
1041    pub linkquality: f64,
1042    ///Zigbee herdsman description: "On/off state of the switch"
1043    ///The string values get converted into boolean with: ON = true and OFF = false
1044    #[serde(deserialize_with = "zigbeet40w1z_state_deserializer")]
1045    pub state: bool,
1046    /// Optional last_seen type, set as a global zigbee2mqtt setting
1047    pub last_seen: Option<LastSeen>,
1048    /// Optional elapsed type
1049    pub elapsed: Option<u64>,
1050}
1051/// Deserialize bool from String with custom value mapping
1052fn zigbeet40w1z_state_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1053where
1054    D: Deserializer<'de>,
1055{
1056    match String::deserialize(deserializer)?.as_ref() {
1057        "ON" => Ok(true),
1058        "OFF" => Ok(false),
1059        other => Err(de::Error::invalid_value(
1060            Unexpected::Str(other),
1061            &"Value expected was either ON or OFF",
1062        )),
1063    }
1064}
1065
1066/// orvibo:T40W2Z [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/T40W2Z.html)
1067///
1068/// 
1069#[cfg_attr(feature = "debug", derive(Debug))]
1070#[cfg_attr(feature = "clone", derive(Clone))]
1071#[derive(Deserialize)]
1072pub struct ZigbeeT40w2z {
1073    ///Link quality (signal strength)
1074    pub linkquality: f64,
1075    ///Zigbee herdsman description: "On/off state of the switch"
1076    ///The string values get converted into boolean with: ON = true and OFF = false
1077    #[serde(deserialize_with = "zigbeet40w2z_state_left_deserializer")]
1078    pub state_left: bool,
1079    ///Zigbee herdsman description: "On/off state of the switch"
1080    ///The string values get converted into boolean with: ON = true and OFF = false
1081    #[serde(deserialize_with = "zigbeet40w2z_state_right_deserializer")]
1082    pub state_right: bool,
1083    /// Optional last_seen type, set as a global zigbee2mqtt setting
1084    pub last_seen: Option<LastSeen>,
1085    /// Optional elapsed type
1086    pub elapsed: Option<u64>,
1087}
1088/// Deserialize bool from String with custom value mapping
1089fn zigbeet40w2z_state_left_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1090where
1091    D: Deserializer<'de>,
1092{
1093    match String::deserialize(deserializer)?.as_ref() {
1094        "ON" => Ok(true),
1095        "OFF" => Ok(false),
1096        other => Err(de::Error::invalid_value(
1097            Unexpected::Str(other),
1098            &"Value expected was either ON or OFF",
1099        )),
1100    }
1101}
1102
1103
1104/// Deserialize bool from String with custom value mapping
1105fn zigbeet40w2z_state_right_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1106where
1107    D: Deserializer<'de>,
1108{
1109    match String::deserialize(deserializer)?.as_ref() {
1110        "ON" => Ok(true),
1111        "OFF" => Ok(false),
1112        other => Err(de::Error::invalid_value(
1113            Unexpected::Str(other),
1114            &"Value expected was either ON or OFF",
1115        )),
1116    }
1117}
1118
1119/// orvibo:T40W3Z [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/T40W3Z.html)
1120///
1121/// 
1122#[cfg_attr(feature = "debug", derive(Debug))]
1123#[cfg_attr(feature = "clone", derive(Clone))]
1124#[derive(Deserialize)]
1125pub struct ZigbeeT40w3z {
1126    ///Link quality (signal strength)
1127    pub linkquality: f64,
1128    ///Zigbee herdsman description: "On/off state of the switch"
1129    ///The string values get converted into boolean with: ON = true and OFF = false
1130    #[serde(deserialize_with = "zigbeet40w3z_state_center_deserializer")]
1131    pub state_center: bool,
1132    ///Zigbee herdsman description: "On/off state of the switch"
1133    ///The string values get converted into boolean with: ON = true and OFF = false
1134    #[serde(deserialize_with = "zigbeet40w3z_state_left_deserializer")]
1135    pub state_left: bool,
1136    ///Zigbee herdsman description: "On/off state of the switch"
1137    ///The string values get converted into boolean with: ON = true and OFF = false
1138    #[serde(deserialize_with = "zigbeet40w3z_state_right_deserializer")]
1139    pub state_right: bool,
1140    /// Optional last_seen type, set as a global zigbee2mqtt setting
1141    pub last_seen: Option<LastSeen>,
1142    /// Optional elapsed type
1143    pub elapsed: Option<u64>,
1144}
1145/// Deserialize bool from String with custom value mapping
1146fn zigbeet40w3z_state_center_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1147where
1148    D: Deserializer<'de>,
1149{
1150    match String::deserialize(deserializer)?.as_ref() {
1151        "ON" => Ok(true),
1152        "OFF" => Ok(false),
1153        other => Err(de::Error::invalid_value(
1154            Unexpected::Str(other),
1155            &"Value expected was either ON or OFF",
1156        )),
1157    }
1158}
1159
1160
1161/// Deserialize bool from String with custom value mapping
1162fn zigbeet40w3z_state_left_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1163where
1164    D: Deserializer<'de>,
1165{
1166    match String::deserialize(deserializer)?.as_ref() {
1167        "ON" => Ok(true),
1168        "OFF" => Ok(false),
1169        other => Err(de::Error::invalid_value(
1170            Unexpected::Str(other),
1171            &"Value expected was either ON or OFF",
1172        )),
1173    }
1174}
1175
1176
1177/// Deserialize bool from String with custom value mapping
1178fn zigbeet40w3z_state_right_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1179where
1180    D: Deserializer<'de>,
1181{
1182    match String::deserialize(deserializer)?.as_ref() {
1183        "ON" => Ok(true),
1184        "OFF" => Ok(false),
1185        other => Err(de::Error::invalid_value(
1186            Unexpected::Str(other),
1187            &"Value expected was either ON or OFF",
1188        )),
1189    }
1190}
1191
1192/// orvibo:T40W4Z [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/T40W4Z.html)
1193///
1194/// 
1195#[cfg_attr(feature = "debug", derive(Debug))]
1196#[cfg_attr(feature = "clone", derive(Clone))]
1197#[derive(Deserialize)]
1198pub struct ZigbeeT40w4z {
1199    ///Link quality (signal strength)
1200    pub linkquality: f64,
1201    ///Zigbee herdsman description: "On/off state of the switch"
1202    ///The string values get converted into boolean with: ON = true and OFF = false
1203    #[serde(deserialize_with = "zigbeet40w4z_state_l1_deserializer")]
1204    pub state_l1: bool,
1205    ///Zigbee herdsman description: "On/off state of the switch"
1206    ///The string values get converted into boolean with: ON = true and OFF = false
1207    #[serde(deserialize_with = "zigbeet40w4z_state_l2_deserializer")]
1208    pub state_l2: bool,
1209    ///Zigbee herdsman description: "On/off state of the switch"
1210    ///The string values get converted into boolean with: ON = true and OFF = false
1211    #[serde(deserialize_with = "zigbeet40w4z_state_l3_deserializer")]
1212    pub state_l3: bool,
1213    ///Zigbee herdsman description: "On/off state of the switch"
1214    ///The string values get converted into boolean with: ON = true and OFF = false
1215    #[serde(deserialize_with = "zigbeet40w4z_state_l4_deserializer")]
1216    pub state_l4: bool,
1217    ///Zigbee herdsman description: "On/off state of the switch"
1218    ///The string values get converted into boolean with: ON = true and OFF = false
1219    #[serde(deserialize_with = "zigbeet40w4z_state_l5_deserializer")]
1220    pub state_l5: bool,
1221    ///Zigbee herdsman description: "On/off state of the switch"
1222    ///The string values get converted into boolean with: ON = true and OFF = false
1223    #[serde(deserialize_with = "zigbeet40w4z_state_l6_deserializer")]
1224    pub state_l6: bool,
1225    /// Optional last_seen type, set as a global zigbee2mqtt setting
1226    pub last_seen: Option<LastSeen>,
1227    /// Optional elapsed type
1228    pub elapsed: Option<u64>,
1229}
1230/// Deserialize bool from String with custom value mapping
1231fn zigbeet40w4z_state_l1_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1232where
1233    D: Deserializer<'de>,
1234{
1235    match String::deserialize(deserializer)?.as_ref() {
1236        "ON" => Ok(true),
1237        "OFF" => Ok(false),
1238        other => Err(de::Error::invalid_value(
1239            Unexpected::Str(other),
1240            &"Value expected was either ON or OFF",
1241        )),
1242    }
1243}
1244
1245
1246/// Deserialize bool from String with custom value mapping
1247fn zigbeet40w4z_state_l2_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1248where
1249    D: Deserializer<'de>,
1250{
1251    match String::deserialize(deserializer)?.as_ref() {
1252        "ON" => Ok(true),
1253        "OFF" => Ok(false),
1254        other => Err(de::Error::invalid_value(
1255            Unexpected::Str(other),
1256            &"Value expected was either ON or OFF",
1257        )),
1258    }
1259}
1260
1261
1262/// Deserialize bool from String with custom value mapping
1263fn zigbeet40w4z_state_l3_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1264where
1265    D: Deserializer<'de>,
1266{
1267    match String::deserialize(deserializer)?.as_ref() {
1268        "ON" => Ok(true),
1269        "OFF" => Ok(false),
1270        other => Err(de::Error::invalid_value(
1271            Unexpected::Str(other),
1272            &"Value expected was either ON or OFF",
1273        )),
1274    }
1275}
1276
1277
1278/// Deserialize bool from String with custom value mapping
1279fn zigbeet40w4z_state_l4_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1280where
1281    D: Deserializer<'de>,
1282{
1283    match String::deserialize(deserializer)?.as_ref() {
1284        "ON" => Ok(true),
1285        "OFF" => Ok(false),
1286        other => Err(de::Error::invalid_value(
1287            Unexpected::Str(other),
1288            &"Value expected was either ON or OFF",
1289        )),
1290    }
1291}
1292
1293
1294/// Deserialize bool from String with custom value mapping
1295fn zigbeet40w4z_state_l5_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1296where
1297    D: Deserializer<'de>,
1298{
1299    match String::deserialize(deserializer)?.as_ref() {
1300        "ON" => Ok(true),
1301        "OFF" => Ok(false),
1302        other => Err(de::Error::invalid_value(
1303            Unexpected::Str(other),
1304            &"Value expected was either ON or OFF",
1305        )),
1306    }
1307}
1308
1309
1310/// Deserialize bool from String with custom value mapping
1311fn zigbeet40w4z_state_l6_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1312where
1313    D: Deserializer<'de>,
1314{
1315    match String::deserialize(deserializer)?.as_ref() {
1316        "ON" => Ok(true),
1317        "OFF" => Ok(false),
1318        other => Err(de::Error::invalid_value(
1319            Unexpected::Str(other),
1320            &"Value expected was either ON or OFF",
1321        )),
1322    }
1323}
1324
1325/// orvibo:T41W1Z [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/T41W1Z.html)
1326///
1327/// 
1328#[cfg_attr(feature = "debug", derive(Debug))]
1329#[cfg_attr(feature = "clone", derive(Clone))]
1330#[derive(Deserialize)]
1331pub struct ZigbeeT41w1z {
1332    ///Link quality (signal strength)
1333    pub linkquality: f64,
1334    ///Zigbee herdsman description: "On/off state of the switch"
1335    ///The string values get converted into boolean with: ON = true and OFF = false
1336    #[serde(deserialize_with = "zigbeet41w1z_state_deserializer")]
1337    pub state: bool,
1338    /// Optional last_seen type, set as a global zigbee2mqtt setting
1339    pub last_seen: Option<LastSeen>,
1340    /// Optional elapsed type
1341    pub elapsed: Option<u64>,
1342}
1343/// Deserialize bool from String with custom value mapping
1344fn zigbeet41w1z_state_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1345where
1346    D: Deserializer<'de>,
1347{
1348    match String::deserialize(deserializer)?.as_ref() {
1349        "ON" => Ok(true),
1350        "OFF" => Ok(false),
1351        other => Err(de::Error::invalid_value(
1352            Unexpected::Str(other),
1353            &"Value expected was either ON or OFF",
1354        )),
1355    }
1356}
1357
1358/// orvibo:T41W2Z [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/T41W2Z.html)
1359///
1360/// 
1361#[cfg_attr(feature = "debug", derive(Debug))]
1362#[cfg_attr(feature = "clone", derive(Clone))]
1363#[derive(Deserialize)]
1364pub struct ZigbeeT41w2z {
1365    ///Link quality (signal strength)
1366    pub linkquality: f64,
1367    ///Zigbee herdsman description: "On/off state of the switch"
1368    ///The string values get converted into boolean with: ON = true and OFF = false
1369    #[serde(deserialize_with = "zigbeet41w2z_state_left_deserializer")]
1370    pub state_left: bool,
1371    ///Zigbee herdsman description: "On/off state of the switch"
1372    ///The string values get converted into boolean with: ON = true and OFF = false
1373    #[serde(deserialize_with = "zigbeet41w2z_state_right_deserializer")]
1374    pub state_right: bool,
1375    /// Optional last_seen type, set as a global zigbee2mqtt setting
1376    pub last_seen: Option<LastSeen>,
1377    /// Optional elapsed type
1378    pub elapsed: Option<u64>,
1379}
1380/// Deserialize bool from String with custom value mapping
1381fn zigbeet41w2z_state_left_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1382where
1383    D: Deserializer<'de>,
1384{
1385    match String::deserialize(deserializer)?.as_ref() {
1386        "ON" => Ok(true),
1387        "OFF" => Ok(false),
1388        other => Err(de::Error::invalid_value(
1389            Unexpected::Str(other),
1390            &"Value expected was either ON or OFF",
1391        )),
1392    }
1393}
1394
1395
1396/// Deserialize bool from String with custom value mapping
1397fn zigbeet41w2z_state_right_deserializer<'de, D>(deserializer: D) -> Result<bool, D::Error>
1398where
1399    D: Deserializer<'de>,
1400{
1401    match String::deserialize(deserializer)?.as_ref() {
1402        "ON" => Ok(true),
1403        "OFF" => Ok(false),
1404        other => Err(de::Error::invalid_value(
1405            Unexpected::Str(other),
1406            &"Value expected was either ON or OFF",
1407        )),
1408    }
1409}
1410
1411/// orvibo:W40CZ [zigbee2mqtt link](https://www.zigbee2mqtt.io/devices/W40CZ.html)
1412///
1413/// 
1414#[cfg_attr(feature = "debug", derive(Debug))]
1415#[cfg_attr(feature = "clone", derive(Clone))]
1416#[derive(Deserialize)]
1417pub struct ZigbeeW40cz {
1418    ///Link quality (signal strength)
1419    pub linkquality: f64,
1420    ///Position of this cover
1421    pub position: f64,
1422    pub state: ZigbeeW40czState,
1423    /// Optional last_seen type, set as a global zigbee2mqtt setting
1424    pub last_seen: Option<LastSeen>,
1425    /// Optional elapsed type
1426    pub elapsed: Option<u64>,
1427}
1428#[cfg_attr(feature = "debug", derive(Debug))]
1429#[cfg_attr(feature = "clone", derive(Clone))]
1430#[derive(Deserialize, PartialEq)]
1431pub enum ZigbeeAm25State {
1432    #[serde(rename = "CLOSE")]
1433    Close,
1434    #[serde(rename = "OPEN")]
1435    Open,
1436    #[serde(rename = "STOP")]
1437    Stop,
1438}
1439#[cfg_attr(feature = "debug", derive(Debug))]
1440#[cfg_attr(feature = "clone", derive(Clone))]
1441#[derive(Deserialize, PartialEq)]
1442pub enum ZigbeeCr11s8uzAction {
1443    #[serde(rename = "button_1_click")]
1444    Button1Click,
1445    #[serde(rename = "button_1_hold")]
1446    Button1Hold,
1447    #[serde(rename = "button_1_release")]
1448    Button1Release,
1449    #[serde(rename = "button_2_click")]
1450    Button2Click,
1451    #[serde(rename = "button_2_hold")]
1452    Button2Hold,
1453    #[serde(rename = "button_2_release")]
1454    Button2Release,
1455    #[serde(rename = "button_3_click")]
1456    Button3Click,
1457    #[serde(rename = "button_3_hold")]
1458    Button3Hold,
1459    #[serde(rename = "button_3_release")]
1460    Button3Release,
1461    #[serde(rename = "button_4_click")]
1462    Button4Click,
1463    #[serde(rename = "button_4_hold")]
1464    Button4Hold,
1465    #[serde(rename = "button_4_release")]
1466    Button4Release,
1467}
1468#[cfg_attr(feature = "debug", derive(Debug))]
1469#[cfg_attr(feature = "clone", derive(Clone))]
1470#[derive(Deserialize, PartialEq)]
1471pub enum ZigbeeDm10zwPoweronbehavior {
1472    #[serde(rename = "off")]
1473    Off,
1474    #[serde(rename = "on")]
1475    On,
1476    #[serde(rename = "previous")]
1477    Previous,
1478    #[serde(rename = "toggle")]
1479    Toggle,
1480}
1481#[cfg_attr(feature = "debug", derive(Debug))]
1482#[cfg_attr(feature = "clone", derive(Clone))]
1483#[derive(Deserialize, PartialEq)]
1484pub enum ZigbeeDs20z07bPoweronbehavior {
1485    #[serde(rename = "off")]
1486    Off,
1487    #[serde(rename = "on")]
1488    On,
1489    #[serde(rename = "previous")]
1490    Previous,
1491    #[serde(rename = "toggle")]
1492    Toggle,
1493}
1494#[cfg_attr(feature = "debug", derive(Debug))]
1495#[cfg_attr(feature = "clone", derive(Clone))]
1496#[derive(Deserialize, PartialEq)]
1497pub enum ZigbeeDtz09039Poweronbehavior {
1498    #[serde(rename = "off")]
1499    Off,
1500    #[serde(rename = "on")]
1501    On,
1502    #[serde(rename = "previous")]
1503    Previous,
1504    #[serde(rename = "toggle")]
1505    Toggle,
1506}
1507#[cfg_attr(feature = "debug", derive(Debug))]
1508#[cfg_attr(feature = "clone", derive(Clone))]
1509#[derive(Deserialize, PartialEq)]
1510pub enum ZigbeeOrDzbDs010D3cPoweronbehavior {
1511    #[serde(rename = "off")]
1512    Off,
1513    #[serde(rename = "on")]
1514    On,
1515    #[serde(rename = "previous")]
1516    Previous,
1517    #[serde(rename = "toggle")]
1518    Toggle,
1519}
1520#[cfg_attr(feature = "debug", derive(Debug))]
1521#[cfg_attr(feature = "clone", derive(Clone))]
1522#[derive(Deserialize, PartialEq)]
1523pub enum ZigbeeRl804czbPoweronbehavior {
1524    #[serde(rename = "off")]
1525    Off,
1526    #[serde(rename = "on")]
1527    On,
1528    #[serde(rename = "previous")]
1529    Previous,
1530    #[serde(rename = "toggle")]
1531    Toggle,
1532}
1533#[cfg_attr(feature = "debug", derive(Debug))]
1534#[cfg_attr(feature = "clone", derive(Clone))]
1535#[derive(Deserialize, PartialEq)]
1536pub enum ZigbeeSe21Action {
1537    #[serde(rename = "double")]
1538    Double,
1539    #[serde(rename = "hold")]
1540    Hold,
1541    #[serde(rename = "off")]
1542    Off,
1543    #[serde(rename = "single")]
1544    Single,
1545}
1546#[cfg_attr(feature = "debug", derive(Debug))]
1547#[cfg_attr(feature = "clone", derive(Clone))]
1548#[derive(Deserialize, PartialEq)]
1549pub enum ZigbeeT21w1zPoweronbehavior {
1550    #[serde(rename = "off")]
1551    Off,
1552    #[serde(rename = "on")]
1553    On,
1554    #[serde(rename = "previous")]
1555    Previous,
1556    #[serde(rename = "toggle")]
1557    Toggle,
1558}
1559#[cfg_attr(feature = "debug", derive(Debug))]
1560#[cfg_attr(feature = "clone", derive(Clone))]
1561#[derive(Deserialize, PartialEq)]
1562pub enum ZigbeeT40s6zAction {
1563    #[serde(rename = "button_1_click")]
1564    Button1Click,
1565    #[serde(rename = "button_2_click")]
1566    Button2Click,
1567    #[serde(rename = "button_3_click")]
1568    Button3Click,
1569    #[serde(rename = "button_4_click")]
1570    Button4Click,
1571    #[serde(rename = "button_5_click")]
1572    Button5Click,
1573    #[serde(rename = "button_6_click")]
1574    Button6Click,
1575}
1576#[cfg_attr(feature = "debug", derive(Debug))]
1577#[cfg_attr(feature = "clone", derive(Clone))]
1578#[derive(Deserialize, PartialEq)]
1579pub enum ZigbeeW40czState {
1580    #[serde(rename = "CLOSE")]
1581    Close,
1582    #[serde(rename = "OPEN")]
1583    Open,
1584    #[serde(rename = "STOP")]
1585    Stop,
1586}
1587#[cfg(all(feature = "last_seen_epoch", feature = "last_seen_iso_8601"))]
1588compile_error!{"Feature last_seen epoch and iso_8601 are mutually exclusive and cannot be enabled together.
1589This was done because it is a global setting in zigbee2mqtt and therefor can't see a reason both would be enabled.
1590If you have a any reason to have both ways enabled please submit an issue to https://gitlab.com/seam345/zigbee2mqtt-types/-/issues"}