-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Eaton UPS: Add load percentage sensor.
- Loading branch information
Showing
3 changed files
with
269 additions
and
183 deletions.
There are no files selected for viewing
199 changes: 102 additions & 97 deletions
199
DeviceTools.HumanInterfaceDevices/Usages/HidBatterySystemUsage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1,104 @@ | ||
namespace DeviceTools.HumanInterfaceDevices.Usages | ||
namespace DeviceTools.HumanInterfaceDevices.Usages; | ||
|
||
public enum HidBatterySystemUsage : ushort | ||
{ | ||
public enum HidBatterySystemUsage : ushort | ||
{ | ||
Undefined = 0x00, | ||
SmbBatteryMode = 0x01, | ||
SmbBatteryStatus = 0x02, | ||
SmbAlarmWarning = 0x03, | ||
SmbChargerMode = 0x04, | ||
SmbChargerStatus = 0x05, | ||
SmbChargerSpecInfo = 0x06, | ||
SmbSelectorState = 0x06, | ||
SmbSelectorPresets = 0x06, | ||
SmbSelectorInfo = 0x06, | ||
ChargerSpecInfo = 0x06, | ||
OptionalMfgFunction1 = 0x10, | ||
OptionalMfgFunction2 = 0x11, | ||
OptionalMfgFunction3 = 0x12, | ||
OptionalMfgFunction4 = 0x13, | ||
OptionalMfgFunction5 = 0x14, | ||
ConnectionToSmBus = 0x15, | ||
OutputConnection = 0x16, | ||
ChargerConnection = 0x17, | ||
BatteryInsertion = 0x18, | ||
Usenext = 0x19, | ||
OkToUse = 0x1A, | ||
BatterySupported = 0x1B, | ||
SelectorRevision = 0x1C, | ||
ChargingIndicator = 0x1D, | ||
ManufacturerAccess = 0x28, | ||
RemainingCapacityLimit = 0x29, | ||
RemainingTimeLimit = 0x2A, | ||
AtRate = 0x2B, | ||
CapacityMode = 0x2C, | ||
BroadcastToCharger = 0x2D, | ||
PrimaryBattery = 0x2E, | ||
ChargeController = 0x2F, | ||
TerminateCharge = 0x40, | ||
TerminateDischarge = 0x41, | ||
BelowRemainingCapacityLimit = 0x42, | ||
RemainingTimeLimitExpired = 0x43, | ||
Charging = 0x44, | ||
Discharging = 0x45, | ||
FullyCharged = 0x46, | ||
FullyDischarged = 0x47, | ||
ConditioningFlag = 0x48, | ||
AtRateOk = 0x49, | ||
SmbErrorCode = 0x4A, | ||
NeedReplacement = 0x4B, | ||
AtRateTimeToFull = 0x60, | ||
AtRateTimeToEmpty = 0x61, | ||
AverageCurrent = 0x62, | ||
Maxerror = 0x63, | ||
RelativeStateOfCharge = 0x64, | ||
AbsoluteStateOfCharge = 0x65, | ||
RemainingCapacity = 0x66, | ||
FullChargeCapacity = 0x67, | ||
RunTimeToEmpty = 0x68, | ||
AverageTimeToEmpty = 0x69, | ||
AverageTimeToFull = 0x6A, | ||
CycleCount = 0x6B, | ||
BattPackModelLevel = 0x80, | ||
InternalChargeController = 0x81, | ||
PrimaryBatterySupport = 0x82, | ||
DesignCapacity = 0x83, | ||
SpecificationInfo = 0x84, | ||
ManufacturerDate = 0x85, | ||
SerialNumber = 0x86, | ||
ManufacturerNameIndex = 0x87, | ||
DevicenameIndex = 0x88, | ||
DeviceChemisteryIndex = 0x89, | ||
ManufacturerData = 0x8A, | ||
Rechargable = 0x8B, | ||
WarningCapacityLimit = 0x8C, | ||
CapacityGranularity1 = 0x8D, | ||
CapacityGranularity2 = 0x8E, | ||
OemInformationIndex = 0x8F, | ||
InhibitCharge = 0xC0, | ||
EnablePolling = 0xC1, | ||
ResetToZero = 0xC2, | ||
AcPresent = 0xD0, | ||
BatteryPresent = 0xD1, | ||
PowerFail = 0xD2, | ||
AlarmInhibited = 0xD3, | ||
ThermistorUnderRange = 0xD4, | ||
ThermistorHot = 0xD5, | ||
ThermistorCold = 0xD6, | ||
ThermistorOverRange = 0xD7, | ||
VoltageOutOfRange = 0xD8, | ||
CurrentOutOfRange = 0xD9, | ||
CurrentNotRegulated = 0xDA, | ||
VoltageNotRegulated = 0xDB, | ||
MasterMode = 0xDC, | ||
ChargerSelectorSupport = 0xF0, | ||
ChargerSpec = 0xF1, | ||
Level2 = 0xF2, | ||
Level3 = 0xF3, | ||
} | ||
Undefined = 0x00, | ||
SmartBatteryBatteryMode = 0x01, | ||
SmartBatteryBatteryStatus = 0x02, | ||
SmartBatteryAlarmWarning = 0x03, | ||
SmartBatteryChargerMode = 0x04, | ||
SmartBatteryChargerStatus = 0x05, | ||
SmartBatteryChargerSpecInfo = 0x06, | ||
SmartBatterySelectorState = 0x07, | ||
SmartBatterySelectorPresets = 0x08, | ||
SmartBatterySelectorInfo = 0x09, | ||
|
||
OptionalMfgFunction1 = 0x10, | ||
OptionalMfgFunction2 = 0x11, | ||
OptionalMfgFunction3 = 0x12, | ||
OptionalMfgFunction4 = 0x13, | ||
OptionalMfgFunction5 = 0x14, | ||
ConnectionToSmBus = 0x15, | ||
OutputConnection = 0x16, | ||
ChargerConnection = 0x17, | ||
BatteryInsertion = 0x18, | ||
UseNext = 0x19, | ||
OkToUse = 0x1A, | ||
BatterySupported = 0x1B, | ||
SelectorRevision = 0x1C, | ||
ChargingIndicator = 0x1D, | ||
|
||
ManufacturerAccess = 0x28, | ||
RemainingCapacityLimit = 0x29, | ||
RemainingTimeLimit = 0x2A, | ||
AtRate = 0x2B, | ||
CapacityMode = 0x2C, | ||
BroadcastToCharger = 0x2D, | ||
PrimaryBattery = 0x2E, | ||
ChargeController = 0x2F, | ||
|
||
TerminateCharge = 0x40, | ||
TerminateDischarge = 0x41, | ||
BelowRemainingCapacityLimit = 0x42, | ||
RemainingTimeLimitExpired = 0x43, | ||
Charging = 0x44, | ||
Discharging = 0x45, | ||
FullyCharged = 0x46, | ||
FullyDischarged = 0x47, | ||
ConditioningFlag = 0x48, | ||
AtRateOk = 0x49, | ||
SmbErrorCode = 0x4A, | ||
NeedReplacement = 0x4B, | ||
|
||
AtRateTimeToFull = 0x60, | ||
AtRateTimeToEmpty = 0x61, | ||
AverageCurrent = 0x62, | ||
MaxError = 0x63, | ||
RelativeStateOfCharge = 0x64, | ||
AbsoluteStateOfCharge = 0x65, | ||
RemainingCapacity = 0x66, | ||
FullChargeCapacity = 0x67, | ||
RunTimeToEmpty = 0x68, | ||
AverageTimeToEmpty = 0x69, | ||
AverageTimeToFull = 0x6A, | ||
CycleCount = 0x6B, | ||
|
||
BattPackModelLevel = 0x80, | ||
InternalChargeController = 0x81, | ||
PrimaryBatterySupport = 0x82, | ||
DesignCapacity = 0x83, | ||
SpecificationInfo = 0x84, | ||
ManufacturerDate = 0x85, | ||
SerialNumber = 0x86, | ||
ManufacturerNameIndex = 0x87, | ||
DeviceNameIndex = 0x88, | ||
DeviceChemistryIndex = 0x89, | ||
ManufacturerData = 0x8A, | ||
Rechargeable = 0x8B, | ||
WarningCapacityLimit = 0x8C, | ||
CapacityGranularity1 = 0x8D, | ||
CapacityGranularity2 = 0x8E, | ||
OemInformationIndex = 0x8F, | ||
|
||
InhibitCharge = 0xC0, | ||
EnablePolling = 0xC1, | ||
ResetToZero = 0xC2, | ||
AcPresent = 0xD0, | ||
BatteryPresent = 0xD1, | ||
PowerFail = 0xD2, | ||
AlarmInhibited = 0xD3, | ||
ThermistorUnderRange = 0xD4, | ||
ThermistorHot = 0xD5, | ||
ThermistorCold = 0xD6, | ||
ThermistorOverRange = 0xD7, | ||
VoltageOutOfRange = 0xD8, | ||
CurrentOutOfRange = 0xD9, | ||
CurrentNotRegulated = 0xDA, | ||
VoltageNotRegulated = 0xDB, | ||
MasterMode = 0xDC, | ||
|
||
ChargerSelectorSupport = 0xF0, | ||
ChargerSpec = 0xF1, | ||
Level2 = 0xF2, | ||
Level3 = 0xF3, | ||
} |
171 changes: 89 additions & 82 deletions
171
DeviceTools.HumanInterfaceDevices/Usages/HidPowerDeviceUsage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,91 @@ | ||
namespace DeviceTools.HumanInterfaceDevices.Usages | ||
namespace DeviceTools.HumanInterfaceDevices.Usages; | ||
|
||
public enum HidPowerDeviceUsage : ushort | ||
{ | ||
public enum HidPowerDeviceUsage : ushort | ||
{ | ||
Undefined = 0x00, | ||
NameIndex = 0x01, | ||
PresentStatus = 0x02, | ||
ChangedStatus = 0x03, | ||
UPS = 0x04, | ||
PowerSupply = 0x05, | ||
BatterySystem = 0x10, | ||
BatterySystemId = 0x11, | ||
Battery = 0x12, | ||
BatteryId = 0x13, | ||
Charger = 0x14, | ||
ChargerId = 0x15, | ||
PowerConverter = 0x16, | ||
PowerConverterId = 0x17, | ||
OutletSystem = 0x18, | ||
OutletSystemId = 0x19, | ||
Input = 0x1A, | ||
InputId = 0x1B, | ||
Output = 0x1C, | ||
OutputId = 0x1D, | ||
Flow = 0x1E, | ||
FlowId = 0x1F, | ||
Outlet = 0x20, | ||
OutletId = 0x21, | ||
Gang = 0x22, | ||
GangId = 0x23, | ||
PowerSummary = 0x24, | ||
PowerSummaryId = 0x25, | ||
Voltage = 0x30, | ||
Current = 0x31, | ||
Frequency = 0x32, | ||
ApparentPower = 0x33, | ||
ActivePower = 0x34, | ||
PercentLoad = 0x35, | ||
Temperature = 0x36, | ||
Humidity = 0x37, | ||
BadCount = 0x38, | ||
ConfigVoltage = 0x40, | ||
ConfigCurrent = 0x41, | ||
ConfigFrequency = 0x42, | ||
ConfigApparentPower = 0x43, | ||
ConfigActivePower = 0x44, | ||
ConfigPercentLoad = 0x45, | ||
ConfigTemperature = 0x46, | ||
ConfigHumidity = 0x47, | ||
SwitchOnControl = 0x50, | ||
SwitchOffControl = 0x51, | ||
ToggleControl = 0x52, | ||
LowVoltageTransfer = 0x53, | ||
HighVoltageTransfer = 0x54, | ||
DelayBeforeReboot = 0x55, | ||
DelayBeforeStartup = 0x56, | ||
DelayBeforeShutdown = 0x57, | ||
Test = 0x58, | ||
ModuleReset = 0x59, | ||
AudibleAlarmControl = 0x5A, | ||
Present = 0x60, | ||
Good = 0x61, | ||
InternalFailure = 0x62, | ||
VoltageOutOfRange = 0x63, | ||
FrequencyOutOfRange = 0x64, | ||
Overload = 0x65, | ||
OverCharged = 0x66, | ||
OverTemperature = 0x67, | ||
ShutdownRequested = 0x68, | ||
ShutdownImminent = 0x69, | ||
SwitchOnOff = 0x6B, | ||
Switchable = 0x6C, | ||
Used = 0x6D, | ||
Boost = 0x6E, | ||
Buck = 0x6F, | ||
Initialized = 0x70, | ||
Tested = 0x71, | ||
AwaitingPower = 0x72, | ||
CommunicationLost = 0x73, | ||
ManufacturerIndex = 0xFD, | ||
ProductIndex = 0xFE, | ||
SerialNumberIndex = 0xFF, | ||
} | ||
Undefined = 0x00, | ||
NameIndex = 0x01, | ||
PresentStatus = 0x02, | ||
ChangedStatus = 0x03, | ||
UninterruptiblePowerSupply = 0x04, | ||
PowerSupply = 0x05, | ||
|
||
BatterySystem = 0x10, | ||
BatterySystemId = 0x11, | ||
Battery = 0x12, | ||
BatteryId = 0x13, | ||
Charger = 0x14, | ||
ChargerId = 0x15, | ||
PowerConverter = 0x16, | ||
PowerConverterId = 0x17, | ||
OutletSystem = 0x18, | ||
OutletSystemId = 0x19, | ||
Input = 0x1A, | ||
InputId = 0x1B, | ||
Output = 0x1C, | ||
OutputId = 0x1D, | ||
Flow = 0x1E, | ||
FlowId = 0x1F, | ||
Outlet = 0x20, | ||
OutletId = 0x21, | ||
Gang = 0x22, | ||
GangId = 0x23, | ||
PowerSummary = 0x24, | ||
PowerSummaryId = 0x25, | ||
|
||
Voltage = 0x30, | ||
Current = 0x31, | ||
Frequency = 0x32, | ||
ApparentPower = 0x33, | ||
ActivePower = 0x34, | ||
PercentLoad = 0x35, | ||
Temperature = 0x36, | ||
Humidity = 0x37, | ||
BadCount = 0x38, | ||
|
||
ConfigVoltage = 0x40, | ||
ConfigCurrent = 0x41, | ||
ConfigFrequency = 0x42, | ||
ConfigApparentPower = 0x43, | ||
ConfigActivePower = 0x44, | ||
ConfigPercentLoad = 0x45, | ||
ConfigTemperature = 0x46, | ||
ConfigHumidity = 0x47, | ||
|
||
SwitchOnControl = 0x50, | ||
SwitchOffControl = 0x51, | ||
ToggleControl = 0x52, | ||
LowVoltageTransfer = 0x53, | ||
HighVoltageTransfer = 0x54, | ||
DelayBeforeReboot = 0x55, | ||
DelayBeforeStartup = 0x56, | ||
DelayBeforeShutdown = 0x57, | ||
Test = 0x58, | ||
ModuleReset = 0x59, | ||
AudibleAlarmControl = 0x5A, | ||
|
||
Present = 0x60, | ||
Good = 0x61, | ||
InternalFailure = 0x62, | ||
VoltageOutOfRange = 0x63, | ||
FrequencyOutOfRange = 0x64, | ||
Overload = 0x65, | ||
OverCharged = 0x66, | ||
OverTemperature = 0x67, | ||
ShutdownRequested = 0x68, | ||
ShutdownImminent = 0x69, | ||
|
||
SwitchOnOff = 0x6B, | ||
Switchable = 0x6C, | ||
Used = 0x6D, | ||
Boost = 0x6E, | ||
Buck = 0x6F, | ||
|
||
Initialized = 0x70, | ||
Tested = 0x71, | ||
AwaitingPower = 0x72, | ||
CommunicationLost = 0x73, | ||
|
||
ManufacturerIndex = 0xFD, | ||
ProductIndex = 0xFE, | ||
SerialNumberIndex = 0xFF, | ||
} |
Oops, something went wrong.