#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum EBatteryState {
    Unknown = 0,
    Discharging = 1,
    Charging = 2,
    Full = 3,
}

impl EBatteryState {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::Unknown as i32 => Some(Self::Unknown),
            x if x == Self::Discharging as i32 => Some(Self::Discharging),
            x if x == Self::Charging as i32 => Some(Self::Charging),
            x if x == Self::Full as i32 => Some(Self::Full),
            _ => None,
        }
    }
}
