#![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,
};
pub const ID: ClusterId = 0x0105;
pub const REVISION: u16 = 1;
pub const PICS: &str = "CLDIM";
pub mod feature {
pub const POSITIONING: u32 = 1 << 0;
pub const MOTION_LATCHING: u32 = 1 << 1;
pub const UNIT: u32 = 1 << 2;
pub const LIMITATION: u32 = 1 << 3;
pub const SPEED: u32 = 1 << 4;
pub const TRANSLATION: u32 = 1 << 5;
pub const ROTATION: u32 = 1 << 6;
pub const MODULATION: u32 = 1 << 7;
}
pub const FEATURES: &[Feature] = &[
Feature {
bit: 0,
code: "PS",
name: "Positioning",
conform: Conform::OPTIONAL,
},
Feature {
bit: 1,
code: "LT",
name: "MotionLatching",
conform: Conform::OPTIONAL,
},
Feature {
bit: 2,
code: "UT",
name: "Unit",
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Optional,
when: Condition::Feature(0),
}],
},
},
Feature {
bit: 3,
code: "LM",
name: "Limitation",
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Optional,
when: Condition::Feature(0),
}],
},
},
Feature {
bit: 4,
code: "SP",
name: "Speed",
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Optional,
when: Condition::Feature(0),
}],
},
},
Feature {
bit: 5,
code: "TR",
name: "Translation",
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Optional,
when: Condition::Feature(0),
}],
},
},
Feature {
bit: 6,
code: "RO",
name: "Rotation",
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Optional,
when: Condition::Feature(0),
}],
},
},
Feature {
bit: 7,
code: "MD",
name: "Modulation",
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Optional,
when: Condition::Feature(0),
}],
},
},
];
pub mod attribute {
use crate::im::AttributeId;
pub const CURRENT_STATE: AttributeId = 0x00;
pub const TARGET_STATE: AttributeId = 0x01;
pub const RESOLUTION: AttributeId = 0x02;
pub const STEP_VALUE: AttributeId = 0x03;
pub const UNIT: AttributeId = 0x04;
pub const UNIT_RANGE: AttributeId = 0x05;
pub const LIMIT_RANGE: AttributeId = 0x06;
pub const TRANSLATION_DIRECTION: AttributeId = 0x07;
pub const ROTATION_AXIS: AttributeId = 0x08;
pub const OVERFLOW: AttributeId = 0x09;
pub const MODULATION_TYPE: AttributeId = 0x0A;
pub const LATCH_CONTROL_MODES: AttributeId = 0x0B;
}
pub mod command {
use crate::im::CommandId;
pub const SET_TARGET: CommandId = 0x00;
pub const STEP: CommandId = 0x01;
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum ClosureUnitEnum {
Millimeter = 0,
Degree = 1,
}
impl ClosureUnitEnum {
#[must_use]
pub const fn from_value(value: u8) -> Option<Self> {
match value {
0 => Some(Self::Millimeter),
1 => Some(Self::Degree),
_ => None,
}
}
#[must_use]
pub const fn value(self) -> u8 {
self as u8
}
}
impl ToTlv for ClosureUnitEnum {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
self.value().to_tlv(w, tag)
}
}
impl<'a> FromTlv<'a> for ClosureUnitEnum {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum ModulationTypeEnum {
SlatsOrientation = 0,
SlatsOpenwork = 1,
StripesAlignment = 2,
Opacity = 3,
Ventilation = 4,
}
impl ModulationTypeEnum {
#[must_use]
pub const fn from_value(value: u8) -> Option<Self> {
match value {
0 => Some(Self::SlatsOrientation),
1 => Some(Self::SlatsOpenwork),
2 => Some(Self::StripesAlignment),
3 => Some(Self::Opacity),
4 => Some(Self::Ventilation),
_ => None,
}
}
#[must_use]
pub const fn value(self) -> u8 {
self as u8
}
}
impl ToTlv for ModulationTypeEnum {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
self.value().to_tlv(w, tag)
}
}
impl<'a> FromTlv<'a> for ModulationTypeEnum {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum OverflowEnum {
NoOverflow = 0,
Inside = 1,
Outside = 2,
TopInside = 3,
TopOutside = 4,
BottomInside = 5,
BottomOutside = 6,
LeftInside = 7,
LeftOutside = 8,
RightInside = 9,
RightOutside = 10,
}
impl OverflowEnum {
#[must_use]
pub const fn from_value(value: u8) -> Option<Self> {
match value {
0 => Some(Self::NoOverflow),
1 => Some(Self::Inside),
2 => Some(Self::Outside),
3 => Some(Self::TopInside),
4 => Some(Self::TopOutside),
5 => Some(Self::BottomInside),
6 => Some(Self::BottomOutside),
7 => Some(Self::LeftInside),
8 => Some(Self::LeftOutside),
9 => Some(Self::RightInside),
10 => Some(Self::RightOutside),
_ => None,
}
}
#[must_use]
pub const fn value(self) -> u8 {
self as u8
}
}
impl ToTlv for OverflowEnum {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
self.value().to_tlv(w, tag)
}
}
impl<'a> FromTlv<'a> for OverflowEnum {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum RotationAxisEnum {
Left = 0,
CenteredVertical = 1,
LeftAndRight = 2,
Right = 3,
Top = 4,
CenteredHorizontal = 5,
TopAndBottom = 6,
Bottom = 7,
LeftBarrier = 8,
LeftAndRightBarriers = 9,
RightBarrier = 10,
}
impl RotationAxisEnum {
#[must_use]
pub const fn from_value(value: u8) -> Option<Self> {
match value {
0 => Some(Self::Left),
1 => Some(Self::CenteredVertical),
2 => Some(Self::LeftAndRight),
3 => Some(Self::Right),
4 => Some(Self::Top),
5 => Some(Self::CenteredHorizontal),
6 => Some(Self::TopAndBottom),
7 => Some(Self::Bottom),
8 => Some(Self::LeftBarrier),
9 => Some(Self::LeftAndRightBarriers),
10 => Some(Self::RightBarrier),
_ => None,
}
}
#[must_use]
pub const fn value(self) -> u8 {
self as u8
}
}
impl ToTlv for RotationAxisEnum {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
self.value().to_tlv(w, tag)
}
}
impl<'a> FromTlv<'a> for RotationAxisEnum {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum StepDirectionEnum {
Decrease = 0,
Increase = 1,
}
impl StepDirectionEnum {
#[must_use]
pub const fn from_value(value: u8) -> Option<Self> {
match value {
0 => Some(Self::Decrease),
1 => Some(Self::Increase),
_ => None,
}
}
#[must_use]
pub const fn value(self) -> u8 {
self as u8
}
}
impl ToTlv for StepDirectionEnum {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
self.value().to_tlv(w, tag)
}
}
impl<'a> FromTlv<'a> for StepDirectionEnum {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum TranslationDirectionEnum {
Downward = 0,
Upward = 1,
VerticalMask = 2,
VerticalSymmetry = 3,
Leftward = 4,
Rightward = 5,
HorizontalMask = 6,
HorizontalSymmetry = 7,
Forward = 8,
Backward = 9,
DepthMask = 10,
DepthSymmetry = 11,
}
impl TranslationDirectionEnum {
#[must_use]
pub const fn from_value(value: u8) -> Option<Self> {
match value {
0 => Some(Self::Downward),
1 => Some(Self::Upward),
2 => Some(Self::VerticalMask),
3 => Some(Self::VerticalSymmetry),
4 => Some(Self::Leftward),
5 => Some(Self::Rightward),
6 => Some(Self::HorizontalMask),
7 => Some(Self::HorizontalSymmetry),
8 => Some(Self::Forward),
9 => Some(Self::Backward),
10 => Some(Self::DepthMask),
11 => Some(Self::DepthSymmetry),
_ => None,
}
}
#[must_use]
pub const fn value(self) -> u8 {
self as u8
}
}
impl ToTlv for TranslationDirectionEnum {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
self.value().to_tlv(w, tag)
}
}
impl<'a> FromTlv<'a> for TranslationDirectionEnum {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
}
}
bitflags::bitflags! {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
pub struct LatchControlModesBitmap: u8 {
const REMOTE_LATCHING = 1 << 0;
const REMOTE_UNLATCHING = 1 << 1;
}
}
impl ToTlv for LatchControlModesBitmap {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
self.bits().to_tlv(w, tag)
}
}
impl<'a> FromTlv<'a> for LatchControlModesBitmap {
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))
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct DimensionStateStruct {
pub position: Option<Nullable<u16>>,
pub latch: Option<Nullable<bool>>,
pub speed: Option<crate::clusters::generated::globals::ThreeLevelAutoEnum>,
}
impl ToTlv for DimensionStateStruct {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
if let Some(value) = &self.position {
value.to_tlv(w, Tag::Context(0))?;
}
if let Some(value) = &self.latch {
value.to_tlv(w, Tag::Context(1))?;
}
if let Some(value) = &self.speed {
value.to_tlv(w, Tag::Context(2))?;
}
w.end_container()
}
}
impl<'a> FromTlv<'a> for DimensionStateStruct {
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 position = None;
let mut latch = None;
let mut speed = 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) => position = Some(<Nullable<u16>>::from_tlv(reader, &field)?),
Some(1) => latch = Some(<Nullable<bool>>::from_tlv(reader, &field)?),
Some(2) => {
speed = Some(
<crate::clusters::generated::globals::ThreeLevelAutoEnum>::from_tlv(
reader, &field,
)?,
)
}
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
position,
latch,
speed,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct RangePercent100ThsStruct {
pub min: u16,
pub max: u16,
}
impl ToTlv for RangePercent100ThsStruct {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.min.to_tlv(w, Tag::Context(0))?;
self.max.to_tlv(w, Tag::Context(1))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for RangePercent100ThsStruct {
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 min = None;
let mut max = 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) => min = Some(<u16>::from_tlv(reader, &field)?),
Some(1) => max = Some(<u16>::from_tlv(reader, &field)?),
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
min: min.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
max: max.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct UnitRangeStruct {
pub min: i16,
pub max: i16,
}
impl ToTlv for UnitRangeStruct {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.min.to_tlv(w, Tag::Context(0))?;
self.max.to_tlv(w, Tag::Context(1))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for UnitRangeStruct {
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 min = None;
let mut max = 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) => min = Some(<i16>::from_tlv(reader, &field)?),
Some(1) => max = Some(<i16>::from_tlv(reader, &field)?),
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
min: min.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
max: max.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct SetTargetFields {
pub position: Option<u16>,
pub latch: Option<bool>,
pub speed: Option<crate::clusters::generated::globals::ThreeLevelAutoEnum>,
}
impl ToTlv for SetTargetFields {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
if let Some(value) = &self.position {
value.to_tlv(w, Tag::Context(0))?;
}
if let Some(value) = &self.latch {
value.to_tlv(w, Tag::Context(1))?;
}
if let Some(value) = &self.speed {
value.to_tlv(w, Tag::Context(2))?;
}
w.end_container()
}
}
impl<'a> FromTlv<'a> for SetTargetFields {
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 position = None;
let mut latch = None;
let mut speed = 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) => position = Some(<u16>::from_tlv(reader, &field)?),
Some(1) => latch = Some(<bool>::from_tlv(reader, &field)?),
Some(2) => {
speed = Some(
<crate::clusters::generated::globals::ThreeLevelAutoEnum>::from_tlv(
reader, &field,
)?,
)
}
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
position,
latch,
speed,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct StepFields {
pub direction: StepDirectionEnum,
pub number_of_steps: u16,
pub speed: Option<crate::clusters::generated::globals::ThreeLevelAutoEnum>,
}
impl ToTlv for StepFields {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.direction.to_tlv(w, Tag::Context(0))?;
self.number_of_steps.to_tlv(w, Tag::Context(1))?;
if let Some(value) = &self.speed {
value.to_tlv(w, Tag::Context(2))?;
}
w.end_container()
}
}
impl<'a> FromTlv<'a> for StepFields {
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 direction = None;
let mut number_of_steps = None;
let mut speed = 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) => direction = Some(<StepDirectionEnum>::from_tlv(reader, &field)?),
Some(1) => number_of_steps = Some(<u16>::from_tlv(reader, &field)?),
Some(2) => {
speed = Some(
<crate::clusters::generated::globals::ThreeLevelAutoEnum>::from_tlv(
reader, &field,
)?,
)
}
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
direction: direction.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
number_of_steps: number_of_steps
.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
speed,
})
}
}
pub const ATTRIBUTES: &[Attribute] = &[
Attribute {
id: 0x0000,
name: "CurrentState",
kind: "DimensionStateStruct",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::NULLABLE,
reporting: Reporting::Quieter,
conform: Conform::MANDATORY,
},
Attribute {
id: 0x0001,
name: "TargetState",
kind: "DimensionStateStruct",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::NULLABLE,
reporting: Reporting::OnChange,
conform: Conform::MANDATORY,
},
Attribute {
id: 0x0002,
name: "Resolution",
kind: "percent100ths",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::FIXED,
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(0),
}],
},
},
Attribute {
id: 0x0003,
name: "StepValue",
kind: "percent100ths",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::FIXED,
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(0),
}],
},
},
Attribute {
id: 0x0004,
name: "Unit",
kind: "ClosureUnitEnum",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::FIXED,
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(2),
}],
},
},
Attribute {
id: 0x0005,
name: "UnitRange",
kind: "UnitRangeStruct",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::NULLABLE,
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(2),
}],
},
},
Attribute {
id: 0x0006,
name: "LimitRange",
kind: "RangePercent100thsStruct",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::empty(),
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(3),
}],
},
},
Attribute {
id: 0x0007,
name: "TranslationDirection",
kind: "TranslationDirectionEnum",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::FIXED,
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(5),
}],
},
},
Attribute {
id: 0x0008,
name: "RotationAxis",
kind: "RotationAxisEnum",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::FIXED,
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(6),
}],
},
},
Attribute {
id: 0x0009,
name: "Overflow",
kind: "OverflowEnum",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::FIXED,
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(6),
}],
},
},
Attribute {
id: 0x000A,
name: "ModulationType",
kind: "ModulationTypeEnum",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::FIXED,
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(7),
}],
},
},
Attribute {
id: 0x000B,
name: "LatchControlModes",
kind: "LatchControlModesBitmap",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::FIXED,
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(1),
}],
},
},
];
pub const COMMANDS: &[Command] = &[
Command {
id: 0x00,
name: "SetTarget",
to_server: true,
response: None,
access: Access::invoke(Privilege::Operate).with_qualities(AccessQualities::TIMED),
conform: Conform::MANDATORY,
},
Command {
id: 0x01,
name: "Step",
to_server: true,
response: None,
access: Access::invoke(Privilege::Operate).with_qualities(AccessQualities::TIMED),
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(0),
}],
},
},
];
pub const EVENTS: &[Event] = &[];
pub const CLUSTER: Cluster = Cluster {
id: ID,
name: "Closure Dimension",
revision: REVISION,
pics: "CLDIM",
derived_from: None,
features: FEATURES,
attributes: ATTRIBUTES,
commands: COMMANDS,
events: EVENTS,
};