Converted macro to derive macro

This commit is contained in:
2025-08-30 04:20:27 +02:00
parent d2b01123b8
commit 5d342afb1f
17 changed files with 108 additions and 97 deletions

View File

@@ -7,7 +7,7 @@ use automation_lib::event::{self, Event, EventChannel, OnMqtt};
use automation_lib::messages::PowerMessage;
use automation_lib::mqtt::WrappedAsyncClient;
use automation_lib::ntfy::{Notification, Priority};
use automation_macro::{LuaDeviceConfig, impl_device};
use automation_macro::{LuaDevice, LuaDeviceConfig};
use rumqttc::Publish;
use tokio::sync::{RwLock, RwLockReadGuard, RwLockWriteGuard};
use tracing::{debug, error, trace, warn};
@@ -31,12 +31,11 @@ pub struct State {
}
// TODO: Add google home integration
#[derive(Debug, Clone)]
#[derive(Debug, Clone, LuaDevice)]
pub struct Washer {
config: Config,
state: Arc<RwLock<State>>,
}
impl_device!(Washer);
impl Washer {
async fn state(&self) -> RwLockReadGuard<'_, State> {