public enum ChargingState

  1. Object
  2. Enum<ChargingState>
  3. ChargingState

ImplementsComparable<ChargingState>

Whether an accessory’s battery is charging, for Trait.BATTERY_CHARGING. Read-only.

Enum constants

UNKNOWNThe accessory could not say.
NOT_CHARGINGOn battery.
CHARGINGCharging.
FULLOn external power with the battery already full.
NOT_CHARGEABLEThe 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

UNKNOWN

The accessory could not say.

HomeKit never produces this – its characteristic has no such value.

NOT_CHARGING

NOT_CHARGING
On battery.

CHARGING

CHARGING
Charging.

FULL

FULL

On 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_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

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

value TraitValue
a value read from Trait.BATTERY_CHARGING, or null

Returns

the state, never null