Made the impl_device macro more explicit about the implemented traits
This also converts impl_device into a procedural macro and get rid of a lot of "magic" that was happening.
This commit is contained in:
@@ -4,7 +4,7 @@ use automation_lib::config::{InfoConfig, MqttDeviceConfig};
|
||||
use automation_lib::device::{Device, LuaDeviceCreate};
|
||||
use automation_lib::event::OnMqtt;
|
||||
use automation_lib::mqtt::WrappedAsyncClient;
|
||||
use automation_macro::LuaDeviceConfig;
|
||||
use automation_macro::{LuaDeviceConfig, impl_device};
|
||||
use rumqttc::{Publish, matches};
|
||||
use serde::Deserialize;
|
||||
use tracing::{debug, trace, warn};
|
||||
@@ -55,6 +55,7 @@ struct State {
|
||||
pub struct HueSwitch {
|
||||
config: Config,
|
||||
}
|
||||
impl_device!(HueSwitch);
|
||||
|
||||
impl Device for HueSwitch {
|
||||
fn get_id(&self) -> String {
|
||||
|
||||
Reference in New Issue
Block a user