Improved the internals of the LuaDeviceConfig macro and improve the

usability of the macro
This commit is contained in:
2024-04-26 04:53:45 +02:00
parent dc3a7e5407
commit e7fb8bfb8d
16 changed files with 226 additions and 274 deletions

View File

@@ -9,7 +9,6 @@ use crate::device_manager::DeviceConfig;
use crate::devices::Device;
use crate::error::DeviceConfigError;
use crate::event::{OnDarkness, OnPresence};
use crate::helper::Ipv4SocketAddr;
#[derive(Debug)]
pub enum Flag {
@@ -25,7 +24,7 @@ pub struct FlagIDs {
#[derive(Debug, LuaDeviceConfig, Clone)]
pub struct HueBridgeConfig {
#[device_config(rename = "ip", with = "Ipv4SocketAddr<80>")]
#[device_config(rename("ip"), with(|ip| SocketAddr::new(ip, 80)))]
pub addr: SocketAddr,
pub login: String,
pub flags: FlagIDs,