
io.github.hapjava.characteristics.impl.battery.StatusLowBatteryEnum Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hap Show documentation
Show all versions of hap Show documentation
Homekit Accessory Protocol for Java
package io.github.hapjava.characteristics.impl.battery;
import io.github.hapjava.characteristics.CharacteristicEnum;
import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;
/** 0 ”Battery level is normal” 1 ”Battery level is low” */
public enum StatusLowBatteryEnum implements CharacteristicEnum {
NORMAL(0),
LOW(1);
private static final Map reverse;
static {
reverse =
Arrays.stream(StatusLowBatteryEnum.values())
.collect(Collectors.toMap(StatusLowBatteryEnum::getCode, t -> t));
}
public static StatusLowBatteryEnum fromCode(Integer code) {
return reverse.get(code);
}
private final int code;
StatusLowBatteryEnum(int code) {
this.code = code;
}
@Override
public int getCode() {
return code;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy