ActionCallback now always returns self and state can be anything serializable

This commit is contained in:
2024-12-08 02:50:52 +01:00
parent eefb476d7f
commit 41d2af655b
7 changed files with 40 additions and 29 deletions

View File

@@ -24,7 +24,7 @@ pub struct Config {
pub client: WrappedAsyncClient,
#[device_config(from_lua)]
pub callback: ActionCallback<bool>,
pub callback: ActionCallback<IkeaRemote, bool>,
}
#[derive(Debug, Clone)]
@@ -84,7 +84,7 @@ impl OnMqtt for IkeaRemote {
};
if let Some(on) = on {
self.config.callback.call(on).await;
self.config.callback.call(self, &on).await;
}
}
}