Skip to main content

matter_kit/clusters/generated/
occupancy_sensing.rs

1// Generated by `cargo xtask` from the CSA data model 1.6. Do not edit.
2//
3// Occupancy Sensing — cluster 0x0406.
4//
5// Regenerate with `cargo xtask clusters --dm <checkout>/data_model/1.6`; `cargo xtask check`
6// is the CI gate that keeps this file honest. The XML itself is not vendored here — it
7// carries the CSA's own copyright notice and is not redistributable.
8
9//! Occupancy Sensing (cluster `0x0406`, revision 7).
10//!
11//! 15 identifiers, 9 feature bits, and the specification's own conformance for
12//! every element. `CLUSTER` is the whole table.
13
14#![allow(unused_imports)]
15
16use crate::dm::conformance::{Clause, Condition, Conform, Conformance};
17use crate::dm::meta::{EventPriority, Reporting};
18use crate::dm::spec::{Attribute, Cluster, Command, Event, Feature};
19use crate::dm::{Access, AccessQualities, AttributeQualities, Privilege};
20use crate::error::Result;
21use crate::im::{AttributeId, ClusterId, CommandId, EventId};
22use crate::tlv::{
23    ContainerKind, Element, FromTlv, Nullable, Tag, TlvList, TlvReader, TlvWriter, ToTlv, Value,
24};
25
26/// The cluster id.
27pub const ID: ClusterId = 0x0406;
28
29/// The highest revision the specification's history defines — what `ClusterRevision`
30/// must report (Core §7.13.1).
31pub const REVISION: u16 = 7;
32
33/// The PICS code, which a certification declaration names the cluster by.
34pub const PICS: &str = "OCC";
35
36/// The `FeatureMap` bits (Core §7.13.2).
37///
38/// A feature has conformance of its own: a device may not claim one the
39/// specification forbids it alongside another.
40pub mod feature {
41    /// Supports sensing using a modality not listed in the other bits
42    ///
43    /// Code `OTHER`, bit 0.
44    pub const OTHER: u32 = 1 << 0;
45    /// Supports sensing using PIR (Passive InfraRed)
46    ///
47    /// Code `PIR`, bit 1.
48    pub const PASSIVE_INFRARED: u32 = 1 << 1;
49    /// Supports sensing using UltraSound
50    ///
51    /// Code `US`, bit 2.
52    pub const ULTRASONIC: u32 = 1 << 2;
53    /// Supports sensing using a physical contact
54    ///
55    /// Code `PHY`, bit 3.
56    pub const PHYSICAL_CONTACT: u32 = 1 << 3;
57    /// Supports sensing using Active InfraRed measurement (e.g. time-of-flight or transflective/reflective IR sensing)
58    ///
59    /// Code `AIR`, bit 4.
60    pub const ACTIVE_INFRARED: u32 = 1 << 4;
61    /// Supports sensing using radar waves (microwave)
62    ///
63    /// Code `RAD`, bit 5.
64    pub const RADAR: u32 = 1 << 5;
65    /// Supports sensing using analysis of radio signals, e.g.: RSSI, CSI and/or any other metric from the signal
66    ///
67    /// Code `RFS`, bit 6.
68    pub const RF_SENSING: u32 = 1 << 6;
69    /// Supports sensing based on analyzing images
70    ///
71    /// Code `VIS`, bit 7.
72    pub const VISION: u32 = 1 << 7;
73    /// Supports generating OccupancyChanged events
74    ///
75    /// Code `OCCEVENT`, bit 9.
76    pub const OCCUPANCY_EVENT: u32 = 1 << 9;
77}
78
79/// Every feature bit, with its conformance.
80pub const FEATURES: &[Feature] = &[
81    Feature {
82        bit: 0,
83        code: "OTHER",
84        name: "Other",
85        conform: Conform::OPTIONAL,
86    },
87    Feature {
88        bit: 1,
89        code: "PIR",
90        name: "PassiveInfrared",
91        conform: Conform::OPTIONAL,
92    },
93    Feature {
94        bit: 2,
95        code: "US",
96        name: "Ultrasonic",
97        conform: Conform::OPTIONAL,
98    },
99    Feature {
100        bit: 3,
101        code: "PHY",
102        name: "PhysicalContact",
103        conform: Conform::OPTIONAL,
104    },
105    Feature {
106        bit: 4,
107        code: "AIR",
108        name: "ActiveInfrared",
109        conform: Conform::OPTIONAL,
110    },
111    Feature {
112        bit: 5,
113        code: "RAD",
114        name: "Radar",
115        conform: Conform::OPTIONAL,
116    },
117    Feature {
118        bit: 6,
119        code: "RFS",
120        name: "RFSensing",
121        conform: Conform::OPTIONAL,
122    },
123    Feature {
124        bit: 7,
125        code: "VIS",
126        name: "Vision",
127        conform: Conform::OPTIONAL,
128    },
129    Feature {
130        bit: 9,
131        code: "OCCEVENT",
132        name: "OccupancyEvent",
133        conform: Conform {
134            clauses: &[Clause {
135                verdict: Conformance::Described,
136                when: Condition::Named("comparison"),
137            }],
138        },
139    },
140];
141
142/// The attribute ids.
143pub mod attribute {
144    use crate::im::AttributeId;
145
146    /// `Occupancy`.
147    pub const OCCUPANCY: AttributeId = 0x00;
148    /// `OccupancySensorType`.
149    pub const OCCUPANCY_SENSOR_TYPE: AttributeId = 0x01;
150    /// `OccupancySensorTypeBitmap`.
151    pub const OCCUPANCY_SENSOR_TYPE_BITMAP: AttributeId = 0x02;
152    /// `HoldTime`.
153    pub const HOLD_TIME: AttributeId = 0x03;
154    /// `HoldTimeLimits`.
155    pub const HOLD_TIME_LIMITS: AttributeId = 0x04;
156    /// `PIROccupiedToUnoccupiedDelay`.
157    pub const PIR_OCCUPIED_TO_UNOCCUPIED_DELAY: AttributeId = 0x10;
158    /// `PIRUnoccupiedToOccupiedDelay`.
159    pub const PIR_UNOCCUPIED_TO_OCCUPIED_DELAY: AttributeId = 0x11;
160    /// `PIRUnoccupiedToOccupiedThreshold`.
161    pub const PIR_UNOCCUPIED_TO_OCCUPIED_THRESHOLD: AttributeId = 0x12;
162    /// `UltrasonicOccupiedToUnoccupiedDelay`.
163    pub const ULTRASONIC_OCCUPIED_TO_UNOCCUPIED_DELAY: AttributeId = 0x20;
164    /// `UltrasonicUnoccupiedToOccupiedDelay`.
165    pub const ULTRASONIC_UNOCCUPIED_TO_OCCUPIED_DELAY: AttributeId = 0x21;
166    /// `UltrasonicUnoccupiedToOccupiedThreshold`.
167    pub const ULTRASONIC_UNOCCUPIED_TO_OCCUPIED_THRESHOLD: AttributeId = 0x22;
168    /// `PhysicalContactOccupiedToUnoccupiedDelay`.
169    pub const PHYSICAL_CONTACT_OCCUPIED_TO_UNOCCUPIED_DELAY: AttributeId = 0x30;
170    /// `PhysicalContactUnoccupiedToOccupiedDelay`.
171    pub const PHYSICAL_CONTACT_UNOCCUPIED_TO_OCCUPIED_DELAY: AttributeId = 0x31;
172    /// `PhysicalContactUnoccupiedToOccupiedThreshold`.
173    pub const PHYSICAL_CONTACT_UNOCCUPIED_TO_OCCUPIED_THRESHOLD: AttributeId = 0x32;
174}
175
176/// The event ids.
177pub mod event {
178    use crate::im::EventId;
179
180    /// `OccupancyChanged`.
181    pub const OCCUPANCY_CHANGED: EventId = 0x00;
182}
183
184/// `OccupancySensorTypeEnum`.
185#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
186#[repr(u8)]
187pub enum OccupancySensorTypeEnum {
188    /// Indicates a passive infrared sensor.
189    PIR = 0,
190    /// Indicates a ultrasonic sensor.
191    Ultrasonic = 1,
192    /// Indicates a passive infrared and ultrasonic sensor.
193    PIRAndUltrasonic = 2,
194    /// Indicates a physical contact sensor.
195    PhysicalContact = 3,
196}
197
198impl OccupancySensorTypeEnum {
199    /// Reads a wire value, or `None` for one this revision does not define.
200    #[must_use]
201    pub const fn from_value(value: u8) -> Option<Self> {
202        match value {
203            0 => Some(Self::PIR),
204            1 => Some(Self::Ultrasonic),
205            2 => Some(Self::PIRAndUltrasonic),
206            3 => Some(Self::PhysicalContact),
207            _ => None,
208        }
209    }
210
211    /// Its wire value.
212    #[must_use]
213    pub const fn value(self) -> u8 {
214        self as u8
215    }
216}
217
218impl ToTlv for OccupancySensorTypeEnum {
219    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
220        self.value().to_tlv(w, tag)
221    }
222}
223
224impl<'a> FromTlv<'a> for OccupancySensorTypeEnum {
225    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
226        let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
227        Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
228    }
229}
230
231bitflags::bitflags! {
232    /// `OccupancyBitmap`.
233    #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
234    pub struct OccupancyBitmap: u8 {
235        /// Indicates the sensed occupancy state
236        const OCCUPIED = 1 << 0;
237    }
238}
239
240impl ToTlv for OccupancyBitmap {
241    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
242        self.bits().to_tlv(w, tag)
243    }
244}
245
246impl<'a> FromTlv<'a> for OccupancyBitmap {
247    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
248        let bits = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
249        Self::from_bits(bits).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
250    }
251}
252
253bitflags::bitflags! {
254    /// `OccupancySensorTypeBitmap`.
255    #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
256    pub struct OccupancySensorTypeBitmap: u8 {
257        /// Indicates a passive infrared sensor.
258        const PIR = 1 << 0;
259        /// Indicates a ultrasonic sensor.
260        const ULTRASONIC = 1 << 1;
261        /// Indicates a physical contact sensor.
262        const PHYSICAL_CONTACT = 1 << 2;
263    }
264}
265
266impl ToTlv for OccupancySensorTypeBitmap {
267    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
268        self.bits().to_tlv(w, tag)
269    }
270}
271
272impl<'a> FromTlv<'a> for OccupancySensorTypeBitmap {
273    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
274        let bits = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
275        Self::from_bits(bits).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
276    }
277}
278
279/// `HoldTimeLimitsStruct`.
280#[derive(Debug, Clone, Copy, PartialEq)]
281pub struct HoldTimeLimitsStruct {
282    /// `HoldTimeMin`, field 0.
283    pub hold_time_min: u16,
284    /// `HoldTimeMax`, field 1.
285    pub hold_time_max: u16,
286    /// `HoldTimeDefault`, field 2.
287    pub hold_time_default: u16,
288}
289
290impl ToTlv for HoldTimeLimitsStruct {
291    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
292        w.start_structure(tag)?;
293        self.hold_time_min.to_tlv(w, Tag::Context(0))?;
294        self.hold_time_max.to_tlv(w, Tag::Context(1))?;
295        self.hold_time_default.to_tlv(w, Tag::Context(2))?;
296        w.end_container()
297    }
298}
299
300impl<'a> FromTlv<'a> for HoldTimeLimitsStruct {
301    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
302        if element.value.container() != Some(ContainerKind::Structure) {
303            return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
304        }
305        let mut hold_time_min = None;
306        let mut hold_time_max = None;
307        let mut hold_time_default = None;
308        loop {
309            let Some(field) = reader.next_element()? else {
310                return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
311            };
312            if field.value == Value::EndOfContainer {
313                break;
314            }
315            match field.tag.context() {
316                Some(0) => hold_time_min = Some(<u16>::from_tlv(reader, &field)?),
317                Some(1) => hold_time_max = Some(<u16>::from_tlv(reader, &field)?),
318                Some(2) => hold_time_default = Some(<u16>::from_tlv(reader, &field)?),
319                // A field this revision does not define. §7.19.2: a receiver
320                // ignores what it does not know rather than refusing the whole
321                // structure, which is what lets a newer peer talk to an older one.
322                _ => reader.skip_value(&field)?,
323            }
324        }
325        Ok(Self {
326            hold_time_min: hold_time_min.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
327            hold_time_max: hold_time_max.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
328            hold_time_default: hold_time_default
329                .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
330        })
331    }
332}
333
334/// Every attribute the specification defines, with its conformance.
335pub const ATTRIBUTES: &[Attribute] = &[
336    Attribute {
337        id: 0x0000,
338        name: "Occupancy",
339        kind: "OccupancyBitmap",
340        access: Access::read_only(Privilege::View),
341        qualities: AttributeQualities::empty(),
342        reporting: Reporting::OnChange,
343        conform: Conform::MANDATORY,
344    },
345    Attribute {
346        id: 0x0001,
347        name: "OccupancySensorType",
348        kind: "OccupancySensorTypeEnum",
349        access: Access::read_only(Privilege::View),
350        qualities: AttributeQualities::FIXED,
351        reporting: Reporting::OnChange,
352        conform: Conform {
353            clauses: &[
354                Clause {
355                    verdict: Conformance::Mandatory,
356                    when: Condition::Always,
357                },
358                Clause {
359                    verdict: Conformance::Deprecated,
360                    when: Condition::Always,
361                },
362            ],
363        },
364    },
365    Attribute {
366        id: 0x0002,
367        name: "OccupancySensorTypeBitmap",
368        kind: "OccupancySensorTypeBitmap",
369        access: Access::read_only(Privilege::View),
370        qualities: AttributeQualities::FIXED,
371        reporting: Reporting::OnChange,
372        conform: Conform {
373            clauses: &[
374                Clause {
375                    verdict: Conformance::Mandatory,
376                    when: Condition::Always,
377                },
378                Clause {
379                    verdict: Conformance::Deprecated,
380                    when: Condition::Always,
381                },
382            ],
383        },
384    },
385    Attribute {
386        id: 0x0003,
387        name: "HoldTime",
388        kind: "uint16",
389        access: Access::read_write_with(Privilege::View, Privilege::Manage),
390        qualities: AttributeQualities::NON_VOLATILE,
391        reporting: Reporting::OnChange,
392        conform: Conform::OPTIONAL,
393    },
394    Attribute {
395        id: 0x0004,
396        name: "HoldTimeLimits",
397        kind: "HoldTimeLimitsStruct",
398        access: Access::read_only(Privilege::View),
399        qualities: AttributeQualities::FIXED,
400        reporting: Reporting::OnChange,
401        conform: Conform {
402            clauses: &[Clause {
403                verdict: Conformance::Mandatory,
404                when: Condition::Attribute(0x0003),
405            }],
406        },
407    },
408    Attribute {
409        id: 0x0010,
410        name: "PIROccupiedToUnoccupiedDelay",
411        kind: "uint16",
412        access: Access::read_write_with(Privilege::View, Privilege::Manage),
413        qualities: AttributeQualities::NON_VOLATILE,
414        reporting: Reporting::OnChange,
415        conform: Conform {
416            clauses: &[
417                Clause {
418                    verdict: Conformance::Optional,
419                    when: Condition::All(&[
420                        Condition::Attribute(0x0003),
421                        Condition::Any(&[
422                            Condition::Feature(1),
423                            Condition::All(&[
424                                Condition::Not(&Condition::Feature(1)),
425                                Condition::Not(&Condition::Feature(2)),
426                                Condition::Not(&Condition::Feature(3)),
427                            ]),
428                        ]),
429                    ]),
430                },
431                Clause {
432                    verdict: Conformance::Deprecated,
433                    when: Condition::Always,
434                },
435            ],
436        },
437    },
438    Attribute {
439        id: 0x0011,
440        name: "PIRUnoccupiedToOccupiedDelay",
441        kind: "uint16",
442        access: Access::read_write_with(Privilege::View, Privilege::Manage),
443        qualities: AttributeQualities::NON_VOLATILE,
444        reporting: Reporting::OnChange,
445        conform: Conform {
446            clauses: &[
447                Clause {
448                    verdict: Conformance::Mandatory,
449                    when: Condition::All(&[
450                        Condition::All(&[
451                            Condition::Attribute(0x0003),
452                            Condition::Any(&[
453                                Condition::Feature(1),
454                                Condition::All(&[
455                                    Condition::Not(&Condition::Feature(1)),
456                                    Condition::Not(&Condition::Feature(2)),
457                                    Condition::Not(&Condition::Feature(3)),
458                                ]),
459                            ]),
460                        ]),
461                        Condition::Attribute(0x0012),
462                    ]),
463                },
464                Clause {
465                    verdict: Conformance::Optional,
466                    when: Condition::All(&[
467                        Condition::Attribute(0x0003),
468                        Condition::Any(&[
469                            Condition::Feature(1),
470                            Condition::All(&[
471                                Condition::Not(&Condition::Feature(1)),
472                                Condition::Not(&Condition::Feature(2)),
473                                Condition::Not(&Condition::Feature(3)),
474                            ]),
475                        ]),
476                    ]),
477                },
478                Clause {
479                    verdict: Conformance::Deprecated,
480                    when: Condition::Always,
481                },
482            ],
483        },
484    },
485    Attribute {
486        id: 0x0012,
487        name: "PIRUnoccupiedToOccupiedThreshold",
488        kind: "uint8",
489        access: Access::read_write_with(Privilege::View, Privilege::Manage),
490        qualities: AttributeQualities::NON_VOLATILE,
491        reporting: Reporting::OnChange,
492        conform: Conform {
493            clauses: &[
494                Clause {
495                    verdict: Conformance::Mandatory,
496                    when: Condition::All(&[
497                        Condition::All(&[
498                            Condition::Attribute(0x0003),
499                            Condition::Any(&[
500                                Condition::Feature(1),
501                                Condition::All(&[
502                                    Condition::Not(&Condition::Feature(1)),
503                                    Condition::Not(&Condition::Feature(2)),
504                                    Condition::Not(&Condition::Feature(3)),
505                                ]),
506                            ]),
507                        ]),
508                        Condition::Attribute(0x0011),
509                    ]),
510                },
511                Clause {
512                    verdict: Conformance::Optional,
513                    when: Condition::All(&[
514                        Condition::Attribute(0x0003),
515                        Condition::Any(&[
516                            Condition::Feature(1),
517                            Condition::All(&[
518                                Condition::Not(&Condition::Feature(1)),
519                                Condition::Not(&Condition::Feature(2)),
520                                Condition::Not(&Condition::Feature(3)),
521                            ]),
522                        ]),
523                    ]),
524                },
525                Clause {
526                    verdict: Conformance::Deprecated,
527                    when: Condition::Always,
528                },
529            ],
530        },
531    },
532    Attribute {
533        id: 0x0020,
534        name: "UltrasonicOccupiedToUnoccupiedDelay",
535        kind: "uint16",
536        access: Access::read_write_with(Privilege::View, Privilege::Manage),
537        qualities: AttributeQualities::NON_VOLATILE,
538        reporting: Reporting::OnChange,
539        conform: Conform {
540            clauses: &[
541                Clause {
542                    verdict: Conformance::Optional,
543                    when: Condition::All(&[Condition::Attribute(0x0003), Condition::Feature(2)]),
544                },
545                Clause {
546                    verdict: Conformance::Deprecated,
547                    when: Condition::Always,
548                },
549            ],
550        },
551    },
552    Attribute {
553        id: 0x0021,
554        name: "UltrasonicUnoccupiedToOccupiedDelay",
555        kind: "uint16",
556        access: Access::read_write_with(Privilege::View, Privilege::Manage),
557        qualities: AttributeQualities::NON_VOLATILE,
558        reporting: Reporting::OnChange,
559        conform: Conform {
560            clauses: &[
561                Clause {
562                    verdict: Conformance::Mandatory,
563                    when: Condition::All(&[
564                        Condition::Attribute(0x0003),
565                        Condition::Feature(2),
566                        Condition::Attribute(0x0022),
567                    ]),
568                },
569                Clause {
570                    verdict: Conformance::Optional,
571                    when: Condition::All(&[Condition::Attribute(0x0003), Condition::Feature(2)]),
572                },
573                Clause {
574                    verdict: Conformance::Deprecated,
575                    when: Condition::Always,
576                },
577            ],
578        },
579    },
580    Attribute {
581        id: 0x0022,
582        name: "UltrasonicUnoccupiedToOccupiedThreshold",
583        kind: "uint8",
584        access: Access::read_write_with(Privilege::View, Privilege::Manage),
585        qualities: AttributeQualities::NON_VOLATILE,
586        reporting: Reporting::OnChange,
587        conform: Conform {
588            clauses: &[
589                Clause {
590                    verdict: Conformance::Mandatory,
591                    when: Condition::All(&[
592                        Condition::Attribute(0x0003),
593                        Condition::Feature(2),
594                        Condition::Attribute(0x0021),
595                    ]),
596                },
597                Clause {
598                    verdict: Conformance::Optional,
599                    when: Condition::All(&[Condition::Attribute(0x0003), Condition::Feature(2)]),
600                },
601                Clause {
602                    verdict: Conformance::Deprecated,
603                    when: Condition::Always,
604                },
605            ],
606        },
607    },
608    Attribute {
609        id: 0x0030,
610        name: "PhysicalContactOccupiedToUnoccupiedDelay",
611        kind: "uint16",
612        access: Access::read_write_with(Privilege::View, Privilege::Manage),
613        qualities: AttributeQualities::NON_VOLATILE,
614        reporting: Reporting::OnChange,
615        conform: Conform {
616            clauses: &[
617                Clause {
618                    verdict: Conformance::Optional,
619                    when: Condition::All(&[Condition::Attribute(0x0003), Condition::Feature(3)]),
620                },
621                Clause {
622                    verdict: Conformance::Deprecated,
623                    when: Condition::Always,
624                },
625            ],
626        },
627    },
628    Attribute {
629        id: 0x0031,
630        name: "PhysicalContactUnoccupiedToOccupiedDelay",
631        kind: "uint16",
632        access: Access::read_write_with(Privilege::View, Privilege::Manage),
633        qualities: AttributeQualities::NON_VOLATILE,
634        reporting: Reporting::OnChange,
635        conform: Conform {
636            clauses: &[
637                Clause {
638                    verdict: Conformance::Mandatory,
639                    when: Condition::All(&[
640                        Condition::Attribute(0x0003),
641                        Condition::Feature(3),
642                        Condition::Attribute(0x0032),
643                    ]),
644                },
645                Clause {
646                    verdict: Conformance::Optional,
647                    when: Condition::All(&[Condition::Attribute(0x0003), Condition::Feature(3)]),
648                },
649                Clause {
650                    verdict: Conformance::Deprecated,
651                    when: Condition::Always,
652                },
653            ],
654        },
655    },
656    Attribute {
657        id: 0x0032,
658        name: "PhysicalContactUnoccupiedToOccupiedThreshold",
659        kind: "uint8",
660        access: Access::read_write_with(Privilege::View, Privilege::Manage),
661        qualities: AttributeQualities::NON_VOLATILE,
662        reporting: Reporting::OnChange,
663        conform: Conform {
664            clauses: &[
665                Clause {
666                    verdict: Conformance::Mandatory,
667                    when: Condition::All(&[
668                        Condition::Attribute(0x0003),
669                        Condition::Feature(3),
670                        Condition::Attribute(0x0031),
671                    ]),
672                },
673                Clause {
674                    verdict: Conformance::Optional,
675                    when: Condition::All(&[Condition::Attribute(0x0003), Condition::Feature(3)]),
676                },
677                Clause {
678                    verdict: Conformance::Deprecated,
679                    when: Condition::Always,
680                },
681            ],
682        },
683    },
684];
685
686/// Every command, with its conformance.
687pub const COMMANDS: &[Command] = &[];
688
689/// Every event, with its conformance.
690pub const EVENTS: &[Event] = &[Event {
691    id: 0x00,
692    name: "OccupancyChanged",
693    priority: EventPriority::Info,
694    access: Access::read_only(Privilege::View),
695    conform: Conform {
696        clauses: &[
697            Clause {
698                verdict: Conformance::Mandatory,
699                when: Condition::Feature(9),
700            },
701            Clause {
702                verdict: Conformance::Optional,
703                when: Condition::Always,
704            },
705        ],
706    },
707}];
708
709/// The whole cluster, as the specification defines it.
710pub const CLUSTER: Cluster = Cluster {
711    id: ID,
712    name: "Occupancy Sensing",
713    revision: REVISION,
714    pics: "OCC",
715    derived_from: None,
716    features: FEATURES,
717    attributes: ATTRIBUTES,
718    commands: COMMANDS,
719    events: EVENTS,
720};