Compare commits
5 Commits
db2170b84e
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
77a32d1507
|
|||
|
ce302b148e
|
|||
|
fe6b3b52e1
|
|||
|
361d799377
|
|||
|
d353fa9759
|
@@ -41,6 +41,8 @@ jobs:
|
|||||||
-e AUTOMATION__SECRETS__MQTT_PASSWORD=${{ secrets.MQTT_PASSWORD }} \
|
-e AUTOMATION__SECRETS__MQTT_PASSWORD=${{ secrets.MQTT_PASSWORD }} \
|
||||||
-e AUTOMATION__SECRETS__HUE_TOKEN=${{ secrets.HUE_TOKEN }} \
|
-e AUTOMATION__SECRETS__HUE_TOKEN=${{ secrets.HUE_TOKEN }} \
|
||||||
-e AUTOMATION__SECRETS__NTFY_TOPIC=${{ secrets.NTFY_TOPIC }} \
|
-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)
|
$(echo ${{ toJSON(needs.build.outputs.images) }} | jq .automation -r)
|
||||||
|
|
||||||
docker network connect web automation_rs
|
docker network connect web automation_rs
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ ENV RELEASE_VERSION=${RELEASE_VERSION}
|
|||||||
RUN cargo auditable build --release
|
RUN cargo auditable build --release
|
||||||
|
|
||||||
|
|
||||||
FROM scratch AS runtime
|
FROM gcr.io/distroless/static-debian13:nonroot AS runtime
|
||||||
COPY --from=builder /app/target/release/automation /app/automation
|
COPY --from=builder /app/target/release/automation /app/automation
|
||||||
ENV AUTOMATION__ENTRYPOINT=/app/config/config.lua
|
ENV AUTOMATION__ENTRYPOINT=/app/config/config.lua
|
||||||
ENV LUA_PATH="/app/?.lua;;"
|
ENV LUA_PATH="/app/?.lua;;"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ use bambulab::{Command, Message};
|
|||||||
use google_home::errors::{self};
|
use google_home::errors::{self};
|
||||||
use google_home::traits::OnOff;
|
use google_home::traits::OnOff;
|
||||||
use lua_typed::Typed;
|
use lua_typed::Typed;
|
||||||
use tracing::trace;
|
use tracing::{debug, trace};
|
||||||
|
|
||||||
use crate::{DebugWrap, LuaDeviceCreate};
|
use crate::{DebugWrap, LuaDeviceCreate};
|
||||||
|
|
||||||
@@ -104,6 +104,7 @@ impl LuaDeviceCreate for Bambu {
|
|||||||
bambu.config.callbacks.state.call(bambu.clone()).await;
|
bambu.config.callbacks.state.call(bambu.clone()).await;
|
||||||
}
|
}
|
||||||
Message::Connected => {
|
Message::Connected => {
|
||||||
|
debug!(id = bambu.config.device_id, "Connected");
|
||||||
client.publish(Command::PushAll).await.unwrap();
|
client.publish(Command::PushAll).await.unwrap();
|
||||||
|
|
||||||
bambu.config.callbacks.connected.call(bambu.clone()).await;
|
bambu.config.callbacks.connected.call(bambu.clone()).await;
|
||||||
|
|||||||
+2
-2
@@ -10,12 +10,12 @@ return {
|
|||||||
openid_url = "https://login.huizinga.dev/api/oidc",
|
openid_url = "https://login.huizinga.dev/api/oidc",
|
||||||
},
|
},
|
||||||
mqtt = {
|
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,
|
port = 8883,
|
||||||
client_name = "automation-" .. host,
|
client_name = "automation-" .. host,
|
||||||
username = "mqtt",
|
username = "mqtt",
|
||||||
password = secrets.mqtt_password,
|
password = secrets.mqtt_password,
|
||||||
tls = host == "zeus" or host == "hephaestus",
|
tls = false,
|
||||||
},
|
},
|
||||||
modules = {
|
modules = {
|
||||||
require("config.battery"),
|
require("config.battery"),
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ function module.setup(mqtt_client)
|
|||||||
local light = nil
|
local light = nil
|
||||||
|
|
||||||
local bambu = devices.Bambu.new({
|
local bambu = devices.Bambu.new({
|
||||||
host = "thalia.huizinga.lan",
|
host = "10.0.0.108",
|
||||||
device_id = secrets.printer_device_id,
|
device_id = secrets.printer_device_id,
|
||||||
access_code = secrets.printer_access_code,
|
access_code = secrets.printer_access_code,
|
||||||
callbacks = {
|
callbacks = {
|
||||||
|
|||||||
Reference in New Issue
Block a user