fix: No root certificates in scratch container
Build and deploy / build (push) Successful in 17m43s
Build and deploy / Deploy container (push) Successful in 34s

This commit is contained in:
2026-06-20 02:42:53 +02:00
parent b30988f869
commit 8babffed76
9 changed files with 46 additions and 18 deletions
+6 -4
View File
@@ -1,6 +1,7 @@
use async_trait::async_trait;
use automation_lib::config::InfoConfig;
use automation_lib::device::{Device, LuaDeviceCreate};
use automation_lib::reqwest::new_client;
use automation_macro::{Device, LuaDeviceConfig};
use google_home::device::Name;
use google_home::errors::ErrorCode;
@@ -52,20 +53,21 @@ impl AirFilter {
async fn set_fan_speed(&self, speed: air_filter_types::FanSpeed) -> Result<(), Error> {
let message = air_filter_types::SetFanSpeed::new(speed);
let url = format!("{}/state/fan", self.config.url);
let client = reqwest::Client::new();
client.put(url).json(&message).send().await?;
new_client().put(url).json(&message).send().await?;
Ok(())
}
async fn get_fan_state(&self) -> Result<air_filter_types::FanState, Error> {
let url = format!("{}/state/fan", self.config.url);
Ok(reqwest::get(url).await?.json().await?)
let client = new_client();
Ok(client.get(url).send().await?.json().await?)
}
async fn get_sensor_data(&self) -> Result<air_filter_types::SensorData, Error> {
let url = format!("{}/state/sensor", self.config.url);
Ok(reqwest::get(url).await?.json().await?)
let client = new_client();
Ok(client.get(url).send().await?.json().await?)
}
}
+2 -1
View File
@@ -4,6 +4,7 @@ use std::net::SocketAddr;
use async_trait::async_trait;
use automation_lib::device::{Device, LuaDeviceCreate};
use automation_lib::lua::traits::PartialUserData;
use automation_lib::reqwest::new_client;
use automation_macro::{Device, LuaDeviceConfig};
use lua_typed::Typed;
use mlua::LuaSerdeExt;
@@ -98,7 +99,7 @@ impl HueBridge {
);
trace!(?flag, flag_id, value, "Sending request to change flag");
let res = reqwest::Client::new()
let res = new_client()
.put(url)
.json(&FlagMessage { flag: value })
.send()
+4 -9
View File
@@ -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) => {
+2 -1
View File
@@ -4,6 +4,7 @@ use std::convert::Infallible;
use async_trait::async_trait;
use automation_lib::device::{Device, LuaDeviceCreate};
use automation_lib::lua::traits::PartialUserData;
use automation_lib::reqwest::new_client;
use automation_macro::{Device, LuaDeviceConfig};
use lua_typed::Typed;
use mlua::LuaSerdeExt;
@@ -143,7 +144,7 @@ impl Ntfy {
let notification = notification.finalize(&self.config.topic);
// Create the request
let res = reqwest::Client::new()
let res = new_client()
.post(self.config.url.clone())
.json(&notification)
.send()