# huawei inverter client ## Supported Devices * Residential Inverter * Power Sensor ## Usage ```rust use crate::client_impl::HuaweiClientImpl; async fn do_something() { let cl = HuaweiClientImpl::default(env!("HUAWEI_USER"), env!("HUAWEI_PASSWORD")); let stations = cl.get_station_list().await.unwrap(); let station = stations.first().unwrap(); let realtime_data = cl.get_realtime_station_data(station.station_code.as_str()).await.unwrap(); println!("{:?}", realtime_data); let devices = cl.get_device_list(station.station_code.as_str()).await.unwrap(); println!("{:?}", devices); let power_sensor: &GetDevListData = devices.iter() .filter(|device| device.dev_type_id == DeviceType::PowerSensor) .collect::>() .first() .unwrap(); let power_sensor_data = cl.get_realtime_power_sensor_data(power_sensor.id).await.unwrap(); println!("{:?}", power_sensor_data); let inverter: &GetDevListData = devices.iter() .filter(|device| device.dev_type_id == DeviceType::ResidentialInverter) .collect::>() .first() .unwrap(); let inverter_data = cl.get_realtime_residential_inverter_data(inverter.id).await.unwrap(); println!("{:?}", inverter_data); } ``` ## Tests env Variables: * HUAWEI_USER * HUAWEI_PASSWORD