#![allow(
clippy::all,
clippy::pedantic,
dead_code,
unreachable_pub,
unused_imports
)]
use crate::datatypes::SemanticTagStruct;
use crate::error::ClusterError;
use crate::types::Nullable;
use matter_codec::{ContainerKind, Element, Tag, TlvReader, TlvWriter, Value};
pub const CLUSTER_ID: u32 = 0x0045;
pub const CLUSTER_REVISION: u16 = 2;
pub mod command_id {}
pub mod attribute_id {
pub const STATE_VALUE: u32 = 0x0000;
}
pub fn decode_state_value(tlv: &[u8]) -> Result<bool, ClusterError> {
let mut r = TlvReader::new(tlv);
match r.next()? {
Some(Element::Scalar {
value: Value::Bool(v),
..
}) => Ok(v),
_ => Err(ClusterError::UnexpectedType {
context: "StateValue",
}),
}
}