fix: No root certificates in scratch container
This commit is contained in:
@@ -3,6 +3,7 @@ use std::net::SocketAddr;
|
||||
use anyhow::Result;
|
||||
use async_trait::async_trait;
|
||||
use automation_lib::lua::traits::PartialUserData;
|
||||
use automation_lib::reqwest::new_client;
|
||||
use automation_macro::{Device, LuaDeviceConfig};
|
||||
use google_home::errors::ErrorCode;
|
||||
use google_home::traits::OnOff;
|
||||
@@ -74,7 +75,7 @@ impl OnOff for HueGroup {
|
||||
message::Action::on(false)
|
||||
};
|
||||
|
||||
let res = reqwest::Client::new()
|
||||
let res = new_client()
|
||||
.put(self.url_set_action())
|
||||
.json(&message)
|
||||
.send()
|
||||
@@ -94,10 +95,7 @@ impl OnOff for HueGroup {
|
||||
}
|
||||
|
||||
async fn on(&self) -> Result<bool, ErrorCode> {
|
||||
let res = reqwest::Client::new()
|
||||
.get(self.url_get_state())
|
||||
.send()
|
||||
.await;
|
||||
let res = new_client().get(self.url_get_state()).send().await;
|
||||
|
||||
match res {
|
||||
Ok(res) => {
|
||||
@@ -128,10 +126,7 @@ struct AllOn;
|
||||
impl PartialUserData<HueGroup> for AllOn {
|
||||
fn add_methods<M: mlua::UserDataMethods<HueGroup>>(methods: &mut M) {
|
||||
methods.add_async_method("all_on", async |_lua, this, ()| {
|
||||
let res = reqwest::Client::new()
|
||||
.get(this.url_get_state())
|
||||
.send()
|
||||
.await;
|
||||
let res = new_client().get(this.url_get_state()).send().await;
|
||||
|
||||
match res {
|
||||
Ok(res) => {
|
||||
|
||||
Reference in New Issue
Block a user