1use num_enum::{IntoPrimitive, TryFromPrimitive};
4
5use crate::Ident;
6
7#[expect(missing_docs)]
12#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive, IntoPrimitive)]
13#[repr(u16)]
14pub enum KnownUsage {
15 Undefined = 0,
16 IName = 0x01,
17 PresentStatus = 0x02,
18 ChangedStatus = 0x03,
19 Ups = 0x04,
20 PowerSupply = 0x05,
21 BatterySystem = 0x10,
23 BatterySystemId = 0x11,
24 Battery = 0x12,
25 BatteryId = 0x13,
26 Charger = 0x14,
27 ChargerId = 0x15,
28 PowerConverter = 0x16,
29 PowerConverterId = 0x17,
30 OutletSystem = 0x18,
31 OutletSystemId = 0x19,
32 Input = 0x1A,
33 InputId = 0x1B,
34 Output = 0x1C,
35 OutputId = 0x1D,
36 Flow = 0x1E,
37 FlowId = 0x1F,
38 Outlet = 0x20,
39 OutletId = 0x21,
40 Gang = 0x22,
41 GangId = 0x23,
42 PowerSummary = 0x24,
43 PowerSummaryId = 0x25,
44 Voltage = 0x30,
46 Current = 0x31,
47 Frequency = 0x32,
48 ApparentPower = 0x33,
49 ActivePower = 0x34,
50 PercentLoad = 0x35,
51 Temperature = 0x36,
52 Humidity = 0x37,
53 BadCount = 0x38,
54 ConfigVoltage = 0x40,
56 ConfigCurrent = 0x41,
57 ConfigFrequency = 0x42,
58 ConfigApparentPower = 0x43,
59 ConfigActivePower = 0x44,
60 ConfigPercentLoad = 0x45,
61 ConfigTemperature = 0x46,
62 ConfigHumidity = 0x47,
63 SwitchOnControl = 0x50,
65 SwitchOffControl = 0x51,
66 ToggleControl = 0x52,
67 LowVoltageTransfer = 0x53,
68 HighVoltageTransfer = 0x54,
69 DelayBeforeReboot = 0x55,
70 DelayBeforeStartup = 0x56,
71 DelayBeforeShutdown = 0x57,
72 Test = 0x58,
73 ModuleReset = 0x59,
74 AudibleAlarmControl = 0x5A,
75 Present = 0x60,
77 Good = 0x61,
78 InternalFailure = 0x62,
79 VoltageOutOfRange = 0x63,
80 FrequencyOutOfRange = 0x64,
81 Overload = 0x65,
82 OverCharged = 0x66,
83 OverTemperature = 0x67,
84 ShutdownRequested = 0x68,
85 ShutdownImminent = 0x69,
86 SwitchOnOff = 0x6B,
88 Switchable = 0x6C,
89 Used = 0x6D,
90 Boost = 0x6E,
91 Buck = 0x6F,
92 Initialized = 0x70,
93 Tested = 0x71,
94 AwaitingPower = 0x72,
95 CommunicationLost = 0x73,
96 IManufacturer = 0xFD,
98 IProduct = 0xFE,
99 ISerialNumber = 0xFF,
100 }
102
103pub type Usage = Ident<KnownUsage, u16>;