11namespace ZWave . CommandClasses ;
22
3+ /// <summary>
4+ /// Represents a battery level value.
5+ /// </summary>
36public struct BatteryLevel
47{
58 public BatteryLevel ( byte value )
69 {
710 Value = value ;
811 }
912
13+ /// <summary>
14+ /// Gets the raw battery level byte.
15+ /// </summary>
1016 public byte Value { get ; }
1117
18+ /// <summary>
19+ /// Gets the battery level as a percentage (0-100).
20+ /// </summary>
1221 public int Level => Value == 0xff ? 0 : Value ;
1322
23+ /// <summary>
24+ /// Gets a value indicating whether the battery level is critically low.
25+ /// </summary>
1426 public bool IsLow => Value == 0xff ;
1527
1628 public static implicit operator BatteryLevel ( byte b ) => new BatteryLevel ( b ) ;
1729}
1830
31+ /// <summary>
32+ /// Indicates the charging status of a battery.
33+ /// </summary>
1934public enum BatteryChargingStatus : byte
2035{
2136 Discharging = 0x00 ,
@@ -25,6 +40,9 @@ public enum BatteryChargingStatus : byte
2540 Maintaining = 0x02 ,
2641}
2742
43+ /// <summary>
44+ /// Indicates whether the battery needs to be recharged or replaced.
45+ /// </summary>
2846public enum BatterRechargeOrReplaceStatus : byte
2947{
3048 /// <summary>
@@ -45,6 +63,9 @@ public enum BatterRechargeOrReplaceStatus : byte
4563 Now = 0x03 ,
4664}
4765
66+ /// <summary>
67+ /// The temperature scale used for battery temperature readings.
68+ /// </summary>
4869public enum BatteryTemperatureScale : byte
4970{
5071 Celcius = 0x00 ,
@@ -176,10 +197,17 @@ public BatteryCommandClass(CommandClassInfo info, IDriver driver, INode node)
176197 {
177198 }
178199
200+ /// <summary>
201+ /// Gets the last reported battery state.
202+ /// </summary>
179203 public BatteryState ? State { get ; private set ; }
180204
205+ /// <summary>
206+ /// Gets the last reported battery health.
207+ /// </summary>
181208 public BatteryHealth ? Health { get ; private set ; }
182209
210+ /// <inheritdoc />
183211 public override bool ? IsCommandSupported ( BatteryCommand command )
184212 => command switch
185213 {
0 commit comments