Compare commits

..

7 Commits

Author SHA1 Message Date
203c341863 Removed old presence system
Some checks failed
Build and deploy / Deploy container (push) Blocked by required conditions
Build and deploy / build (push) Has been cancelled
2025-08-31 23:44:02 +02:00
91c35d56fd Move front door presence logic to lua 2025-08-31 23:40:35 +02:00
91971cb795 Handle turning off devices when away through lua 2025-08-31 23:40:35 +02:00
27fe726234 Removed DebugBridge as it no longer served a purpose 2025-08-31 23:40:35 +02:00
2ca5e53706 Moved presence debug mqtt message to lua 2025-08-31 23:40:35 +02:00
52c32e2438 Presence and light sensor call all function in array 2025-08-31 23:40:35 +02:00
4209fb38ce Removed old darkness system 2025-08-31 23:37:44 +02:00
2 changed files with 4 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ use std::fmt::Debug;
use automation_cast::Cast; use automation_cast::Cast;
use dyn_clone::DynClone; use dyn_clone::DynClone;
use google_home::traits::OnOff;
use mlua::ObjectLike; use mlua::ObjectLike;
use crate::event::OnMqtt; use crate::event::OnMqtt;
@@ -17,7 +18,7 @@ pub trait LuaDeviceCreate {
} }
pub trait Device: pub trait Device:
Debug + DynClone + Sync + Send + Cast<dyn google_home::Device> + Cast<dyn OnMqtt> Debug + DynClone + Sync + Send + Cast<dyn google_home::Device> + Cast<dyn OnMqtt> + Cast<dyn OnOff>
{ {
fn get_id(&self) -> String; fn get_id(&self) -> String;
} }

View File

@@ -43,6 +43,7 @@ local on_presence = {
local presence_system = Presence.new({ local presence_system = Presence.new({
topic = mqtt_automation("presence/+/#"), topic = mqtt_automation("presence/+/#"),
client = mqtt_client, client = mqtt_client,
event_channel = automation.device_manager:event_channel(),
callback = function(_, presence) callback = function(_, presence)
for _, f in ipairs(on_presence) do for _, f in ipairs(on_presence) do
if type(f) == "function" then if type(f) == "function" then
@@ -97,6 +98,7 @@ automation.device_manager:add(LightSensor.new({
client = mqtt_client, client = mqtt_client,
min = 22000, min = 22000,
max = 23500, max = 23500,
event_channel = automation.device_manager:event_channel(),
callback = function(_, light) callback = function(_, light)
for _, f in ipairs(on_light) do for _, f in ipairs(on_light) do
if type(f) == "function" then if type(f) == "function" then