Enum ChargingState
- All Implemented Interfaces:
Comparable<ChargingState>
Whether an accessory's battery is charging, for
Trait.BATTERY_CHARGING.
Read-only.-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCharging.On external power with the battery already full.The battery is not rechargeable -- a coin cell in a sensor.On battery.The accessory could not say. -
Method Summary
Modifier and TypeMethodDescriptionstatic ChargingStateof(TraitValue value) Reads a charging state out of a trait value, total: a value that is not an enum, or whose ordinal is outside this set, answersUNKNOWN.static ChargingStateReturns the enum constant of this type with the specified name.static ChargingState[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
UNKNOWN
The accessory could not say.
HomeKit never produces this -- its characteristic has no such value.
-
NOT_CHARGING
On battery. -
CHARGING
Charging. -
FULL
On external power with the battery already full.
HomeKit never produces this; it reports
NOT_CHARGINGfor a full battery sitting on a charger, which is indistinguishable from one that is running down. -
NOT_CHARGEABLE
The battery is not rechargeable -- a coin cell in a sensor.
Matter and Google Home never produce this. Matter expresses it by the accessory simply not implementing the rechargeable feature, which this API cannot see from the charge attribute alone.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
of
Reads a charging state out of a trait value, total: a value that is not an enum, or whose ordinal is outside this set, answers
UNKNOWN.Parameters
value: a value read fromTrait.BATTERY_CHARGING, ornull
Returns
the state, never
null
-