#![allow(
clippy::match_same_arms,
clippy::match_single_binding,
clippy::too_many_lines
)]
#[allow(unused_imports)]
use crate::format::CharFormat;
use crate::uuid::Uuid;
#[allow(unused_imports)]
use crate::unit::Unit;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum ServiceType {
AccessoryInformation,
Fan,
GarageDoorOpener,
LightBulb,
LockManagement,
LockMechanism,
Outlet,
Switch,
Thermostat,
SecuritySystem,
CarbonMonoxideSensor,
ContactSensor,
Door,
HumiditySensor,
LeakSensor,
LightSensor,
MotionSensor,
OccupancySensor,
SmokeSensor,
StatelessProgrammableSwitch,
TemperatureSensor,
Window,
WindowCovering,
AirQualitySensor,
Battery,
CarbonDioxideSensor,
ProtocolInformation,
FanV2,
Slat,
FilterMaintenance,
AirPurifier,
HeaterCooler,
HumidifierDehumidifier,
ServiceLabel,
IrrigationSystem,
Valve,
Faucet,
CameraRtpStreamManagement,
Microphone,
Speaker,
Doorbell,
Unknown(Uuid),
}
impl ServiceType {
pub fn from_uuid(u: &Uuid) -> Self {
match u.as_full() {
"0000003e-0000-1000-8000-0026bb765291" => Self::AccessoryInformation,
"00000040-0000-1000-8000-0026bb765291" => Self::Fan,
"00000041-0000-1000-8000-0026bb765291" => Self::GarageDoorOpener,
"00000043-0000-1000-8000-0026bb765291" => Self::LightBulb,
"00000044-0000-1000-8000-0026bb765291" => Self::LockManagement,
"00000045-0000-1000-8000-0026bb765291" => Self::LockMechanism,
"00000047-0000-1000-8000-0026bb765291" => Self::Outlet,
"00000049-0000-1000-8000-0026bb765291" => Self::Switch,
"0000004a-0000-1000-8000-0026bb765291" => Self::Thermostat,
"0000007e-0000-1000-8000-0026bb765291" => Self::SecuritySystem,
"0000007f-0000-1000-8000-0026bb765291" => Self::CarbonMonoxideSensor,
"00000080-0000-1000-8000-0026bb765291" => Self::ContactSensor,
"00000081-0000-1000-8000-0026bb765291" => Self::Door,
"00000082-0000-1000-8000-0026bb765291" => Self::HumiditySensor,
"00000083-0000-1000-8000-0026bb765291" => Self::LeakSensor,
"00000084-0000-1000-8000-0026bb765291" => Self::LightSensor,
"00000085-0000-1000-8000-0026bb765291" => Self::MotionSensor,
"00000086-0000-1000-8000-0026bb765291" => Self::OccupancySensor,
"00000087-0000-1000-8000-0026bb765291" => Self::SmokeSensor,
"00000089-0000-1000-8000-0026bb765291" => Self::StatelessProgrammableSwitch,
"0000008a-0000-1000-8000-0026bb765291" => Self::TemperatureSensor,
"0000008b-0000-1000-8000-0026bb765291" => Self::Window,
"0000008c-0000-1000-8000-0026bb765291" => Self::WindowCovering,
"0000008d-0000-1000-8000-0026bb765291" => Self::AirQualitySensor,
"00000096-0000-1000-8000-0026bb765291" => Self::Battery,
"00000097-0000-1000-8000-0026bb765291" => Self::CarbonDioxideSensor,
"000000a2-0000-1000-8000-0026bb765291" => Self::ProtocolInformation,
"000000b7-0000-1000-8000-0026bb765291" => Self::FanV2,
"000000b9-0000-1000-8000-0026bb765291" => Self::Slat,
"000000ba-0000-1000-8000-0026bb765291" => Self::FilterMaintenance,
"000000bb-0000-1000-8000-0026bb765291" => Self::AirPurifier,
"000000bc-0000-1000-8000-0026bb765291" => Self::HeaterCooler,
"000000bd-0000-1000-8000-0026bb765291" => Self::HumidifierDehumidifier,
"000000cc-0000-1000-8000-0026bb765291" => Self::ServiceLabel,
"000000cf-0000-1000-8000-0026bb765291" => Self::IrrigationSystem,
"000000d0-0000-1000-8000-0026bb765291" => Self::Valve,
"000000d7-0000-1000-8000-0026bb765291" => Self::Faucet,
"00000110-0000-1000-8000-0026bb765291" => Self::CameraRtpStreamManagement,
"00000112-0000-1000-8000-0026bb765291" => Self::Microphone,
"00000113-0000-1000-8000-0026bb765291" => Self::Speaker,
"00000121-0000-1000-8000-0026bb765291" => Self::Doorbell,
_ => Self::Unknown(u.clone()),
}
}
pub fn uuid(&self) -> Uuid {
match self {
Self::AccessoryInformation => {
Uuid::from_full_unchecked("0000003e-0000-1000-8000-0026bb765291".to_string())
}
Self::Fan => {
Uuid::from_full_unchecked("00000040-0000-1000-8000-0026bb765291".to_string())
}
Self::GarageDoorOpener => {
Uuid::from_full_unchecked("00000041-0000-1000-8000-0026bb765291".to_string())
}
Self::LightBulb => {
Uuid::from_full_unchecked("00000043-0000-1000-8000-0026bb765291".to_string())
}
Self::LockManagement => {
Uuid::from_full_unchecked("00000044-0000-1000-8000-0026bb765291".to_string())
}
Self::LockMechanism => {
Uuid::from_full_unchecked("00000045-0000-1000-8000-0026bb765291".to_string())
}
Self::Outlet => {
Uuid::from_full_unchecked("00000047-0000-1000-8000-0026bb765291".to_string())
}
Self::Switch => {
Uuid::from_full_unchecked("00000049-0000-1000-8000-0026bb765291".to_string())
}
Self::Thermostat => {
Uuid::from_full_unchecked("0000004a-0000-1000-8000-0026bb765291".to_string())
}
Self::SecuritySystem => {
Uuid::from_full_unchecked("0000007e-0000-1000-8000-0026bb765291".to_string())
}
Self::CarbonMonoxideSensor => {
Uuid::from_full_unchecked("0000007f-0000-1000-8000-0026bb765291".to_string())
}
Self::ContactSensor => {
Uuid::from_full_unchecked("00000080-0000-1000-8000-0026bb765291".to_string())
}
Self::Door => {
Uuid::from_full_unchecked("00000081-0000-1000-8000-0026bb765291".to_string())
}
Self::HumiditySensor => {
Uuid::from_full_unchecked("00000082-0000-1000-8000-0026bb765291".to_string())
}
Self::LeakSensor => {
Uuid::from_full_unchecked("00000083-0000-1000-8000-0026bb765291".to_string())
}
Self::LightSensor => {
Uuid::from_full_unchecked("00000084-0000-1000-8000-0026bb765291".to_string())
}
Self::MotionSensor => {
Uuid::from_full_unchecked("00000085-0000-1000-8000-0026bb765291".to_string())
}
Self::OccupancySensor => {
Uuid::from_full_unchecked("00000086-0000-1000-8000-0026bb765291".to_string())
}
Self::SmokeSensor => {
Uuid::from_full_unchecked("00000087-0000-1000-8000-0026bb765291".to_string())
}
Self::StatelessProgrammableSwitch => {
Uuid::from_full_unchecked("00000089-0000-1000-8000-0026bb765291".to_string())
}
Self::TemperatureSensor => {
Uuid::from_full_unchecked("0000008a-0000-1000-8000-0026bb765291".to_string())
}
Self::Window => {
Uuid::from_full_unchecked("0000008b-0000-1000-8000-0026bb765291".to_string())
}
Self::WindowCovering => {
Uuid::from_full_unchecked("0000008c-0000-1000-8000-0026bb765291".to_string())
}
Self::AirQualitySensor => {
Uuid::from_full_unchecked("0000008d-0000-1000-8000-0026bb765291".to_string())
}
Self::Battery => {
Uuid::from_full_unchecked("00000096-0000-1000-8000-0026bb765291".to_string())
}
Self::CarbonDioxideSensor => {
Uuid::from_full_unchecked("00000097-0000-1000-8000-0026bb765291".to_string())
}
Self::ProtocolInformation => {
Uuid::from_full_unchecked("000000a2-0000-1000-8000-0026bb765291".to_string())
}
Self::FanV2 => {
Uuid::from_full_unchecked("000000b7-0000-1000-8000-0026bb765291".to_string())
}
Self::Slat => {
Uuid::from_full_unchecked("000000b9-0000-1000-8000-0026bb765291".to_string())
}
Self::FilterMaintenance => {
Uuid::from_full_unchecked("000000ba-0000-1000-8000-0026bb765291".to_string())
}
Self::AirPurifier => {
Uuid::from_full_unchecked("000000bb-0000-1000-8000-0026bb765291".to_string())
}
Self::HeaterCooler => {
Uuid::from_full_unchecked("000000bc-0000-1000-8000-0026bb765291".to_string())
}
Self::HumidifierDehumidifier => {
Uuid::from_full_unchecked("000000bd-0000-1000-8000-0026bb765291".to_string())
}
Self::ServiceLabel => {
Uuid::from_full_unchecked("000000cc-0000-1000-8000-0026bb765291".to_string())
}
Self::IrrigationSystem => {
Uuid::from_full_unchecked("000000cf-0000-1000-8000-0026bb765291".to_string())
}
Self::Valve => {
Uuid::from_full_unchecked("000000d0-0000-1000-8000-0026bb765291".to_string())
}
Self::Faucet => {
Uuid::from_full_unchecked("000000d7-0000-1000-8000-0026bb765291".to_string())
}
Self::CameraRtpStreamManagement => {
Uuid::from_full_unchecked("00000110-0000-1000-8000-0026bb765291".to_string())
}
Self::Microphone => {
Uuid::from_full_unchecked("00000112-0000-1000-8000-0026bb765291".to_string())
}
Self::Speaker => {
Uuid::from_full_unchecked("00000113-0000-1000-8000-0026bb765291".to_string())
}
Self::Doorbell => {
Uuid::from_full_unchecked("00000121-0000-1000-8000-0026bb765291".to_string())
}
Self::Unknown(u) => u.clone(),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum CharacteristicType {
AdministratorOnlyAccess,
AudioFeedback,
Brightness,
CoolingThresholdTemperature,
CurrentDoorState,
CurrentHeatingCoolingState,
CurrentRelativeHumidity,
CurrentTemperature,
HeatingThresholdTemperature,
Hue,
Identify,
LockControlPoint,
LockManagementAutoSecurityTimeout,
LockLastKnownAction,
LockCurrentState,
LockTargetState,
Logs,
Manufacturer,
Model,
MotionDetected,
Name,
ObstructionDetected,
On,
OutletInUse,
RotationDirection,
RotationSpeed,
Saturation,
SerialNumber,
TargetDoorState,
TargetHeatingCoolingState,
TargetRelativeHumidity,
TargetTemperature,
TemperatureDisplayUnits,
Version,
PairSetup,
PairVerify,
PairingFeatures,
PairingPairings,
FirmwareRevision,
HardwareRevision,
AirParticulateDensity,
AirParticulateSize,
SecuritySystemCurrentState,
SecuritySystemTargetState,
BatteryLevel,
CarbonMonoxideDetected,
ContactSensorState,
CurrentAmbientLightLevel,
CurrentHorizontalTiltAngle,
CurrentPosition,
CurrentVerticalTiltAngle,
HoldPosition,
LeakDetected,
OccupancyDetected,
PositionState,
ProgrammableSwitchEvent,
StatusActive,
SmokeDetected,
StatusFault,
StatusJammed,
StatusLowBattery,
StatusTampered,
TargetHorizontalTiltAngle,
TargetPosition,
TargetVerticalTiltAngle,
SecuritySystemAlarmType,
ChargingState,
CarbonMonoxideLevel,
CarbonMonoxidePeakLevel,
CarbonDioxideDetected,
CarbonDioxideLevel,
CarbonDioxidePeakLevel,
AirQuality,
AccessoryFlags,
LockPhysicalControls,
TargetAirPurifierState,
CurrentAirPurifierState,
CurrentSlatState,
FilterLifeLevel,
FilterChangeIndication,
ResetFilterIndication,
TargetAirQuality,
CurrentFanState,
Active,
CurrentHeaterCoolerState,
TargetHeaterCoolerState,
CurrentHumidifierDehumidifierState,
TargetHumidifierDehumidifierState,
WaterLevel,
SwingMode,
TargetSlatState,
TargetFanState,
SlatType,
CurrentTiltAngle,
TargetTiltAngle,
OzoneDensity,
NitrogenDioxideDensity,
SulphurDioxideDensity,
Pm25Density,
Pm10Density,
VocDensity,
RelativeHumidityDehumidifierThreshold,
RelativeHumidityHumidifierThreshold,
ServiceLabelIndex,
ServiceLabelNamespace,
ColorTemperature,
ProgramMode,
InUse,
SetDuration,
RemainingDuration,
ValveType,
IsConfigured,
SupportedVideoStreamConfiguration,
SupportedAudioStreamConfiguration,
SupportedRtpConfiguration,
SelectedRtpStreamConfiguration,
SetupEndpoints,
Volume,
Mute,
NightVision,
OpticalZoom,
DigitalZoom,
ImageRotation,
ImageMirroring,
StreamingStatus,
ThreadNodeCapabilities,
ThreadStatus,
Unknown(Uuid),
}
impl CharacteristicType {
pub fn from_uuid(u: &Uuid) -> Self {
match u.as_full() {
"00000001-0000-1000-8000-0026bb765291" => Self::AdministratorOnlyAccess,
"00000005-0000-1000-8000-0026bb765291" => Self::AudioFeedback,
"00000008-0000-1000-8000-0026bb765291" => Self::Brightness,
"0000000d-0000-1000-8000-0026bb765291" => Self::CoolingThresholdTemperature,
"0000000e-0000-1000-8000-0026bb765291" => Self::CurrentDoorState,
"0000000f-0000-1000-8000-0026bb765291" => Self::CurrentHeatingCoolingState,
"00000010-0000-1000-8000-0026bb765291" => Self::CurrentRelativeHumidity,
"00000011-0000-1000-8000-0026bb765291" => Self::CurrentTemperature,
"00000012-0000-1000-8000-0026bb765291" => Self::HeatingThresholdTemperature,
"00000013-0000-1000-8000-0026bb765291" => Self::Hue,
"00000014-0000-1000-8000-0026bb765291" => Self::Identify,
"00000019-0000-1000-8000-0026bb765291" => Self::LockControlPoint,
"0000001a-0000-1000-8000-0026bb765291" => Self::LockManagementAutoSecurityTimeout,
"0000001c-0000-1000-8000-0026bb765291" => Self::LockLastKnownAction,
"0000001d-0000-1000-8000-0026bb765291" => Self::LockCurrentState,
"0000001e-0000-1000-8000-0026bb765291" => Self::LockTargetState,
"0000001f-0000-1000-8000-0026bb765291" => Self::Logs,
"00000020-0000-1000-8000-0026bb765291" => Self::Manufacturer,
"00000021-0000-1000-8000-0026bb765291" => Self::Model,
"00000022-0000-1000-8000-0026bb765291" => Self::MotionDetected,
"00000023-0000-1000-8000-0026bb765291" => Self::Name,
"00000024-0000-1000-8000-0026bb765291" => Self::ObstructionDetected,
"00000025-0000-1000-8000-0026bb765291" => Self::On,
"00000026-0000-1000-8000-0026bb765291" => Self::OutletInUse,
"00000028-0000-1000-8000-0026bb765291" => Self::RotationDirection,
"00000029-0000-1000-8000-0026bb765291" => Self::RotationSpeed,
"0000002f-0000-1000-8000-0026bb765291" => Self::Saturation,
"00000030-0000-1000-8000-0026bb765291" => Self::SerialNumber,
"00000032-0000-1000-8000-0026bb765291" => Self::TargetDoorState,
"00000033-0000-1000-8000-0026bb765291" => Self::TargetHeatingCoolingState,
"00000034-0000-1000-8000-0026bb765291" => Self::TargetRelativeHumidity,
"00000035-0000-1000-8000-0026bb765291" => Self::TargetTemperature,
"00000036-0000-1000-8000-0026bb765291" => Self::TemperatureDisplayUnits,
"00000037-0000-1000-8000-0026bb765291" => Self::Version,
"0000004c-0000-1000-8000-0026bb765291" => Self::PairSetup,
"0000004e-0000-1000-8000-0026bb765291" => Self::PairVerify,
"0000004f-0000-1000-8000-0026bb765291" => Self::PairingFeatures,
"00000050-0000-1000-8000-0026bb765291" => Self::PairingPairings,
"00000052-0000-1000-8000-0026bb765291" => Self::FirmwareRevision,
"00000053-0000-1000-8000-0026bb765291" => Self::HardwareRevision,
"00000064-0000-1000-8000-0026bb765291" => Self::AirParticulateDensity,
"00000065-0000-1000-8000-0026bb765291" => Self::AirParticulateSize,
"00000066-0000-1000-8000-0026bb765291" => Self::SecuritySystemCurrentState,
"00000067-0000-1000-8000-0026bb765291" => Self::SecuritySystemTargetState,
"00000068-0000-1000-8000-0026bb765291" => Self::BatteryLevel,
"00000069-0000-1000-8000-0026bb765291" => Self::CarbonMonoxideDetected,
"0000006a-0000-1000-8000-0026bb765291" => Self::ContactSensorState,
"0000006b-0000-1000-8000-0026bb765291" => Self::CurrentAmbientLightLevel,
"0000006c-0000-1000-8000-0026bb765291" => Self::CurrentHorizontalTiltAngle,
"0000006d-0000-1000-8000-0026bb765291" => Self::CurrentPosition,
"0000006e-0000-1000-8000-0026bb765291" => Self::CurrentVerticalTiltAngle,
"0000006f-0000-1000-8000-0026bb765291" => Self::HoldPosition,
"00000070-0000-1000-8000-0026bb765291" => Self::LeakDetected,
"00000071-0000-1000-8000-0026bb765291" => Self::OccupancyDetected,
"00000072-0000-1000-8000-0026bb765291" => Self::PositionState,
"00000073-0000-1000-8000-0026bb765291" => Self::ProgrammableSwitchEvent,
"00000075-0000-1000-8000-0026bb765291" => Self::StatusActive,
"00000076-0000-1000-8000-0026bb765291" => Self::SmokeDetected,
"00000077-0000-1000-8000-0026bb765291" => Self::StatusFault,
"00000078-0000-1000-8000-0026bb765291" => Self::StatusJammed,
"00000079-0000-1000-8000-0026bb765291" => Self::StatusLowBattery,
"0000007a-0000-1000-8000-0026bb765291" => Self::StatusTampered,
"0000007b-0000-1000-8000-0026bb765291" => Self::TargetHorizontalTiltAngle,
"0000007c-0000-1000-8000-0026bb765291" => Self::TargetPosition,
"0000007d-0000-1000-8000-0026bb765291" => Self::TargetVerticalTiltAngle,
"0000008e-0000-1000-8000-0026bb765291" => Self::SecuritySystemAlarmType,
"0000008f-0000-1000-8000-0026bb765291" => Self::ChargingState,
"00000090-0000-1000-8000-0026bb765291" => Self::CarbonMonoxideLevel,
"00000091-0000-1000-8000-0026bb765291" => Self::CarbonMonoxidePeakLevel,
"00000092-0000-1000-8000-0026bb765291" => Self::CarbonDioxideDetected,
"00000093-0000-1000-8000-0026bb765291" => Self::CarbonDioxideLevel,
"00000094-0000-1000-8000-0026bb765291" => Self::CarbonDioxidePeakLevel,
"00000095-0000-1000-8000-0026bb765291" => Self::AirQuality,
"000000a6-0000-1000-8000-0026bb765291" => Self::AccessoryFlags,
"000000a7-0000-1000-8000-0026bb765291" => Self::LockPhysicalControls,
"000000a8-0000-1000-8000-0026bb765291" => Self::TargetAirPurifierState,
"000000a9-0000-1000-8000-0026bb765291" => Self::CurrentAirPurifierState,
"000000aa-0000-1000-8000-0026bb765291" => Self::CurrentSlatState,
"000000ab-0000-1000-8000-0026bb765291" => Self::FilterLifeLevel,
"000000ac-0000-1000-8000-0026bb765291" => Self::FilterChangeIndication,
"000000ad-0000-1000-8000-0026bb765291" => Self::ResetFilterIndication,
"000000ae-0000-1000-8000-0026bb765291" => Self::TargetAirQuality,
"000000af-0000-1000-8000-0026bb765291" => Self::CurrentFanState,
"000000b0-0000-1000-8000-0026bb765291" => Self::Active,
"000000b1-0000-1000-8000-0026bb765291" => Self::CurrentHeaterCoolerState,
"000000b2-0000-1000-8000-0026bb765291" => Self::TargetHeaterCoolerState,
"000000b3-0000-1000-8000-0026bb765291" => Self::CurrentHumidifierDehumidifierState,
"000000b4-0000-1000-8000-0026bb765291" => Self::TargetHumidifierDehumidifierState,
"000000b5-0000-1000-8000-0026bb765291" => Self::WaterLevel,
"000000b6-0000-1000-8000-0026bb765291" => Self::SwingMode,
"000000be-0000-1000-8000-0026bb765291" => Self::TargetSlatState,
"000000bf-0000-1000-8000-0026bb765291" => Self::TargetFanState,
"000000c0-0000-1000-8000-0026bb765291" => Self::SlatType,
"000000c1-0000-1000-8000-0026bb765291" => Self::CurrentTiltAngle,
"000000c2-0000-1000-8000-0026bb765291" => Self::TargetTiltAngle,
"000000c3-0000-1000-8000-0026bb765291" => Self::OzoneDensity,
"000000c4-0000-1000-8000-0026bb765291" => Self::NitrogenDioxideDensity,
"000000c5-0000-1000-8000-0026bb765291" => Self::SulphurDioxideDensity,
"000000c6-0000-1000-8000-0026bb765291" => Self::Pm25Density,
"000000c7-0000-1000-8000-0026bb765291" => Self::Pm10Density,
"000000c8-0000-1000-8000-0026bb765291" => Self::VocDensity,
"000000c9-0000-1000-8000-0026bb765291" => Self::RelativeHumidityDehumidifierThreshold,
"000000ca-0000-1000-8000-0026bb765291" => Self::RelativeHumidityHumidifierThreshold,
"000000cb-0000-1000-8000-0026bb765291" => Self::ServiceLabelIndex,
"000000cd-0000-1000-8000-0026bb765291" => Self::ServiceLabelNamespace,
"000000ce-0000-1000-8000-0026bb765291" => Self::ColorTemperature,
"000000d1-0000-1000-8000-0026bb765291" => Self::ProgramMode,
"000000d2-0000-1000-8000-0026bb765291" => Self::InUse,
"000000d3-0000-1000-8000-0026bb765291" => Self::SetDuration,
"000000d4-0000-1000-8000-0026bb765291" => Self::RemainingDuration,
"000000d5-0000-1000-8000-0026bb765291" => Self::ValveType,
"000000d6-0000-1000-8000-0026bb765291" => Self::IsConfigured,
"00000114-0000-1000-8000-0026bb765291" => Self::SupportedVideoStreamConfiguration,
"00000115-0000-1000-8000-0026bb765291" => Self::SupportedAudioStreamConfiguration,
"00000116-0000-1000-8000-0026bb765291" => Self::SupportedRtpConfiguration,
"00000117-0000-1000-8000-0026bb765291" => Self::SelectedRtpStreamConfiguration,
"00000118-0000-1000-8000-0026bb765291" => Self::SetupEndpoints,
"00000119-0000-1000-8000-0026bb765291" => Self::Volume,
"0000011a-0000-1000-8000-0026bb765291" => Self::Mute,
"0000011b-0000-1000-8000-0026bb765291" => Self::NightVision,
"0000011c-0000-1000-8000-0026bb765291" => Self::OpticalZoom,
"0000011d-0000-1000-8000-0026bb765291" => Self::DigitalZoom,
"0000011e-0000-1000-8000-0026bb765291" => Self::ImageRotation,
"0000011f-0000-1000-8000-0026bb765291" => Self::ImageMirroring,
"00000120-0000-1000-8000-0026bb765291" => Self::StreamingStatus,
"00000702-0000-1000-8000-0026bb765291" => Self::ThreadNodeCapabilities,
"00000703-0000-1000-8000-0026bb765291" => Self::ThreadStatus,
_ => Self::Unknown(u.clone()),
}
}
pub fn uuid(&self) -> Uuid {
match self {
Self::AdministratorOnlyAccess => {
Uuid::from_full_unchecked("00000001-0000-1000-8000-0026bb765291".to_string())
}
Self::AudioFeedback => {
Uuid::from_full_unchecked("00000005-0000-1000-8000-0026bb765291".to_string())
}
Self::Brightness => {
Uuid::from_full_unchecked("00000008-0000-1000-8000-0026bb765291".to_string())
}
Self::CoolingThresholdTemperature => {
Uuid::from_full_unchecked("0000000d-0000-1000-8000-0026bb765291".to_string())
}
Self::CurrentDoorState => {
Uuid::from_full_unchecked("0000000e-0000-1000-8000-0026bb765291".to_string())
}
Self::CurrentHeatingCoolingState => {
Uuid::from_full_unchecked("0000000f-0000-1000-8000-0026bb765291".to_string())
}
Self::CurrentRelativeHumidity => {
Uuid::from_full_unchecked("00000010-0000-1000-8000-0026bb765291".to_string())
}
Self::CurrentTemperature => {
Uuid::from_full_unchecked("00000011-0000-1000-8000-0026bb765291".to_string())
}
Self::HeatingThresholdTemperature => {
Uuid::from_full_unchecked("00000012-0000-1000-8000-0026bb765291".to_string())
}
Self::Hue => {
Uuid::from_full_unchecked("00000013-0000-1000-8000-0026bb765291".to_string())
}
Self::Identify => {
Uuid::from_full_unchecked("00000014-0000-1000-8000-0026bb765291".to_string())
}
Self::LockControlPoint => {
Uuid::from_full_unchecked("00000019-0000-1000-8000-0026bb765291".to_string())
}
Self::LockManagementAutoSecurityTimeout => {
Uuid::from_full_unchecked("0000001a-0000-1000-8000-0026bb765291".to_string())
}
Self::LockLastKnownAction => {
Uuid::from_full_unchecked("0000001c-0000-1000-8000-0026bb765291".to_string())
}
Self::LockCurrentState => {
Uuid::from_full_unchecked("0000001d-0000-1000-8000-0026bb765291".to_string())
}
Self::LockTargetState => {
Uuid::from_full_unchecked("0000001e-0000-1000-8000-0026bb765291".to_string())
}
Self::Logs => {
Uuid::from_full_unchecked("0000001f-0000-1000-8000-0026bb765291".to_string())
}
Self::Manufacturer => {
Uuid::from_full_unchecked("00000020-0000-1000-8000-0026bb765291".to_string())
}
Self::Model => {
Uuid::from_full_unchecked("00000021-0000-1000-8000-0026bb765291".to_string())
}
Self::MotionDetected => {
Uuid::from_full_unchecked("00000022-0000-1000-8000-0026bb765291".to_string())
}
Self::Name => {
Uuid::from_full_unchecked("00000023-0000-1000-8000-0026bb765291".to_string())
}
Self::ObstructionDetected => {
Uuid::from_full_unchecked("00000024-0000-1000-8000-0026bb765291".to_string())
}
Self::On => {
Uuid::from_full_unchecked("00000025-0000-1000-8000-0026bb765291".to_string())
}
Self::OutletInUse => {
Uuid::from_full_unchecked("00000026-0000-1000-8000-0026bb765291".to_string())
}
Self::RotationDirection => {
Uuid::from_full_unchecked("00000028-0000-1000-8000-0026bb765291".to_string())
}
Self::RotationSpeed => {
Uuid::from_full_unchecked("00000029-0000-1000-8000-0026bb765291".to_string())
}
Self::Saturation => {
Uuid::from_full_unchecked("0000002f-0000-1000-8000-0026bb765291".to_string())
}
Self::SerialNumber => {
Uuid::from_full_unchecked("00000030-0000-1000-8000-0026bb765291".to_string())
}
Self::TargetDoorState => {
Uuid::from_full_unchecked("00000032-0000-1000-8000-0026bb765291".to_string())
}
Self::TargetHeatingCoolingState => {
Uuid::from_full_unchecked("00000033-0000-1000-8000-0026bb765291".to_string())
}
Self::TargetRelativeHumidity => {
Uuid::from_full_unchecked("00000034-0000-1000-8000-0026bb765291".to_string())
}
Self::TargetTemperature => {
Uuid::from_full_unchecked("00000035-0000-1000-8000-0026bb765291".to_string())
}
Self::TemperatureDisplayUnits => {
Uuid::from_full_unchecked("00000036-0000-1000-8000-0026bb765291".to_string())
}
Self::Version => {
Uuid::from_full_unchecked("00000037-0000-1000-8000-0026bb765291".to_string())
}
Self::PairSetup => {
Uuid::from_full_unchecked("0000004c-0000-1000-8000-0026bb765291".to_string())
}
Self::PairVerify => {
Uuid::from_full_unchecked("0000004e-0000-1000-8000-0026bb765291".to_string())
}
Self::PairingFeatures => {
Uuid::from_full_unchecked("0000004f-0000-1000-8000-0026bb765291".to_string())
}
Self::PairingPairings => {
Uuid::from_full_unchecked("00000050-0000-1000-8000-0026bb765291".to_string())
}
Self::FirmwareRevision => {
Uuid::from_full_unchecked("00000052-0000-1000-8000-0026bb765291".to_string())
}
Self::HardwareRevision => {
Uuid::from_full_unchecked("00000053-0000-1000-8000-0026bb765291".to_string())
}
Self::AirParticulateDensity => {
Uuid::from_full_unchecked("00000064-0000-1000-8000-0026bb765291".to_string())
}
Self::AirParticulateSize => {
Uuid::from_full_unchecked("00000065-0000-1000-8000-0026bb765291".to_string())
}
Self::SecuritySystemCurrentState => {
Uuid::from_full_unchecked("00000066-0000-1000-8000-0026bb765291".to_string())
}
Self::SecuritySystemTargetState => {
Uuid::from_full_unchecked("00000067-0000-1000-8000-0026bb765291".to_string())
}
Self::BatteryLevel => {
Uuid::from_full_unchecked("00000068-0000-1000-8000-0026bb765291".to_string())
}
Self::CarbonMonoxideDetected => {
Uuid::from_full_unchecked("00000069-0000-1000-8000-0026bb765291".to_string())
}
Self::ContactSensorState => {
Uuid::from_full_unchecked("0000006a-0000-1000-8000-0026bb765291".to_string())
}
Self::CurrentAmbientLightLevel => {
Uuid::from_full_unchecked("0000006b-0000-1000-8000-0026bb765291".to_string())
}
Self::CurrentHorizontalTiltAngle => {
Uuid::from_full_unchecked("0000006c-0000-1000-8000-0026bb765291".to_string())
}
Self::CurrentPosition => {
Uuid::from_full_unchecked("0000006d-0000-1000-8000-0026bb765291".to_string())
}
Self::CurrentVerticalTiltAngle => {
Uuid::from_full_unchecked("0000006e-0000-1000-8000-0026bb765291".to_string())
}
Self::HoldPosition => {
Uuid::from_full_unchecked("0000006f-0000-1000-8000-0026bb765291".to_string())
}
Self::LeakDetected => {
Uuid::from_full_unchecked("00000070-0000-1000-8000-0026bb765291".to_string())
}
Self::OccupancyDetected => {
Uuid::from_full_unchecked("00000071-0000-1000-8000-0026bb765291".to_string())
}
Self::PositionState => {
Uuid::from_full_unchecked("00000072-0000-1000-8000-0026bb765291".to_string())
}
Self::ProgrammableSwitchEvent => {
Uuid::from_full_unchecked("00000073-0000-1000-8000-0026bb765291".to_string())
}
Self::StatusActive => {
Uuid::from_full_unchecked("00000075-0000-1000-8000-0026bb765291".to_string())
}
Self::SmokeDetected => {
Uuid::from_full_unchecked("00000076-0000-1000-8000-0026bb765291".to_string())
}
Self::StatusFault => {
Uuid::from_full_unchecked("00000077-0000-1000-8000-0026bb765291".to_string())
}
Self::StatusJammed => {
Uuid::from_full_unchecked("00000078-0000-1000-8000-0026bb765291".to_string())
}
Self::StatusLowBattery => {
Uuid::from_full_unchecked("00000079-0000-1000-8000-0026bb765291".to_string())
}
Self::StatusTampered => {
Uuid::from_full_unchecked("0000007a-0000-1000-8000-0026bb765291".to_string())
}
Self::TargetHorizontalTiltAngle => {
Uuid::from_full_unchecked("0000007b-0000-1000-8000-0026bb765291".to_string())
}
Self::TargetPosition => {
Uuid::from_full_unchecked("0000007c-0000-1000-8000-0026bb765291".to_string())
}
Self::TargetVerticalTiltAngle => {
Uuid::from_full_unchecked("0000007d-0000-1000-8000-0026bb765291".to_string())
}
Self::SecuritySystemAlarmType => {
Uuid::from_full_unchecked("0000008e-0000-1000-8000-0026bb765291".to_string())
}
Self::ChargingState => {
Uuid::from_full_unchecked("0000008f-0000-1000-8000-0026bb765291".to_string())
}
Self::CarbonMonoxideLevel => {
Uuid::from_full_unchecked("00000090-0000-1000-8000-0026bb765291".to_string())
}
Self::CarbonMonoxidePeakLevel => {
Uuid::from_full_unchecked("00000091-0000-1000-8000-0026bb765291".to_string())
}
Self::CarbonDioxideDetected => {
Uuid::from_full_unchecked("00000092-0000-1000-8000-0026bb765291".to_string())
}
Self::CarbonDioxideLevel => {
Uuid::from_full_unchecked("00000093-0000-1000-8000-0026bb765291".to_string())
}
Self::CarbonDioxidePeakLevel => {
Uuid::from_full_unchecked("00000094-0000-1000-8000-0026bb765291".to_string())
}
Self::AirQuality => {
Uuid::from_full_unchecked("00000095-0000-1000-8000-0026bb765291".to_string())
}
Self::AccessoryFlags => {
Uuid::from_full_unchecked("000000a6-0000-1000-8000-0026bb765291".to_string())
}
Self::LockPhysicalControls => {
Uuid::from_full_unchecked("000000a7-0000-1000-8000-0026bb765291".to_string())
}
Self::TargetAirPurifierState => {
Uuid::from_full_unchecked("000000a8-0000-1000-8000-0026bb765291".to_string())
}
Self::CurrentAirPurifierState => {
Uuid::from_full_unchecked("000000a9-0000-1000-8000-0026bb765291".to_string())
}
Self::CurrentSlatState => {
Uuid::from_full_unchecked("000000aa-0000-1000-8000-0026bb765291".to_string())
}
Self::FilterLifeLevel => {
Uuid::from_full_unchecked("000000ab-0000-1000-8000-0026bb765291".to_string())
}
Self::FilterChangeIndication => {
Uuid::from_full_unchecked("000000ac-0000-1000-8000-0026bb765291".to_string())
}
Self::ResetFilterIndication => {
Uuid::from_full_unchecked("000000ad-0000-1000-8000-0026bb765291".to_string())
}
Self::TargetAirQuality => {
Uuid::from_full_unchecked("000000ae-0000-1000-8000-0026bb765291".to_string())
}
Self::CurrentFanState => {
Uuid::from_full_unchecked("000000af-0000-1000-8000-0026bb765291".to_string())
}
Self::Active => {
Uuid::from_full_unchecked("000000b0-0000-1000-8000-0026bb765291".to_string())
}
Self::CurrentHeaterCoolerState => {
Uuid::from_full_unchecked("000000b1-0000-1000-8000-0026bb765291".to_string())
}
Self::TargetHeaterCoolerState => {
Uuid::from_full_unchecked("000000b2-0000-1000-8000-0026bb765291".to_string())
}
Self::CurrentHumidifierDehumidifierState => {
Uuid::from_full_unchecked("000000b3-0000-1000-8000-0026bb765291".to_string())
}
Self::TargetHumidifierDehumidifierState => {
Uuid::from_full_unchecked("000000b4-0000-1000-8000-0026bb765291".to_string())
}
Self::WaterLevel => {
Uuid::from_full_unchecked("000000b5-0000-1000-8000-0026bb765291".to_string())
}
Self::SwingMode => {
Uuid::from_full_unchecked("000000b6-0000-1000-8000-0026bb765291".to_string())
}
Self::TargetSlatState => {
Uuid::from_full_unchecked("000000be-0000-1000-8000-0026bb765291".to_string())
}
Self::TargetFanState => {
Uuid::from_full_unchecked("000000bf-0000-1000-8000-0026bb765291".to_string())
}
Self::SlatType => {
Uuid::from_full_unchecked("000000c0-0000-1000-8000-0026bb765291".to_string())
}
Self::CurrentTiltAngle => {
Uuid::from_full_unchecked("000000c1-0000-1000-8000-0026bb765291".to_string())
}
Self::TargetTiltAngle => {
Uuid::from_full_unchecked("000000c2-0000-1000-8000-0026bb765291".to_string())
}
Self::OzoneDensity => {
Uuid::from_full_unchecked("000000c3-0000-1000-8000-0026bb765291".to_string())
}
Self::NitrogenDioxideDensity => {
Uuid::from_full_unchecked("000000c4-0000-1000-8000-0026bb765291".to_string())
}
Self::SulphurDioxideDensity => {
Uuid::from_full_unchecked("000000c5-0000-1000-8000-0026bb765291".to_string())
}
Self::Pm25Density => {
Uuid::from_full_unchecked("000000c6-0000-1000-8000-0026bb765291".to_string())
}
Self::Pm10Density => {
Uuid::from_full_unchecked("000000c7-0000-1000-8000-0026bb765291".to_string())
}
Self::VocDensity => {
Uuid::from_full_unchecked("000000c8-0000-1000-8000-0026bb765291".to_string())
}
Self::RelativeHumidityDehumidifierThreshold => {
Uuid::from_full_unchecked("000000c9-0000-1000-8000-0026bb765291".to_string())
}
Self::RelativeHumidityHumidifierThreshold => {
Uuid::from_full_unchecked("000000ca-0000-1000-8000-0026bb765291".to_string())
}
Self::ServiceLabelIndex => {
Uuid::from_full_unchecked("000000cb-0000-1000-8000-0026bb765291".to_string())
}
Self::ServiceLabelNamespace => {
Uuid::from_full_unchecked("000000cd-0000-1000-8000-0026bb765291".to_string())
}
Self::ColorTemperature => {
Uuid::from_full_unchecked("000000ce-0000-1000-8000-0026bb765291".to_string())
}
Self::ProgramMode => {
Uuid::from_full_unchecked("000000d1-0000-1000-8000-0026bb765291".to_string())
}
Self::InUse => {
Uuid::from_full_unchecked("000000d2-0000-1000-8000-0026bb765291".to_string())
}
Self::SetDuration => {
Uuid::from_full_unchecked("000000d3-0000-1000-8000-0026bb765291".to_string())
}
Self::RemainingDuration => {
Uuid::from_full_unchecked("000000d4-0000-1000-8000-0026bb765291".to_string())
}
Self::ValveType => {
Uuid::from_full_unchecked("000000d5-0000-1000-8000-0026bb765291".to_string())
}
Self::IsConfigured => {
Uuid::from_full_unchecked("000000d6-0000-1000-8000-0026bb765291".to_string())
}
Self::SupportedVideoStreamConfiguration => {
Uuid::from_full_unchecked("00000114-0000-1000-8000-0026bb765291".to_string())
}
Self::SupportedAudioStreamConfiguration => {
Uuid::from_full_unchecked("00000115-0000-1000-8000-0026bb765291".to_string())
}
Self::SupportedRtpConfiguration => {
Uuid::from_full_unchecked("00000116-0000-1000-8000-0026bb765291".to_string())
}
Self::SelectedRtpStreamConfiguration => {
Uuid::from_full_unchecked("00000117-0000-1000-8000-0026bb765291".to_string())
}
Self::SetupEndpoints => {
Uuid::from_full_unchecked("00000118-0000-1000-8000-0026bb765291".to_string())
}
Self::Volume => {
Uuid::from_full_unchecked("00000119-0000-1000-8000-0026bb765291".to_string())
}
Self::Mute => {
Uuid::from_full_unchecked("0000011a-0000-1000-8000-0026bb765291".to_string())
}
Self::NightVision => {
Uuid::from_full_unchecked("0000011b-0000-1000-8000-0026bb765291".to_string())
}
Self::OpticalZoom => {
Uuid::from_full_unchecked("0000011c-0000-1000-8000-0026bb765291".to_string())
}
Self::DigitalZoom => {
Uuid::from_full_unchecked("0000011d-0000-1000-8000-0026bb765291".to_string())
}
Self::ImageRotation => {
Uuid::from_full_unchecked("0000011e-0000-1000-8000-0026bb765291".to_string())
}
Self::ImageMirroring => {
Uuid::from_full_unchecked("0000011f-0000-1000-8000-0026bb765291".to_string())
}
Self::StreamingStatus => {
Uuid::from_full_unchecked("00000120-0000-1000-8000-0026bb765291".to_string())
}
Self::ThreadNodeCapabilities => {
Uuid::from_full_unchecked("00000702-0000-1000-8000-0026bb765291".to_string())
}
Self::ThreadStatus => {
Uuid::from_full_unchecked("00000703-0000-1000-8000-0026bb765291".to_string())
}
Self::Unknown(u) => u.clone(),
}
}
pub fn default_format(&self) -> Option<CharFormat> {
match self {
Self::AdministratorOnlyAccess => Some(CharFormat::Bool),
Self::AudioFeedback => Some(CharFormat::Bool),
Self::Brightness => Some(CharFormat::Int),
Self::CoolingThresholdTemperature => Some(CharFormat::Float),
Self::CurrentDoorState => Some(CharFormat::Uint8),
Self::CurrentHeatingCoolingState => Some(CharFormat::Uint8),
Self::CurrentRelativeHumidity => Some(CharFormat::Float),
Self::CurrentTemperature => Some(CharFormat::Float),
Self::HeatingThresholdTemperature => Some(CharFormat::Float),
Self::Hue => Some(CharFormat::Float),
Self::Identify => Some(CharFormat::Bool),
Self::LockControlPoint => Some(CharFormat::Tlv8),
Self::LockManagementAutoSecurityTimeout => Some(CharFormat::Uint32),
Self::LockLastKnownAction => Some(CharFormat::Uint8),
Self::LockCurrentState => Some(CharFormat::Uint8),
Self::LockTargetState => Some(CharFormat::Uint8),
Self::Logs => Some(CharFormat::Tlv8),
Self::Manufacturer => Some(CharFormat::String),
Self::Model => Some(CharFormat::String),
Self::MotionDetected => Some(CharFormat::Bool),
Self::Name => Some(CharFormat::String),
Self::ObstructionDetected => Some(CharFormat::Bool),
Self::On => Some(CharFormat::Bool),
Self::OutletInUse => Some(CharFormat::Bool),
Self::RotationDirection => Some(CharFormat::Int),
Self::RotationSpeed => Some(CharFormat::Float),
Self::Saturation => Some(CharFormat::Float),
Self::SerialNumber => Some(CharFormat::String),
Self::TargetDoorState => Some(CharFormat::Uint8),
Self::TargetHeatingCoolingState => Some(CharFormat::Uint8),
Self::TargetRelativeHumidity => Some(CharFormat::Float),
Self::TargetTemperature => Some(CharFormat::Float),
Self::TemperatureDisplayUnits => Some(CharFormat::Uint8),
Self::Version => Some(CharFormat::String),
Self::PairSetup => Some(CharFormat::Tlv8),
Self::PairVerify => Some(CharFormat::Tlv8),
Self::PairingFeatures => Some(CharFormat::Uint8),
Self::PairingPairings => Some(CharFormat::Tlv8),
Self::FirmwareRevision => Some(CharFormat::String),
Self::HardwareRevision => Some(CharFormat::String),
Self::AirParticulateDensity => Some(CharFormat::Float),
Self::AirParticulateSize => Some(CharFormat::Uint8),
Self::SecuritySystemCurrentState => Some(CharFormat::Uint8),
Self::SecuritySystemTargetState => Some(CharFormat::Uint8),
Self::BatteryLevel => Some(CharFormat::Uint8),
Self::CarbonMonoxideDetected => Some(CharFormat::Uint8),
Self::ContactSensorState => Some(CharFormat::Uint8),
Self::CurrentAmbientLightLevel => Some(CharFormat::Float),
Self::CurrentHorizontalTiltAngle => Some(CharFormat::Int),
Self::CurrentPosition => Some(CharFormat::Uint8),
Self::CurrentVerticalTiltAngle => Some(CharFormat::Int),
Self::HoldPosition => Some(CharFormat::Bool),
Self::LeakDetected => Some(CharFormat::Uint8),
Self::OccupancyDetected => Some(CharFormat::Uint8),
Self::PositionState => Some(CharFormat::Uint8),
Self::ProgrammableSwitchEvent => Some(CharFormat::Uint8),
Self::StatusActive => Some(CharFormat::Bool),
Self::SmokeDetected => Some(CharFormat::Uint8),
Self::StatusFault => Some(CharFormat::Uint8),
Self::StatusJammed => Some(CharFormat::Uint8),
Self::StatusLowBattery => Some(CharFormat::Uint8),
Self::StatusTampered => Some(CharFormat::Uint8),
Self::TargetHorizontalTiltAngle => Some(CharFormat::Int),
Self::TargetPosition => Some(CharFormat::Uint8),
Self::TargetVerticalTiltAngle => Some(CharFormat::Int),
Self::SecuritySystemAlarmType => Some(CharFormat::Uint8),
Self::ChargingState => Some(CharFormat::Uint8),
Self::CarbonMonoxideLevel => Some(CharFormat::Float),
Self::CarbonMonoxidePeakLevel => Some(CharFormat::Float),
Self::CarbonDioxideDetected => Some(CharFormat::Uint8),
Self::CarbonDioxideLevel => Some(CharFormat::Float),
Self::CarbonDioxidePeakLevel => Some(CharFormat::Float),
Self::AirQuality => Some(CharFormat::Uint8),
Self::AccessoryFlags => Some(CharFormat::Uint32),
Self::LockPhysicalControls => Some(CharFormat::Uint8),
Self::TargetAirPurifierState => Some(CharFormat::Uint8),
Self::CurrentAirPurifierState => Some(CharFormat::Uint8),
Self::CurrentSlatState => Some(CharFormat::Uint8),
Self::FilterLifeLevel => Some(CharFormat::Float),
Self::FilterChangeIndication => Some(CharFormat::Uint8),
Self::ResetFilterIndication => Some(CharFormat::Uint8),
Self::TargetAirQuality => Some(CharFormat::Uint8),
Self::CurrentFanState => Some(CharFormat::Uint8),
Self::Active => Some(CharFormat::Uint8),
Self::CurrentHeaterCoolerState => Some(CharFormat::Uint8),
Self::TargetHeaterCoolerState => Some(CharFormat::Uint8),
Self::CurrentHumidifierDehumidifierState => Some(CharFormat::Uint8),
Self::TargetHumidifierDehumidifierState => Some(CharFormat::Uint8),
Self::WaterLevel => Some(CharFormat::Float),
Self::SwingMode => Some(CharFormat::Uint8),
Self::TargetSlatState => Some(CharFormat::Uint8),
Self::TargetFanState => Some(CharFormat::Uint8),
Self::SlatType => Some(CharFormat::Uint8),
Self::CurrentTiltAngle => Some(CharFormat::Int),
Self::TargetTiltAngle => Some(CharFormat::Int),
Self::OzoneDensity => Some(CharFormat::Float),
Self::NitrogenDioxideDensity => Some(CharFormat::Float),
Self::SulphurDioxideDensity => Some(CharFormat::Float),
Self::Pm25Density => Some(CharFormat::Float),
Self::Pm10Density => Some(CharFormat::Float),
Self::VocDensity => Some(CharFormat::Float),
Self::RelativeHumidityDehumidifierThreshold => Some(CharFormat::Float),
Self::RelativeHumidityHumidifierThreshold => Some(CharFormat::Float),
Self::ServiceLabelIndex => Some(CharFormat::Uint8),
Self::ServiceLabelNamespace => Some(CharFormat::Uint8),
Self::ColorTemperature => Some(CharFormat::Uint32),
Self::ProgramMode => Some(CharFormat::Uint8),
Self::InUse => Some(CharFormat::Uint8),
Self::SetDuration => Some(CharFormat::Uint32),
Self::RemainingDuration => Some(CharFormat::Uint32),
Self::ValveType => Some(CharFormat::Uint8),
Self::IsConfigured => Some(CharFormat::Uint8),
Self::SupportedVideoStreamConfiguration => Some(CharFormat::Tlv8),
Self::SupportedAudioStreamConfiguration => Some(CharFormat::Tlv8),
Self::SupportedRtpConfiguration => Some(CharFormat::Tlv8),
Self::SelectedRtpStreamConfiguration => Some(CharFormat::Tlv8),
Self::SetupEndpoints => Some(CharFormat::Tlv8),
Self::Volume => Some(CharFormat::Uint8),
Self::Mute => Some(CharFormat::Bool),
Self::NightVision => Some(CharFormat::Bool),
Self::OpticalZoom => Some(CharFormat::Float),
Self::DigitalZoom => Some(CharFormat::Float),
Self::ImageRotation => Some(CharFormat::Float),
Self::ImageMirroring => Some(CharFormat::Bool),
Self::StreamingStatus => Some(CharFormat::Tlv8),
Self::ThreadNodeCapabilities => Some(CharFormat::Uint16),
Self::ThreadStatus => Some(CharFormat::Uint16),
_ => None,
}
}
pub fn unit(&self) -> Option<Unit> {
match self {
Self::Brightness => Some(Unit::Percentage),
Self::CoolingThresholdTemperature => Some(Unit::Celsius),
Self::CurrentRelativeHumidity => Some(Unit::Percentage),
Self::CurrentTemperature => Some(Unit::Celsius),
Self::HeatingThresholdTemperature => Some(Unit::Celsius),
Self::Hue => Some(Unit::ArcDegrees),
Self::LockManagementAutoSecurityTimeout => Some(Unit::Seconds),
Self::RotationSpeed => Some(Unit::Percentage),
Self::Saturation => Some(Unit::Percentage),
Self::TargetRelativeHumidity => Some(Unit::Percentage),
Self::TargetTemperature => Some(Unit::Celsius),
Self::BatteryLevel => Some(Unit::Percentage),
Self::CurrentAmbientLightLevel => Some(Unit::Lux),
Self::CurrentHorizontalTiltAngle => Some(Unit::ArcDegrees),
Self::CurrentPosition => Some(Unit::Percentage),
Self::CurrentVerticalTiltAngle => Some(Unit::ArcDegrees),
Self::TargetHorizontalTiltAngle => Some(Unit::ArcDegrees),
Self::TargetPosition => Some(Unit::Percentage),
Self::TargetVerticalTiltAngle => Some(Unit::ArcDegrees),
Self::WaterLevel => Some(Unit::Percentage),
Self::CurrentTiltAngle => Some(Unit::ArcDegrees),
Self::TargetTiltAngle => Some(Unit::ArcDegrees),
Self::RelativeHumidityDehumidifierThreshold => Some(Unit::Percentage),
Self::RelativeHumidityHumidifierThreshold => Some(Unit::Percentage),
Self::Volume => Some(Unit::Percentage),
Self::ImageRotation => Some(Unit::ArcDegrees),
_ => None,
}
}
pub fn valid_values(&self) -> Option<&'static [(i64, &'static str)]> {
match self {
Self::CurrentDoorState => Some(&[
(0, "Open"),
(1, "Closed"),
(2, "Opening"),
(3, "Closing"),
(4, "Stopped"),
]),
Self::CurrentHeatingCoolingState => Some(&[(0, "Off"), (1, "Heat"), (2, "Cool")]),
Self::LockLastKnownAction => Some(&[
(0, "LastDeadbolted"),
(1, "LastUnlocked"),
(2, "LastLockedRemotely"),
(3, "LastUnlockedRemotely"),
(4, "LastLockedManual"),
(5, "LastUnlockedManual"),
(6, "AutoLock"),
(7, "AutoUnlock"),
(8, "Locked"),
(9, "Unlocked"),
]),
Self::LockCurrentState => Some(&[
(0, "Unsecured"),
(1, "Secured"),
(2, "Jammed"),
(3, "Unknown"),
]),
Self::LockTargetState => Some(&[(0, "Unsecured"), (1, "Secured")]),
Self::RotationDirection => Some(&[(0, "Clockwise"), (1, "CounterClockwise")]),
Self::TargetDoorState => Some(&[(0, "Open"), (1, "Closed")]),
Self::TargetHeatingCoolingState => {
Some(&[(0, "Off"), (1, "Heat"), (2, "Cool"), (3, "Auto")])
}
Self::TemperatureDisplayUnits => Some(&[(0, "Celsius"), (1, "Fahrenheit")]),
Self::SecuritySystemCurrentState => Some(&[
(0, "StayArm"),
(1, "AwayArm"),
(2, "NightArm"),
(3, "Disarmed"),
(4, "AlarmTriggered"),
]),
Self::SecuritySystemTargetState => Some(&[
(0, "StayArm"),
(1, "AwayArm"),
(2, "NightArm"),
(3, "Disarmed"),
]),
Self::CarbonMonoxideDetected => Some(&[(0, "NotDetected"), (1, "Detected")]),
Self::ContactSensorState => Some(&[(0, "ContactDetected"), (1, "ContactNotDetected")]),
Self::LeakDetected => Some(&[(0, "LeakNotDetected"), (1, "LeakDetected")]),
Self::OccupancyDetected => {
Some(&[(0, "OccupancyNotDetected"), (1, "OccupancyDetected")])
}
Self::PositionState => Some(&[(0, "Decreasing"), (1, "Increasing"), (2, "Stopped")]),
Self::ProgrammableSwitchEvent => {
Some(&[(0, "SinglePress"), (1, "DoublePress"), (2, "LongPress")])
}
Self::SmokeDetected => Some(&[(0, "SmokeNotDetected"), (1, "SmokeDetected")]),
Self::StatusFault => Some(&[(0, "NoFault"), (1, "GeneralFault")]),
Self::StatusJammed => Some(&[(0, "NotJammed"), (1, "Jammed")]),
Self::StatusLowBattery => Some(&[(0, "Normal"), (1, "Low")]),
Self::StatusTampered => Some(&[(0, "NotTampered"), (1, "Tampered")]),
Self::ChargingState => {
Some(&[(0, "NotCharging"), (1, "Charging"), (2, "NotChargeable")])
}
Self::CarbonDioxideDetected => Some(&[
(0, "CarbonDioxideNotDetected"),
(1, "CarbonDioxideDetected"),
]),
Self::AirQuality => Some(&[
(0, "Unknown"),
(1, "Excellent"),
(2, "Good"),
(3, "Fair"),
(4, "Inferior"),
(5, "Poor"),
]),
Self::LockPhysicalControls => {
Some(&[(0, "ControlLockDisabled"), (1, "ControlLockEnabled")])
}
Self::TargetAirPurifierState => Some(&[(0, "Manual"), (1, "Automatic")]),
Self::CurrentAirPurifierState => {
Some(&[(0, "Inactive"), (1, "Idle"), (2, "PurgingAir")])
}
Self::CurrentSlatState => Some(&[(0, "Fixed"), (1, "Jammed"), (2, "Swinging")]),
Self::FilterChangeIndication => Some(&[(0, "FilterOk"), (1, "ChangeFilter")]),
Self::TargetAirQuality => Some(&[(0, "Excellent"), (1, "Good"), (2, "Fair")]),
Self::CurrentFanState => Some(&[(0, "Inactive"), (1, "Idle"), (2, "BlowingAir")]),
Self::Active => Some(&[(0, "Inactive"), (1, "Active")]),
Self::CurrentHeaterCoolerState => {
Some(&[(0, "Inactive"), (1, "Idle"), (2, "Heating"), (3, "Cooling")])
}
Self::TargetHeaterCoolerState => Some(&[(0, "Automatic"), (1, "Heat"), (2, "Cool")]),
Self::CurrentHumidifierDehumidifierState => Some(&[
(0, "Inactive"),
(1, "Idle"),
(2, "Humidifying"),
(3, "Dehumidifying"),
]),
Self::TargetHumidifierDehumidifierState => Some(&[
(0, "Humidifier"),
(1, "Dehumidifier"),
(2, "HumidifierOrDehumidifier"),
]),
Self::SwingMode => Some(&[(0, "Disabled"), (1, "Enabled")]),
Self::TargetSlatState => Some(&[(0, "Manual"), (1, "Auto")]),
Self::TargetFanState => Some(&[(0, "Manual"), (1, "Auto")]),
Self::SlatType => Some(&[(0, "Horizontal"), (1, "Vertical")]),
Self::ServiceLabelNamespace => Some(&[(0, "Dots"), (1, "ArabicNumerals")]),
Self::ProgramMode => Some(&[
(0, "NoProgramScheduled"),
(1, "ProgramScheduled"),
(2, "ProgramScheduledManualMode"),
]),
Self::InUse => Some(&[(0, "NotInUse"), (1, "InUse")]),
Self::ValveType => Some(&[
(0, "GenericValve"),
(1, "Irrigation"),
(2, "ShowerHead"),
(3, "WaterFaucet"),
]),
Self::IsConfigured => Some(&[(0, "NotConfigured"), (1, "Configured")]),
_ => None,
}
}
}