Compare commits

..

5 Commits

Author SHA1 Message Date
Dreaded_X 64c4a47c6f feat: Use ActionCallback for schedule
Build and deploy / build (push) Successful in 11m12s
Build and deploy / Deploy container (push) Has been skipped
This has two advantages:
- Each schedule entry can take either a single function or table of
  functions.
- We get a better type definition.
2025-10-19 02:43:24 +02:00
Dreaded_X 92a0bff8c4 refactor(config)!: Move scheduler out of device_manager
Build and deploy / build (push) Successful in 10m5s
Build and deploy / Deploy container (push) Has been skipped
Due to changes made in mlua the new scheduler is much simpler. It also
had no real business being part of the device manager, so it has now been
moved to be part of the returned config.
2025-10-17 04:31:27 +02:00
Dreaded_X 187220a49b feat: Receive devices through config return 2025-10-17 04:00:34 +02:00
Dreaded_X 4e2da2ecca feat: Ensure consistent ordering device definitions 2025-10-17 03:57:33 +02:00
Dreaded_X 65c7ed6349 feat: Generate definitions for config
Build and deploy / build (push) Successful in 9m15s
Build and deploy / Deploy container (push) Has been skipped
2025-10-17 03:15:27 +02:00
2 changed files with 3 additions and 6 deletions
+2 -5
View File
@@ -27,7 +27,7 @@ impl mlua::FromLua for Box<dyn Device> {
fn from_lua(value: mlua::Value, _lua: &mlua::Lua) -> mlua::Result<Self> {
match value {
mlua::Value::UserData(ud) => {
let ud = if ud.is::<Self>() {
let ud = if ud.is::<Box<dyn Device>>() {
ud
} else {
ud.call_method::<_>("__box", ())?
@@ -36,10 +36,7 @@ impl mlua::FromLua for Box<dyn Device> {
let b = ud.borrow::<Self>()?.clone();
Ok(b)
}
_ => Err(mlua::Error::runtime(format!(
"Expected user data, instead found: {}",
value.type_name()
))),
_ => Err(mlua::Error::RuntimeError("Expected user data".into())),
}
}
}
+1 -1
View File
@@ -32,7 +32,7 @@ fn config_definitions() -> String {
output +=
&FulfillmentConfig::generate_full().expect("FulfillmentConfig should have a definition");
output += "\n";
output += &Config::generate_full().expect("Config should have a definition");
output += &Config::generate_full().expect("FulfillmentConfig should have a definition");
output
}