Handle turning off devices when away through lua

This commit is contained in:
2025-08-31 22:10:41 +02:00
parent fefccf03d7
commit 74568b4e1f
5 changed files with 31 additions and 54 deletions

View File

@@ -3,7 +3,6 @@ use std::net::SocketAddr;
use async_trait::async_trait;
use automation_lib::device::{Device, LuaDeviceCreate};
use automation_lib::event::OnPresence;
use automation_lib::lua::traits::AddAdditionalMethods;
use automation_macro::{LuaDevice, LuaDeviceConfig};
use mlua::LuaSerdeExt;
@@ -110,11 +109,3 @@ impl AddAdditionalMethods for HueBridge {
);
}
}
#[async_trait]
impl OnPresence for HueBridge {
async fn on_presence(&self, presence: bool) {
trace!("Bridging presence to hue");
self.set_flag(Flag::Presence, presence).await;
}
}