matter-kit 0.3.0

Matter (CSA smart-home standard) protocol implementation in Rust: no_std, no-alloc, executor-agnostic
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
// Generated by `cargo xtask` from the CSA data model 1.6. Do not edit.
//
// Temperature Alarm — cluster 0x0064.
//
// Regenerate with `cargo xtask clusters --dm <checkout>/data_model/1.6`; `cargo xtask check`
// is the CI gate that keeps this file honest. The XML itself is not vendored here — it
// carries the CSA's own copyright notice and is not redistributable.

//! Temperature Alarm (cluster `0x0064`, revision 1).
//!
//! 14 identifiers, 10 feature bits, and the specification's own conformance for
//! every element. `CLUSTER` is the whole table.

#![allow(unused_imports)]

use crate::dm::conformance::{Clause, Condition, Conform, Conformance};
use crate::dm::meta::{EventPriority, Reporting};
use crate::dm::spec::{Attribute, Cluster, Command, Event, Feature};
use crate::dm::{Access, AccessQualities, AttributeQualities, Privilege};
use crate::error::Result;
use crate::im::{AttributeId, ClusterId, CommandId, EventId};
use crate::tlv::{
    ContainerKind, Element, FromTlv, Nullable, Tag, TlvList, TlvReader, TlvWriter, ToTlv, Value,
};

/// The cluster id.
pub const ID: ClusterId = 0x0064;

/// The highest revision the specification's history defines — what `ClusterRevision`
/// must report (Core §7.13.1).
pub const REVISION: u16 = 1;

/// The PICS code, which a certification declaration names the cluster by.
pub const PICS: &str = "TEMPALM";

/// The `FeatureMap` bits (Core §7.13.2).
///
/// A feature has conformance of its own: a device may not claim one the
/// specification forbids it alongside another.
pub mod feature {
    /// Supports activating alarms when a temperature measurement goes over a threshold
    ///
    /// Code `OVER`, bit 20.
    pub const OVER_TEMPERATURE: u32 = 1 << 20;
    /// Supports activating alarms when a temperature measurement goes under a threshold
    ///
    /// Code `UNDER`, bit 21.
    pub const UNDER_TEMPERATURE: u32 = 1 << 21;
    /// Supports the major threshold for alarms
    ///
    /// Code `MAJOR`, bit 22.
    pub const MAJOR_THRESHOLD: u32 = 1 << 22;
    /// Supports the minor threshold for alarms
    ///
    /// Code `MINOR`, bit 23.
    pub const MINOR_THRESHOLD: u32 = 1 << 23;
    /// Supports the ability to adjust the over critical temperature threshold
    ///
    /// Code `OCRIADJ`, bit 24.
    pub const OVER_CRITICAL_ADJUSTABLE: u32 = 1 << 24;
    /// Supports the ability to adjust the over major temperature threshold
    ///
    /// Code `OMAJADJ`, bit 25.
    pub const OVER_MAJOR_ADJUSTABLE: u32 = 1 << 25;
    /// Supports the ability to adjust the over minor temperature threshold
    ///
    /// Code `OMINADJ`, bit 26.
    pub const OVER_MINOR_ADJUSTABLE: u32 = 1 << 26;
    /// Supports the ability to adjust the under minor temperature threshold
    ///
    /// Code `UMINADJ`, bit 27.
    pub const UNDER_MINOR_ADJUSTABLE: u32 = 1 << 27;
    /// Supports the ability to adjust the under major temperature threshold
    ///
    /// Code `UMAJADJ`, bit 28.
    pub const UNDER_MAJOR_ADJUSTABLE: u32 = 1 << 28;
    /// Supports the ability to adjust the under critical temperature threshold
    ///
    /// Code `UCRIADJ`, bit 29.
    pub const UNDER_CRITICAL_ADJUSTABLE: u32 = 1 << 29;
}

/// Every feature bit, with its conformance.
pub const FEATURES: &[Feature] = &[
    Feature {
        bit: 20,
        code: "OVER",
        name: "OverTemperature",
        conform: Conform::OPTIONAL,
    },
    Feature {
        bit: 21,
        code: "UNDER",
        name: "UnderTemperature",
        conform: Conform::OPTIONAL,
    },
    Feature {
        bit: 22,
        code: "MAJOR",
        name: "MajorThreshold",
        conform: Conform::OPTIONAL,
    },
    Feature {
        bit: 23,
        code: "MINOR",
        name: "MinorThreshold",
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Optional,
                when: Condition::Feature(22),
            }],
        },
    },
    Feature {
        bit: 24,
        code: "OCRIADJ",
        name: "OverCriticalAdjustable",
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Optional,
                when: Condition::Feature(20),
            }],
        },
    },
    Feature {
        bit: 25,
        code: "OMAJADJ",
        name: "OverMajorAdjustable",
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Optional,
                when: Condition::All(&[Condition::Feature(20), Condition::Feature(22)]),
            }],
        },
    },
    Feature {
        bit: 26,
        code: "OMINADJ",
        name: "OverMinorAdjustable",
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Optional,
                when: Condition::All(&[Condition::Feature(20), Condition::Feature(23)]),
            }],
        },
    },
    Feature {
        bit: 27,
        code: "UMINADJ",
        name: "UnderMinorAdjustable",
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Optional,
                when: Condition::All(&[Condition::Feature(21), Condition::Feature(23)]),
            }],
        },
    },
    Feature {
        bit: 28,
        code: "UMAJADJ",
        name: "UnderMajorAdjustable",
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Optional,
                when: Condition::All(&[Condition::Feature(21), Condition::Feature(22)]),
            }],
        },
    },
    Feature {
        bit: 29,
        code: "UCRIADJ",
        name: "UnderCriticalAdjustable",
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Optional,
                when: Condition::Feature(21),
            }],
        },
    },
];

/// The attribute ids.
pub mod attribute {
    use crate::im::AttributeId;

    /// `Mask`.
    pub const MASK: AttributeId = 0x00;
    /// `Latch`.
    pub const LATCH: AttributeId = 0x01;
    /// `State`.
    pub const STATE: AttributeId = 0x02;
    /// `Supported`.
    pub const SUPPORTED: AttributeId = 0x03;
    /// `CriticalOverTemperatureThreshold`.
    pub const CRITICAL_OVER_TEMPERATURE_THRESHOLD: AttributeId = 0x80;
    /// `MajorOverTemperatureThreshold`.
    pub const MAJOR_OVER_TEMPERATURE_THRESHOLD: AttributeId = 0x81;
    /// `MinorOverTemperatureThreshold`.
    pub const MINOR_OVER_TEMPERATURE_THRESHOLD: AttributeId = 0x82;
    /// `MinorUnderTemperatureThreshold`.
    pub const MINOR_UNDER_TEMPERATURE_THRESHOLD: AttributeId = 0x83;
    /// `MajorUnderTemperatureThreshold`.
    pub const MAJOR_UNDER_TEMPERATURE_THRESHOLD: AttributeId = 0x84;
    /// `CriticalUnderTemperatureThreshold`.
    pub const CRITICAL_UNDER_TEMPERATURE_THRESHOLD: AttributeId = 0x85;
}

/// The command ids.
pub mod command {
    use crate::im::CommandId;

    /// `Reset`.
    pub const RESET: CommandId = 0x00;
    /// `ModifyEnabledAlarms`.
    pub const MODIFY_ENABLED_ALARMS: CommandId = 0x01;
    /// `SetTemperatureAlarmThresholds`.
    pub const SET_TEMPERATURE_ALARM_THRESHOLDS: CommandId = 0x80;
}

/// The event ids.
pub mod event {
    use crate::im::EventId;

    /// `Notify`.
    pub const NOTIFY: EventId = 0x00;
}

bitflags::bitflags! {
    /// `AlarmBitmap`.
    #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
    pub struct AlarmBitmap: u8 {
        /// The measured temperature is above the critical threshold.
        const CRITICAL_OVER_TEMPERATURE_ALARM = 1 << 0;
        /// The measured temperature is above the major threshold.
        const MAJOR_OVER_TEMPERATURE_ALARM = 1 << 1;
        /// The measured temperature is above the minor threshold.
        const MINOR_OVER_TEMPERATURE_ALARM = 1 << 2;
        /// The measured temperature is below the minor threshold.
        const MINOR_UNDER_TEMPERATURE_ALARM = 1 << 3;
        /// The measured temperature is below the major threshold.
        const MAJOR_UNDER_TEMPERATURE_ALARM = 1 << 4;
        /// The measured temperature is below the critical threshold.
        const CRITICAL_UNDER_TEMPERATURE_ALARM = 1 << 5;
    }
}

impl ToTlv for AlarmBitmap {
    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
        self.bits().to_tlv(w, tag)
    }
}

impl<'a> FromTlv<'a> for AlarmBitmap {
    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
        let bits = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
        Self::from_bits(bits).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
    }
}

/// The fields of `Reset` (command `0x00`).
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ResetFields {
    /// `Alarms`, field 0.
    pub alarms: AlarmBitmap,
}

impl ToTlv for ResetFields {
    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
        w.start_structure(tag)?;
        self.alarms.to_tlv(w, Tag::Context(0))?;
        w.end_container()
    }
}

impl<'a> FromTlv<'a> for ResetFields {
    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
        if element.value.container() != Some(ContainerKind::Structure) {
            return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
        }
        let mut alarms = None;
        loop {
            let Some(field) = reader.next_element()? else {
                return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
            };
            if field.value == Value::EndOfContainer {
                break;
            }
            match field.tag.context() {
                Some(0) => alarms = Some(<AlarmBitmap>::from_tlv(reader, &field)?),
                // A field this revision does not define. §7.19.2: a receiver
                // ignores what it does not know rather than refusing the whole
                // structure, which is what lets a newer peer talk to an older one.
                _ => reader.skip_value(&field)?,
            }
        }
        Ok(Self {
            alarms: alarms.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
        })
    }
}

/// The fields of `ModifyEnabledAlarms` (command `0x01`).
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ModifyEnabledAlarmsFields {
    /// `Mask`, field 0.
    pub mask: AlarmBitmap,
}

impl ToTlv for ModifyEnabledAlarmsFields {
    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
        w.start_structure(tag)?;
        self.mask.to_tlv(w, Tag::Context(0))?;
        w.end_container()
    }
}

impl<'a> FromTlv<'a> for ModifyEnabledAlarmsFields {
    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
        if element.value.container() != Some(ContainerKind::Structure) {
            return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
        }
        let mut mask = None;
        loop {
            let Some(field) = reader.next_element()? else {
                return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
            };
            if field.value == Value::EndOfContainer {
                break;
            }
            match field.tag.context() {
                Some(0) => mask = Some(<AlarmBitmap>::from_tlv(reader, &field)?),
                // A field this revision does not define. §7.19.2: a receiver
                // ignores what it does not know rather than refusing the whole
                // structure, which is what lets a newer peer talk to an older one.
                _ => reader.skip_value(&field)?,
            }
        }
        Ok(Self {
            mask: mask.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
        })
    }
}

/// The fields of `SetTemperatureAlarmThresholds` (command `0x80`).
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct SetTemperatureAlarmThresholdsFields {
    /// `CriticalOverTemperatureThreshold`, field 0.
    pub critical_over_temperature_threshold: Option<i16>,
    /// `MajorOverTemperatureThreshold`, field 1.
    pub major_over_temperature_threshold: Option<i16>,
    /// `MinorOverTemperatureThreshold`, field 2.
    pub minor_over_temperature_threshold: Option<i16>,
    /// `MinorUnderTemperatureThreshold`, field 3.
    pub minor_under_temperature_threshold: Option<i16>,
    /// `MajorUnderTemperatureThreshold`, field 4.
    pub major_under_temperature_threshold: Option<i16>,
    /// `CriticalUnderTemperatureThreshold`, field 5.
    pub critical_under_temperature_threshold: Option<i16>,
}

impl ToTlv for SetTemperatureAlarmThresholdsFields {
    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
        w.start_structure(tag)?;
        if let Some(value) = &self.critical_over_temperature_threshold {
            value.to_tlv(w, Tag::Context(0))?;
        }
        if let Some(value) = &self.major_over_temperature_threshold {
            value.to_tlv(w, Tag::Context(1))?;
        }
        if let Some(value) = &self.minor_over_temperature_threshold {
            value.to_tlv(w, Tag::Context(2))?;
        }
        if let Some(value) = &self.minor_under_temperature_threshold {
            value.to_tlv(w, Tag::Context(3))?;
        }
        if let Some(value) = &self.major_under_temperature_threshold {
            value.to_tlv(w, Tag::Context(4))?;
        }
        if let Some(value) = &self.critical_under_temperature_threshold {
            value.to_tlv(w, Tag::Context(5))?;
        }
        w.end_container()
    }
}

impl<'a> FromTlv<'a> for SetTemperatureAlarmThresholdsFields {
    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
        if element.value.container() != Some(ContainerKind::Structure) {
            return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
        }
        let mut critical_over_temperature_threshold = None;
        let mut major_over_temperature_threshold = None;
        let mut minor_over_temperature_threshold = None;
        let mut minor_under_temperature_threshold = None;
        let mut major_under_temperature_threshold = None;
        let mut critical_under_temperature_threshold = None;
        loop {
            let Some(field) = reader.next_element()? else {
                return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
            };
            if field.value == Value::EndOfContainer {
                break;
            }
            match field.tag.context() {
                Some(0) => {
                    critical_over_temperature_threshold = Some(<i16>::from_tlv(reader, &field)?)
                }
                Some(1) => {
                    major_over_temperature_threshold = Some(<i16>::from_tlv(reader, &field)?)
                }
                Some(2) => {
                    minor_over_temperature_threshold = Some(<i16>::from_tlv(reader, &field)?)
                }
                Some(3) => {
                    minor_under_temperature_threshold = Some(<i16>::from_tlv(reader, &field)?)
                }
                Some(4) => {
                    major_under_temperature_threshold = Some(<i16>::from_tlv(reader, &field)?)
                }
                Some(5) => {
                    critical_under_temperature_threshold = Some(<i16>::from_tlv(reader, &field)?)
                }
                // A field this revision does not define. §7.19.2: a receiver
                // ignores what it does not know rather than refusing the whole
                // structure, which is what lets a newer peer talk to an older one.
                _ => reader.skip_value(&field)?,
            }
        }
        Ok(Self {
            critical_over_temperature_threshold,
            major_over_temperature_threshold,
            minor_over_temperature_threshold,
            minor_under_temperature_threshold,
            major_under_temperature_threshold,
            critical_under_temperature_threshold,
        })
    }
}

/// Every attribute the specification defines, with its conformance.
pub const ATTRIBUTES: &[Attribute] = &[
    Attribute {
        id: 0x0000,
        name: "Mask",
        kind: "AlarmBitmap",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::empty(),
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0001,
        name: "Latch",
        kind: "AlarmBitmap",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Mandatory,
                when: Condition::Named("RESET"),
            }],
        },
    },
    Attribute {
        id: 0x0002,
        name: "State",
        kind: "AlarmBitmap",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::empty(),
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0003,
        name: "Supported",
        kind: "AlarmBitmap",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0080,
        name: "CriticalOverTemperatureThreshold",
        kind: "temperature",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::empty(),
        reporting: Reporting::OnChange,
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Mandatory,
                when: Condition::Feature(20),
            }],
        },
    },
    Attribute {
        id: 0x0081,
        name: "MajorOverTemperatureThreshold",
        kind: "temperature",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::empty(),
        reporting: Reporting::OnChange,
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Mandatory,
                when: Condition::All(&[Condition::Feature(20), Condition::Feature(22)]),
            }],
        },
    },
    Attribute {
        id: 0x0082,
        name: "MinorOverTemperatureThreshold",
        kind: "temperature",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::empty(),
        reporting: Reporting::OnChange,
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Mandatory,
                when: Condition::All(&[Condition::Feature(20), Condition::Feature(23)]),
            }],
        },
    },
    Attribute {
        id: 0x0083,
        name: "MinorUnderTemperatureThreshold",
        kind: "temperature",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::empty(),
        reporting: Reporting::OnChange,
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Mandatory,
                when: Condition::All(&[Condition::Feature(21), Condition::Feature(23)]),
            }],
        },
    },
    Attribute {
        id: 0x0084,
        name: "MajorUnderTemperatureThreshold",
        kind: "temperature",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::empty(),
        reporting: Reporting::OnChange,
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Mandatory,
                when: Condition::All(&[Condition::Feature(21), Condition::Feature(22)]),
            }],
        },
    },
    Attribute {
        id: 0x0085,
        name: "CriticalUnderTemperatureThreshold",
        kind: "temperature",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::empty(),
        reporting: Reporting::OnChange,
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Mandatory,
                when: Condition::Feature(21),
            }],
        },
    },
];

/// Every command, with its conformance.
pub const COMMANDS: &[Command] = &[
    Command {
        id: 0x00,
        name: "Reset",
        to_server: true,
        response: None,
        access: Access::invoke(Privilege::Operate),
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Mandatory,
                when: Condition::Named("RESET"),
            }],
        },
    },
    Command {
        id: 0x01,
        name: "ModifyEnabledAlarms",
        to_server: true,
        response: None,
        access: Access::invoke(Privilege::Operate),
        conform: Conform::OPTIONAL,
    },
    Command {
        id: 0x80,
        name: "SetTemperatureAlarmThresholds",
        to_server: true,
        response: None,
        access: Access::invoke(Privilege::Operate),
        conform: Conform {
            clauses: &[Clause {
                verdict: Conformance::Mandatory,
                when: Condition::Any(&[
                    Condition::Feature(24),
                    Condition::Feature(25),
                    Condition::Feature(26),
                    Condition::Feature(27),
                    Condition::Feature(28),
                    Condition::Feature(29),
                ]),
            }],
        },
    },
];

/// Every event, with its conformance.
pub const EVENTS: &[Event] = &[Event {
    id: 0x00,
    name: "Notify",
    priority: EventPriority::Info,
    access: Access::read_only(Privilege::View),
    conform: Conform::MANDATORY,
}];

/// The whole cluster, as the specification defines it.
pub const CLUSTER: Cluster = Cluster {
    id: ID,
    name: "Temperature Alarm",
    revision: REVISION,
    pics: "TEMPALM",
    derived_from: Some("Alarm Base"),
    features: FEATURES,
    attributes: ATTRIBUTES,
    commands: COMMANDS,
    events: EVENTS,
};