Devices now keep type in lua
All checks were successful
Build and deploy / Build application (push) Successful in 4m5s
Build and deploy / Build container (push) Successful in 1m9s
Build and deploy / Deploy container (push) Successful in 37s

This commit is contained in:
2024-08-08 01:31:29 +02:00
parent b0467b8012
commit d11e79cdfa
6 changed files with 76 additions and 60 deletions

View File

@@ -10,7 +10,6 @@ use tracing::{debug, error, trace, warn};
use super::{Device, LuaDeviceCreate};
use crate::config::MqttDeviceConfig;
use crate::device_manager::WrappedDevice;
use crate::devices::DEFAULT_PRESENCE;
use crate::error::DeviceConfigError;
use crate::event::{OnMqtt, OnPresence};
@@ -30,7 +29,7 @@ pub struct PresenceDeviceConfig {
#[derive(Debug, Clone, LuaDeviceConfig)]
pub struct TriggerConfig {
#[device_config(from_lua)]
pub devices: Vec<WrappedDevice>,
pub devices: Vec<Box<dyn Device>>,
#[device_config(default, with(|t: Option<_>| t.map(Duration::from_secs)))]
pub timeout: Option<Duration>,
}