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

@@ -5,7 +5,7 @@ use std::str::Utf8Error;
use async_trait::async_trait;
use automation_lib::device::{Device, LuaDeviceCreate};
use automation_lib::event::OnPresence;
use automation_macro::{LuaDeviceConfig, impl_device};
use automation_macro::{LuaDevice, LuaDeviceConfig};
use bytes::{Buf, BufMut};
use google_home::errors::{self, DeviceError};
use google_home::traits::OnOff;
@@ -22,11 +22,11 @@ pub struct Config {
pub addr: SocketAddr,
}
#[derive(Debug, Clone)]
#[derive(Debug, Clone, LuaDevice)]
#[traits(OnOff)]
pub struct KasaOutlet {
config: Config,
}
impl_device!(KasaOutlet);
#[async_trait]
impl LuaDeviceCreate for KasaOutlet {