power_manager_integration_test_lib/client_connectors/
thermal_client.rsuse crate::TestEnv;
use fidl_fuchsia_thermal as fthermal;
pub struct ThermalClient {
watcher_proxy: fthermal::ClientStateWatcherProxy,
}
impl ThermalClient {
pub fn new(test_env: &TestEnv, client_type: &str) -> Self {
let connector = test_env.connect_to_protocol::<fthermal::ClientStateConnectorMarker>();
let (watcher_proxy, watcher_remote) =
fidl::endpoints::create_proxy::<fthermal::ClientStateWatcherMarker>();
connector.connect(client_type, watcher_remote).expect("Failed to connect thermal client");
Self { watcher_proxy }
}
pub async fn get_thermal_state(&self) -> Result<u64, anyhow::Error> {
self.watcher_proxy.watch().await.map_err(|e| e.into())
}
}