Skip to content

Commit

Permalink
fix: formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mgierada committed Aug 26, 2023
1 parent 523bb6a commit 9133206
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/api/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ impl GoveeClient {
///
/// This method will panic if the GET request encounters an error.
impl GoveeClient {
pub async fn get_device_state(&self, device: &str, model: &str) -> Result<ApiResponseGoveeDeviceState,ReqwestError> {
pub async fn get_device_state(
&self,
device: &str,
model: &str,
) -> Result<ApiResponseGoveeDeviceState, ReqwestError> {
let client = Client::new();
let params = [("device", device), ("model", model)];
let endpoint = format!("{}/v1/devices/state", GOVEE_ROOT_URL);
Expand All @@ -157,7 +161,10 @@ impl GoveeClient {
.header("Govee-API-Key", &self.govee_api_key)
.send()
.await?;
let response_json = response.json::<ApiResponseGoveeDeviceState>().await.unwrap();
let response_json = response
.json::<ApiResponseGoveeDeviceState>()
.await
.unwrap();
Ok(response_json)
}
}

0 comments on commit 9133206

Please sign in to comment.