Compare commits

5 Commits

Author SHA1 Message Date
Dreaded_X 77a32d1507 fix: Use IP instead of dns name
Build and deploy / build (push) Successful in 18m24s
Build and deploy / Deploy container (push) Successful in 41s
For some reason DNS resolution does not work properly, so we are going
to use the printers IP address for now.
2026-06-20 05:51:22 +02:00
Dreaded_X ce302b148e feat: Sync printer light with room light
Build and deploy / build (push) Successful in 18m22s
Build and deploy / Deploy container (push) Successful in 39s
2026-06-20 05:22:59 +02:00
Dreaded_X fe6b3b52e1 feat: Add basic support for bambu printer 2026-06-20 05:22:57 +02:00
Dreaded_X 361d799377 feat: Build fully static binary 2026-06-20 05:22:56 +02:00
Dreaded_X d353fa9759 fix: MQTT broke after internal domain change
Build and deploy / build (push) Successful in 14m8s
Build and deploy / Deploy container (push) Successful in 5m38s
2026-06-19 03:46:26 +02:00
8 changed files with 19 additions and 8 deletions
+3
View File
@@ -1,2 +1,5 @@
[env]
RUST_LOG = "automation=debug"
[target.x86_64-unknown-linux-musl]
rustflags = ["-C", "link-arg=-lc"]
+2
View File
@@ -2,3 +2,5 @@
.env
# Use the rust environment provided by the container
rust-toolchain.toml
Dockerfile
docker-bake.hcl
+2
View File
@@ -41,6 +41,8 @@ jobs:
-e AUTOMATION__SECRETS__MQTT_PASSWORD=${{ secrets.MQTT_PASSWORD }} \
-e AUTOMATION__SECRETS__HUE_TOKEN=${{ secrets.HUE_TOKEN }} \
-e AUTOMATION__SECRETS__NTFY_TOPIC=${{ secrets.NTFY_TOPIC }} \
-e AUTOMATION__SECRETS__PRINTER_DEVICE_ID=${{ secrets.PRINTER_DEVICE_ID }} \
-e AUTOMATION__SECRETS__PRINTER_ACCESS_CODE=${{ secrets.PRINTER_ACCESS_CODE }} \
$(echo ${{ toJSON(needs.build.outputs.images) }} | jq .automation -r)
docker network connect web automation_rs
+4 -3
View File
@@ -1,5 +1,4 @@
FROM rust:1.95 AS base
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
FROM rust:1.95-alpine AS base
RUN cargo install cargo-chef --locked --version 0.1.71 && \
cargo install cargo-auditable --locked --version 0.6.6
WORKDIR /app
@@ -10,6 +9,7 @@ COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM base AS builder
RUN apk add --no-cache g++=15.2.0-r2 cmake=4.1.3-r0 make=4.4.1-r3 openssl-dev=3.5.7-r0 openssl-libs-static=3.5.7-r0
# HACK: Now we can use unstable feature while on stable rust!
ENV RUSTC_BOOTSTRAP=1
COPY --from=planner /app/recipe.json recipe.json
@@ -20,7 +20,8 @@ ARG RELEASE_VERSION
ENV RELEASE_VERSION=${RELEASE_VERSION}
RUN cargo auditable build --release
FROM gcr.io/distroless/cc-debian13:nonroot AS runtime
FROM gcr.io/distroless/static-debian13:nonroot AS runtime
COPY --from=builder /app/target/release/automation /app/automation
ENV AUTOMATION__ENTRYPOINT=/app/config/config.lua
ENV LUA_PATH="/app/?.lua;;"
+2 -1
View File
@@ -12,7 +12,7 @@ use bambulab::{Command, Message};
use google_home::errors::{self};
use google_home::traits::OnOff;
use lua_typed::Typed;
use tracing::trace;
use tracing::{debug, trace};
use crate::{DebugWrap, LuaDeviceCreate};
@@ -104,6 +104,7 @@ impl LuaDeviceCreate for Bambu {
bambu.config.callbacks.state.call(bambu.clone()).await;
}
Message::Connected => {
debug!(id = bambu.config.device_id, "Connected");
client.publish(Command::PushAll).await.unwrap();
bambu.config.callbacks.connected.call(bambu.clone()).await;
+2 -2
View File
@@ -10,12 +10,12 @@ return {
openid_url = "https://login.huizinga.dev/api/oidc",
},
mqtt = {
host = ((host == "zeus" or host == "hephaestus") and "olympus.lan.huizinga.dev") or "mosquitto",
host = ((host == "zeus" or host == "hephaestus") and "olympus.huizinga.lan") or "mosquitto",
port = 8883,
client_name = "automation-" .. host,
username = "mqtt",
password = secrets.mqtt_password,
tls = host == "zeus" or host == "hephaestus",
tls = false,
},
modules = {
require("config.battery"),
+1 -1
View File
@@ -13,7 +13,7 @@ function module.setup(mqtt_client)
local light = nil
local bambu = devices.Bambu.new({
host = "thalia.huizinga.lan",
host = "10.0.0.108",
device_id = secrets.printer_device_id,
access_code = secrets.printer_access_code,
callbacks = {
+3 -1
View File
@@ -5,7 +5,9 @@ group "default" {
targets = ["automation"]
}
target "docker-metadata-action" {}
target "docker-metadata-action" {
tags = []
}
target "automation" {
inherits = ["docker-metadata-action"]