feat!: ActionCallback can now receive any amount of arguments

ActionCallback now only has one generics argument that has to implement
IntoLuaMulti, this makes ActionCallback much more flexible as it no
longer always requires two arguments.
This commit is contained in:
2025-09-08 03:30:01 +02:00
parent 352654107a
commit 5383e7265d
10 changed files with 71 additions and 75 deletions

View File

@@ -21,7 +21,7 @@ pub struct Config {
pub threshold: f32,
#[device_config(from_lua, default)]
pub done_callback: ActionCallback<Washer, ()>,
pub done_callback: ActionCallback<Washer>,
#[device_config(from_lua)]
pub client: WrappedAsyncClient,
@@ -109,7 +109,7 @@ impl OnMqtt for Washer {
self.state_mut().await.running = 0;
self.config.done_callback.call(self, &()).await;
self.config.done_callback.call(self.clone()).await;
} else if power < self.config.threshold {
// Prevent false positives
self.state_mut().await.running = 0;