Compare commits

..

6 Commits

Author SHA1 Message Date
Dreaded_X 88a7acd55d feat: Improved device conversion error message
Build and deploy / build (push) Successful in 10m37s
Build and deploy / Deploy container (push) Has been skipped
2025-10-19 03:40:16 +02:00
Dreaded_X 3b7579878b feat: Use ActionCallback for schedule
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 03:40:16 +02:00
Dreaded_X 46c32c3605 refactor(config)!: Move scheduler out of device_manager
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-19 03:40:16 +02:00
Dreaded_X d1e7988117 feat: Receive devices through config return 2025-10-19 03:40:15 +02:00
Dreaded_X 93b0a526b1 feat: Ensure consistent ordering device definitions 2025-10-19 03:40:15 +02:00
Dreaded_X 7bb5e65c1c feat: Generate definitions for config 2025-10-19 03:40:15 +02:00
2 changed files with 6 additions and 3 deletions
+5 -2
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::<Box<dyn Device>>() {
let ud = if ud.is::<Self>() {
ud
} else {
ud.call_method::<_>("__box", ())?
@@ -36,7 +36,10 @@ impl mlua::FromLua for Box<dyn Device> {
let b = ud.borrow::<Self>()?.clone();
Ok(b)
}
_ => Err(mlua::Error::RuntimeError("Expected user data".into())),
_ => Err(mlua::Error::runtime(format!(
"Expected user data, instead found: {}",
value.type_name()
))),
}
}
}
+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("FulfillmentConfig should have a definition");
output += &Config::generate_full().expect("Config should have a definition");
output
}