Skip to main content

matter_kit/clusters/generated/
window_covering.rs

1// Generated by `cargo xtask` from the CSA data model 1.6. Do not edit.
2//
3// Window Covering — cluster 0x0102.
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//! Window Covering (cluster `0x0102`, revision 8).
10//!
11//! 19 identifiers, 4 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 = 0x0102;
28
29/// The highest revision the specification's history defines — what `ClusterRevision`
30/// must report (Core §7.13.1).
31pub const REVISION: u16 = 8;
32
33/// The PICS code, which a certification declaration names the cluster by.
34pub const PICS: &str = "WNCV";
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    /// Lift control and behavior for lifting/sliding window coverings
42    ///
43    /// Code `LF`, bit 0.
44    pub const LIFT: u32 = 1 << 0;
45    /// Tilt control and behavior for tilting window coverings
46    ///
47    /// Code `TL`, bit 1.
48    pub const TILT: u32 = 1 << 1;
49    /// Position aware lift control is supported.
50    ///
51    /// Code `PA_LF`, bit 2.
52    pub const POSITION_AWARE_LIFT: u32 = 1 << 2;
53    /// Position aware tilt control is supported.
54    ///
55    /// Code `PA_TL`, bit 4.
56    pub const POSITION_AWARE_TILT: u32 = 1 << 4;
57}
58
59/// Every feature bit, with its conformance.
60pub const FEATURES: &[Feature] = &[
61    Feature {
62        bit: 0,
63        code: "LF",
64        name: "Lift",
65        conform: Conform::OPTIONAL,
66    },
67    Feature {
68        bit: 1,
69        code: "TL",
70        name: "Tilt",
71        conform: Conform::OPTIONAL,
72    },
73    Feature {
74        bit: 2,
75        code: "PA_LF",
76        name: "PositionAwareLift",
77        conform: Conform {
78            clauses: &[Clause {
79                verdict: Conformance::Optional,
80                when: Condition::Feature(0),
81            }],
82        },
83    },
84    Feature {
85        bit: 4,
86        code: "PA_TL",
87        name: "PositionAwareTilt",
88        conform: Conform {
89            clauses: &[Clause {
90                verdict: Conformance::Optional,
91                when: Condition::Feature(1),
92            }],
93        },
94    },
95];
96
97/// The attribute ids.
98pub mod attribute {
99    use crate::im::AttributeId;
100
101    /// `Type`.
102    pub const TYPE: AttributeId = 0x00;
103    /// `NumberOfActuationsLift`.
104    pub const NUMBER_OF_ACTUATIONS_LIFT: AttributeId = 0x05;
105    /// `NumberOfActuationsTilt`.
106    pub const NUMBER_OF_ACTUATIONS_TILT: AttributeId = 0x06;
107    /// `ConfigStatus`.
108    pub const CONFIG_STATUS: AttributeId = 0x07;
109    /// `CurrentPositionLiftPercentage`.
110    pub const CURRENT_POSITION_LIFT_PERCENTAGE: AttributeId = 0x08;
111    /// `CurrentPositionTiltPercentage`.
112    pub const CURRENT_POSITION_TILT_PERCENTAGE: AttributeId = 0x09;
113    /// `OperationalStatus`.
114    pub const OPERATIONAL_STATUS: AttributeId = 0x0A;
115    /// `TargetPositionLiftPercent100ths`.
116    pub const TARGET_POSITION_LIFT_PERCENT100_THS: AttributeId = 0x0B;
117    /// `TargetPositionTiltPercent100ths`.
118    pub const TARGET_POSITION_TILT_PERCENT100_THS: AttributeId = 0x0C;
119    /// `EndProductType`.
120    pub const END_PRODUCT_TYPE: AttributeId = 0x0D;
121    /// `CurrentPositionLiftPercent100ths`.
122    pub const CURRENT_POSITION_LIFT_PERCENT100_THS: AttributeId = 0x0E;
123    /// `CurrentPositionTiltPercent100ths`.
124    pub const CURRENT_POSITION_TILT_PERCENT100_THS: AttributeId = 0x0F;
125    /// `Mode`.
126    pub const MODE: AttributeId = 0x17;
127    /// `SafetyStatus`.
128    pub const SAFETY_STATUS: AttributeId = 0x1A;
129}
130
131/// The command ids.
132pub mod command {
133    use crate::im::CommandId;
134
135    /// `UpOrOpen`.
136    pub const UP_OR_OPEN: CommandId = 0x00;
137    /// `DownOrClose`.
138    pub const DOWN_OR_CLOSE: CommandId = 0x01;
139    /// `StopMotion`.
140    pub const STOP_MOTION: CommandId = 0x02;
141    /// `GoToLiftPercentage`.
142    pub const GO_TO_LIFT_PERCENTAGE: CommandId = 0x05;
143    /// `GoToTiltPercentage`.
144    pub const GO_TO_TILT_PERCENTAGE: CommandId = 0x08;
145}
146
147/// `EndProductTypeEnum`.
148#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
149#[repr(u8)]
150pub enum EndProductTypeEnum {
151    /// Simple Roller Shade
152    RollerShade = 0,
153    /// Roman Shade
154    RomanShade = 1,
155    /// Balloon Shade
156    BalloonShade = 2,
157    /// Woven Wood
158    WovenWood = 3,
159    /// Pleated Shade
160    PleatedShade = 4,
161    /// Cellular Shade
162    CellularShade = 5,
163    /// Layered Shade
164    LayeredShade = 6,
165    /// Layered Shade 2D
166    LayeredShade2D = 7,
167    /// Sheer Shade
168    SheerShade = 8,
169    /// Tilt Only Interior Blind
170    TiltOnlyInteriorBlind = 9,
171    /// Interior Blind
172    InteriorBlind = 10,
173    /// Vertical Blind, Strip Curtain
174    VerticalBlindStripCurtain = 11,
175    /// Interior Venetian Blind
176    InteriorVenetianBlind = 12,
177    /// Exterior Venetian Blind
178    ExteriorVenetianBlind = 13,
179    /// Lateral Left Curtain
180    LateralLeftCurtain = 14,
181    /// Lateral Right Curtain
182    LateralRightCurtain = 15,
183    /// Central Curtain
184    CentralCurtain = 16,
185    /// Roller Shutter
186    RollerShutter = 17,
187    /// Exterior Vertical Screen
188    ExteriorVerticalScreen = 18,
189    /// Awning Terrace (Patio)
190    AwningTerracePatio = 19,
191    /// Awning Vertical Screen
192    AwningVerticalScreen = 20,
193    /// Tilt Only Pergola
194    TiltOnlyPergola = 21,
195    /// Swinging Shutter
196    SwingingShutter = 22,
197    /// Sliding Shutter
198    SlidingShutter = 23,
199    /// Unknown
200    Unknown = 255,
201}
202
203impl EndProductTypeEnum {
204    /// Reads a wire value, or `None` for one this revision does not define.
205    #[must_use]
206    pub const fn from_value(value: u8) -> Option<Self> {
207        match value {
208            0 => Some(Self::RollerShade),
209            1 => Some(Self::RomanShade),
210            2 => Some(Self::BalloonShade),
211            3 => Some(Self::WovenWood),
212            4 => Some(Self::PleatedShade),
213            5 => Some(Self::CellularShade),
214            6 => Some(Self::LayeredShade),
215            7 => Some(Self::LayeredShade2D),
216            8 => Some(Self::SheerShade),
217            9 => Some(Self::TiltOnlyInteriorBlind),
218            10 => Some(Self::InteriorBlind),
219            11 => Some(Self::VerticalBlindStripCurtain),
220            12 => Some(Self::InteriorVenetianBlind),
221            13 => Some(Self::ExteriorVenetianBlind),
222            14 => Some(Self::LateralLeftCurtain),
223            15 => Some(Self::LateralRightCurtain),
224            16 => Some(Self::CentralCurtain),
225            17 => Some(Self::RollerShutter),
226            18 => Some(Self::ExteriorVerticalScreen),
227            19 => Some(Self::AwningTerracePatio),
228            20 => Some(Self::AwningVerticalScreen),
229            21 => Some(Self::TiltOnlyPergola),
230            22 => Some(Self::SwingingShutter),
231            23 => Some(Self::SlidingShutter),
232            255 => Some(Self::Unknown),
233            _ => None,
234        }
235    }
236
237    /// Its wire value.
238    #[must_use]
239    pub const fn value(self) -> u8 {
240        self as u8
241    }
242}
243
244impl ToTlv for EndProductTypeEnum {
245    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
246        self.value().to_tlv(w, tag)
247    }
248}
249
250impl<'a> FromTlv<'a> for EndProductTypeEnum {
251    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
252        let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
253        Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
254    }
255}
256
257/// `TypeEnum`.
258#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
259#[repr(u8)]
260pub enum TypeEnum {
261    /// RollerShade
262    RollerShade = 0,
263    /// RollerShade - 2 Motor
264    RollerShade2Motor = 1,
265    /// RollerShade - Exterior
266    RollerShadeExterior = 2,
267    /// RollerShade - Exterior - 2 Motor
268    RollerShadeExterior2Motor = 3,
269    /// Drapery (curtain)
270    Drapery = 4,
271    /// Awning
272    Awning = 5,
273    /// Shutter
274    Shutter = 6,
275    /// Tilt Blind - Tilt Only
276    TiltBlindTiltOnly = 7,
277    /// Tilt Blind - Lift & Tilt
278    TiltBlindLiftAndTilt = 8,
279    /// Projector Screen
280    ProjectorScreen = 9,
281    /// Unknown
282    Unknown = 255,
283}
284
285impl TypeEnum {
286    /// Reads a wire value, or `None` for one this revision does not define.
287    #[must_use]
288    pub const fn from_value(value: u8) -> Option<Self> {
289        match value {
290            0 => Some(Self::RollerShade),
291            1 => Some(Self::RollerShade2Motor),
292            2 => Some(Self::RollerShadeExterior),
293            3 => Some(Self::RollerShadeExterior2Motor),
294            4 => Some(Self::Drapery),
295            5 => Some(Self::Awning),
296            6 => Some(Self::Shutter),
297            7 => Some(Self::TiltBlindTiltOnly),
298            8 => Some(Self::TiltBlindLiftAndTilt),
299            9 => Some(Self::ProjectorScreen),
300            255 => Some(Self::Unknown),
301            _ => None,
302        }
303    }
304
305    /// Its wire value.
306    #[must_use]
307    pub const fn value(self) -> u8 {
308        self as u8
309    }
310}
311
312impl ToTlv for TypeEnum {
313    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
314        self.value().to_tlv(w, tag)
315    }
316}
317
318impl<'a> FromTlv<'a> for TypeEnum {
319    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
320        let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
321        Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
322    }
323}
324
325bitflags::bitflags! {
326    /// `ConfigStatusBitmap`.
327    #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
328    pub struct ConfigStatusBitmap: u8 {
329        /// Device is operational.
330        const OPERATIONAL = 1 << 0;
331        /// `OnlineReserved`, bit 1.
332        const ONLINE_RESERVED = 1 << 1;
333        /// The lift movement is reversed.
334        const LIFT_MOVEMENT_REVERSED = 1 << 2;
335        /// Supports the PositionAwareLift feature (PA_LF).
336        const LIFT_POSITION_AWARE = 1 << 3;
337        /// Supports the PositionAwareTilt feature (PA_TL).
338        const TILT_POSITION_AWARE = 1 << 4;
339        /// Uses an encoder for lift.
340        const LIFT_ENCODER_CONTROLLED = 1 << 5;
341        /// Uses an encoder for tilt.
342        const TILT_ENCODER_CONTROLLED = 1 << 6;
343    }
344}
345
346impl ToTlv for ConfigStatusBitmap {
347    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
348        self.bits().to_tlv(w, tag)
349    }
350}
351
352impl<'a> FromTlv<'a> for ConfigStatusBitmap {
353    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
354        let bits = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
355        Self::from_bits(bits).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
356    }
357}
358
359bitflags::bitflags! {
360    /// `ModeBitmap`.
361    #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
362    pub struct ModeBitmap: u8 {
363        /// Reverse the lift direction.
364        const MOTOR_DIRECTION_REVERSED = 1 << 0;
365        /// Perform a calibration.
366        const CALIBRATION_MODE = 1 << 1;
367        /// Freeze all motions for maintenance.
368        const MAINTENANCE_MODE = 1 << 2;
369        /// Control the LEDs feedback.
370        const LED_FEEDBACK = 1 << 3;
371    }
372}
373
374impl ToTlv for ModeBitmap {
375    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
376        self.bits().to_tlv(w, tag)
377    }
378}
379
380impl<'a> FromTlv<'a> for ModeBitmap {
381    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
382        let bits = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
383        Self::from_bits(bits).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
384    }
385}
386
387bitflags::bitflags! {
388    /// `OperationalStatusBitmap`.
389    #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
390    pub struct OperationalStatusBitmap: u8 {
391    }
392}
393
394impl ToTlv for OperationalStatusBitmap {
395    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
396        self.bits().to_tlv(w, tag)
397    }
398}
399
400impl<'a> FromTlv<'a> for OperationalStatusBitmap {
401    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
402        let bits = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
403        Self::from_bits(bits).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
404    }
405}
406
407bitflags::bitflags! {
408    /// `SafetyStatusBitmap`.
409    #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
410    pub struct SafetyStatusBitmap: u16 {
411        /// Movement commands are ignored (locked out). e.g. not granted authorization, outside some time/date range.
412        const REMOTE_LOCKOUT = 1 << 0;
413        /// Tampering detected on sensors or any other safety equipment. Ex: a device has been forcedly moved without its actuator(s).
414        const TAMPER_DETECTION = 1 << 1;
415        /// Communication failure to sensors or other safety equipment.
416        const FAILED_COMMUNICATION = 1 << 2;
417        /// Device has failed to reach the desired position. e.g. with position aware device, time expired before TargetPosition is reached.
418        const POSITION_FAILURE = 1 << 3;
419        /// Motor(s) and/or electric circuit thermal protection activated.
420        const THERMAL_PROTECTION = 1 << 4;
421        /// An obstacle is preventing actuator movement.
422        const OBSTACLE_DETECTED = 1 << 5;
423        /// Device has power related issue or limitation e.g. device is running w/ the help of a backup battery or power might not be fully available at the moment.
424        const POWER = 1 << 6;
425        /// Local safety sensor (not a direct obstacle) is preventing movements (e.g. Safety EU Standard EN60335).
426        const STOP_INPUT = 1 << 7;
427        /// Mechanical problem related to the motor(s) detected.
428        const MOTOR_JAMMED = 1 << 8;
429        /// PCB, fuse and other electrics problems.
430        const HARDWARE_FAILURE = 1 << 9;
431        /// Actuator is manually operated and is preventing actuator movement (e.g. actuator is disengaged/decoupled).
432        const MANUAL_OPERATION = 1 << 10;
433        /// Protection is activated.
434        const PROTECTION = 1 << 11;
435    }
436}
437
438impl ToTlv for SafetyStatusBitmap {
439    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
440        self.bits().to_tlv(w, tag)
441    }
442}
443
444impl<'a> FromTlv<'a> for SafetyStatusBitmap {
445    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
446        let bits = <u16 as FromTlv<'a>>::from_tlv(reader, element)?;
447        Self::from_bits(bits).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
448    }
449}
450
451/// The fields of `GoToLiftPercentage` (command `0x05`).
452#[derive(Debug, Clone, Copy, PartialEq)]
453pub struct GoToLiftPercentageFields {
454    /// `LiftPercent100thsValue`, field 0.
455    pub lift_percent100_ths_value: u16,
456}
457
458impl ToTlv for GoToLiftPercentageFields {
459    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
460        w.start_structure(tag)?;
461        self.lift_percent100_ths_value.to_tlv(w, Tag::Context(0))?;
462        w.end_container()
463    }
464}
465
466impl<'a> FromTlv<'a> for GoToLiftPercentageFields {
467    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
468        if element.value.container() != Some(ContainerKind::Structure) {
469            return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
470        }
471        let mut lift_percent100_ths_value = None;
472        loop {
473            let Some(field) = reader.next_element()? else {
474                return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
475            };
476            if field.value == Value::EndOfContainer {
477                break;
478            }
479            match field.tag.context() {
480                Some(0) => lift_percent100_ths_value = Some(<u16>::from_tlv(reader, &field)?),
481                // A field this revision does not define. §7.19.2: a receiver
482                // ignores what it does not know rather than refusing the whole
483                // structure, which is what lets a newer peer talk to an older one.
484                _ => reader.skip_value(&field)?,
485            }
486        }
487        Ok(Self {
488            lift_percent100_ths_value: lift_percent100_ths_value
489                .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
490        })
491    }
492}
493
494/// The fields of `GoToTiltPercentage` (command `0x08`).
495#[derive(Debug, Clone, Copy, PartialEq)]
496pub struct GoToTiltPercentageFields {
497    /// `TiltPercent100thsValue`, field 0.
498    pub tilt_percent100_ths_value: u16,
499}
500
501impl ToTlv for GoToTiltPercentageFields {
502    fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
503        w.start_structure(tag)?;
504        self.tilt_percent100_ths_value.to_tlv(w, Tag::Context(0))?;
505        w.end_container()
506    }
507}
508
509impl<'a> FromTlv<'a> for GoToTiltPercentageFields {
510    fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
511        if element.value.container() != Some(ContainerKind::Structure) {
512            return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
513        }
514        let mut tilt_percent100_ths_value = None;
515        loop {
516            let Some(field) = reader.next_element()? else {
517                return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
518            };
519            if field.value == Value::EndOfContainer {
520                break;
521            }
522            match field.tag.context() {
523                Some(0) => tilt_percent100_ths_value = Some(<u16>::from_tlv(reader, &field)?),
524                // A field this revision does not define. §7.19.2: a receiver
525                // ignores what it does not know rather than refusing the whole
526                // structure, which is what lets a newer peer talk to an older one.
527                _ => reader.skip_value(&field)?,
528            }
529        }
530        Ok(Self {
531            tilt_percent100_ths_value: tilt_percent100_ths_value
532                .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
533        })
534    }
535}
536
537/// Every attribute the specification defines, with its conformance.
538pub const ATTRIBUTES: &[Attribute] = &[
539    Attribute {
540        id: 0x0000,
541        name: "Type",
542        kind: "TypeEnum",
543        access: Access::read_only(Privilege::View),
544        qualities: AttributeQualities::FIXED,
545        reporting: Reporting::OnChange,
546        conform: Conform::MANDATORY,
547    },
548    Attribute {
549        id: 0x0005,
550        name: "NumberOfActuationsLift",
551        kind: "uint16",
552        access: Access::read_only(Privilege::View),
553        qualities: AttributeQualities::NON_VOLATILE,
554        reporting: Reporting::OnChange,
555        conform: Conform {
556            clauses: &[Clause {
557                verdict: Conformance::Optional,
558                when: Condition::Feature(0),
559            }],
560        },
561    },
562    Attribute {
563        id: 0x0006,
564        name: "NumberOfActuationsTilt",
565        kind: "uint16",
566        access: Access::read_only(Privilege::View),
567        qualities: AttributeQualities::NON_VOLATILE,
568        reporting: Reporting::OnChange,
569        conform: Conform {
570            clauses: &[Clause {
571                verdict: Conformance::Optional,
572                when: Condition::Feature(1),
573            }],
574        },
575    },
576    Attribute {
577        id: 0x0007,
578        name: "ConfigStatus",
579        kind: "ConfigStatusBitmap",
580        access: Access::read_only(Privilege::View),
581        qualities: AttributeQualities::NON_VOLATILE,
582        reporting: Reporting::OnChange,
583        conform: Conform::MANDATORY,
584    },
585    Attribute {
586        id: 0x0008,
587        name: "CurrentPositionLiftPercentage",
588        kind: "percent",
589        access: Access::read_only(Privilege::View),
590        qualities: AttributeQualities::NULLABLE.union(AttributeQualities::NON_VOLATILE),
591        reporting: Reporting::OnChange,
592        conform: Conform {
593            clauses: &[Clause {
594                verdict: Conformance::Optional,
595                when: Condition::All(&[Condition::Feature(0), Condition::Feature(2)]),
596            }],
597        },
598    },
599    Attribute {
600        id: 0x0009,
601        name: "CurrentPositionTiltPercentage",
602        kind: "percent",
603        access: Access::read_only(Privilege::View),
604        qualities: AttributeQualities::NULLABLE.union(AttributeQualities::NON_VOLATILE),
605        reporting: Reporting::OnChange,
606        conform: Conform {
607            clauses: &[Clause {
608                verdict: Conformance::Optional,
609                when: Condition::All(&[Condition::Feature(1), Condition::Feature(4)]),
610            }],
611        },
612    },
613    Attribute {
614        id: 0x000A,
615        name: "OperationalStatus",
616        kind: "OperationalStatusBitmap",
617        access: Access::read_only(Privilege::View),
618        qualities: AttributeQualities::empty(),
619        reporting: Reporting::OnChange,
620        conform: Conform::MANDATORY,
621    },
622    Attribute {
623        id: 0x000B,
624        name: "TargetPositionLiftPercent100ths",
625        kind: "percent100ths",
626        access: Access::read_only(Privilege::View),
627        qualities: AttributeQualities::NULLABLE,
628        reporting: Reporting::OnChange,
629        conform: Conform {
630            clauses: &[Clause {
631                verdict: Conformance::Mandatory,
632                when: Condition::All(&[Condition::Feature(0), Condition::Feature(2)]),
633            }],
634        },
635    },
636    Attribute {
637        id: 0x000C,
638        name: "TargetPositionTiltPercent100ths",
639        kind: "percent100ths",
640        access: Access::read_only(Privilege::View),
641        qualities: AttributeQualities::NULLABLE,
642        reporting: Reporting::OnChange,
643        conform: Conform {
644            clauses: &[Clause {
645                verdict: Conformance::Mandatory,
646                when: Condition::All(&[Condition::Feature(1), Condition::Feature(4)]),
647            }],
648        },
649    },
650    Attribute {
651        id: 0x000D,
652        name: "EndProductType",
653        kind: "EndProductTypeEnum",
654        access: Access::read_only(Privilege::View),
655        qualities: AttributeQualities::FIXED,
656        reporting: Reporting::OnChange,
657        conform: Conform::MANDATORY,
658    },
659    Attribute {
660        id: 0x000E,
661        name: "CurrentPositionLiftPercent100ths",
662        kind: "percent100ths",
663        access: Access::read_only(Privilege::View),
664        qualities: AttributeQualities::NULLABLE.union(AttributeQualities::NON_VOLATILE),
665        reporting: Reporting::OnChange,
666        conform: Conform {
667            clauses: &[Clause {
668                verdict: Conformance::Mandatory,
669                when: Condition::All(&[Condition::Feature(0), Condition::Feature(2)]),
670            }],
671        },
672    },
673    Attribute {
674        id: 0x000F,
675        name: "CurrentPositionTiltPercent100ths",
676        kind: "percent100ths",
677        access: Access::read_only(Privilege::View),
678        qualities: AttributeQualities::NULLABLE.union(AttributeQualities::NON_VOLATILE),
679        reporting: Reporting::OnChange,
680        conform: Conform {
681            clauses: &[Clause {
682                verdict: Conformance::Mandatory,
683                when: Condition::All(&[Condition::Feature(1), Condition::Feature(4)]),
684            }],
685        },
686    },
687    Attribute {
688        id: 0x0017,
689        name: "Mode",
690        kind: "ModeBitmap",
691        access: Access::read_write_with(Privilege::View, Privilege::Manage),
692        qualities: AttributeQualities::NON_VOLATILE,
693        reporting: Reporting::OnChange,
694        conform: Conform::MANDATORY,
695    },
696    Attribute {
697        id: 0x001A,
698        name: "SafetyStatus",
699        kind: "SafetyStatusBitmap",
700        access: Access::read_only(Privilege::View),
701        qualities: AttributeQualities::empty(),
702        reporting: Reporting::OnChange,
703        conform: Conform::OPTIONAL,
704    },
705];
706
707/// Every command, with its conformance.
708pub const COMMANDS: &[Command] = &[
709    Command {
710        id: 0x00,
711        name: "UpOrOpen",
712        to_server: true,
713        response: None,
714        access: Access::invoke(Privilege::Operate),
715        conform: Conform::MANDATORY,
716    },
717    Command {
718        id: 0x01,
719        name: "DownOrClose",
720        to_server: true,
721        response: None,
722        access: Access::invoke(Privilege::Operate),
723        conform: Conform::MANDATORY,
724    },
725    Command {
726        id: 0x02,
727        name: "StopMotion",
728        to_server: true,
729        response: None,
730        access: Access::invoke(Privilege::Operate),
731        conform: Conform::MANDATORY,
732    },
733    Command {
734        id: 0x05,
735        name: "GoToLiftPercentage",
736        to_server: true,
737        response: None,
738        access: Access::invoke(Privilege::Operate),
739        conform: Conform {
740            clauses: &[
741                Clause {
742                    verdict: Conformance::Mandatory,
743                    when: Condition::All(&[Condition::Feature(0), Condition::Feature(2)]),
744                },
745                Clause {
746                    verdict: Conformance::Optional,
747                    when: Condition::Feature(0),
748                },
749            ],
750        },
751    },
752    Command {
753        id: 0x08,
754        name: "GoToTiltPercentage",
755        to_server: true,
756        response: None,
757        access: Access::invoke(Privilege::Operate),
758        conform: Conform {
759            clauses: &[
760                Clause {
761                    verdict: Conformance::Mandatory,
762                    when: Condition::All(&[Condition::Feature(1), Condition::Feature(4)]),
763                },
764                Clause {
765                    verdict: Conformance::Optional,
766                    when: Condition::Feature(1),
767                },
768            ],
769        },
770    },
771];
772
773/// Every event, with its conformance.
774pub const EVENTS: &[Event] = &[];
775
776/// The whole cluster, as the specification defines it.
777pub const CLUSTER: Cluster = Cluster {
778    id: ID,
779    name: "Window Covering",
780    revision: REVISION,
781    pics: "WNCV",
782    derived_from: None,
783    features: FEATURES,
784    attributes: ATTRIBUTES,
785    commands: COMMANDS,
786    events: EVENTS,
787};