public enum ChargingState
- Object
- Enum<ChargingState>
- ChargingState
ImplementsComparable<ChargingState>
Whether an accessory’s battery is charging, for
Trait.BATTERY_CHARGING.
Read-only.Enum constants
UNKNOWN | The accessory could not say. |
NOT_CHARGING | On battery. |
CHARGING | Charging. |
FULL | On external power with the battery already full. |
NOT_CHARGEABLE | The battery is not rechargeable – a coin cell in a sensor. |
Methods
public static ChargingState[] values() | |
public static ChargingState valueOf(String name) | |
public static ChargingState of(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, answers UNKNOWN. |
Inherited methods
Enum constant details
UNKNOWN
UNKNOWNThe accessory could not say.
HomeKit never produces this – its characteristic has no such value.
NOT_CHARGING
NOT_CHARGINGOn battery.
CHARGING
CHARGINGCharging.
FULL
FULLOn external power with the battery already full.
HomeKit never produces this; it reports NOT_CHARGING for a
full battery sitting on a charger, which is indistinguishable from one
that is running down.
NOT_CHARGEABLE
NOT_CHARGEABLEThe 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
public static ChargingState[] values()valueOf
public static ChargingState valueOf(String name)of
public static ChargingState of(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, answers
UNKNOWN.Parameters
valueTraitValue- a value read from
Trait.BATTERY_CHARGING, ornull
Returns
the state, never
null