Fixed visibility of device configs
This commit is contained in:
parent
2b62aca78a
commit
0b31b2e443
|
@ -18,11 +18,11 @@ use crate::mqtt::WrappedAsyncClient;
|
|||
#[derive(Debug, Clone, LuaDeviceConfig)]
|
||||
pub struct AirFilterConfig {
|
||||
#[device_config(flatten)]
|
||||
info: InfoConfig,
|
||||
pub info: InfoConfig,
|
||||
#[device_config(flatten)]
|
||||
mqtt: MqttDeviceConfig,
|
||||
pub mqtt: MqttDeviceConfig,
|
||||
#[device_config(from_lua)]
|
||||
client: WrappedAsyncClient,
|
||||
pub client: WrappedAsyncClient,
|
||||
}
|
||||
|
||||
#[derive(Debug, LuaDevice)]
|
||||
|
|
|
@ -14,15 +14,15 @@ use crate::mqtt::WrappedAsyncClient;
|
|||
|
||||
#[derive(Debug, Clone, LuaDeviceConfig)]
|
||||
pub struct AudioSetupConfig {
|
||||
identifier: String,
|
||||
pub identifier: String,
|
||||
#[device_config(flatten)]
|
||||
mqtt: MqttDeviceConfig,
|
||||
pub mqtt: MqttDeviceConfig,
|
||||
#[device_config(from_lua)]
|
||||
mixer: WrappedDevice,
|
||||
pub mixer: WrappedDevice,
|
||||
#[device_config(from_lua)]
|
||||
speakers: WrappedDevice,
|
||||
pub speakers: WrappedDevice,
|
||||
#[device_config(from_lua)]
|
||||
client: WrappedAsyncClient,
|
||||
pub client: WrappedAsyncClient,
|
||||
}
|
||||
|
||||
#[derive(Debug, LuaDevice)]
|
||||
|
|
|
@ -44,22 +44,22 @@ impl From<TriggerDevicesHelper> for Vec<(WrappedDevice, bool)> {
|
|||
#[derive(Debug, Clone, LuaDeviceConfig)]
|
||||
pub struct TriggerConfig {
|
||||
#[device_config(from_lua, from(TriggerDevicesHelper))]
|
||||
devices: Vec<(WrappedDevice, bool)>,
|
||||
pub devices: Vec<(WrappedDevice, bool)>,
|
||||
#[device_config(default, with(|t: Option<_>| t.map(Duration::from_secs)))]
|
||||
pub timeout: Option<Duration>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, LuaDeviceConfig)]
|
||||
pub struct ContactSensorConfig {
|
||||
identifier: String,
|
||||
pub identifier: String,
|
||||
#[device_config(flatten)]
|
||||
mqtt: MqttDeviceConfig,
|
||||
pub mqtt: MqttDeviceConfig,
|
||||
#[device_config(from_lua)]
|
||||
presence: Option<PresenceDeviceConfig>,
|
||||
pub presence: Option<PresenceDeviceConfig>,
|
||||
#[device_config(from_lua)]
|
||||
trigger: Option<TriggerConfig>,
|
||||
pub trigger: Option<TriggerConfig>,
|
||||
#[device_config(from_lua)]
|
||||
client: WrappedAsyncClient,
|
||||
pub client: WrappedAsyncClient,
|
||||
}
|
||||
|
||||
#[derive(Debug, LuaDevice)]
|
||||
|
|
|
@ -13,11 +13,11 @@ use crate::mqtt::WrappedAsyncClient;
|
|||
|
||||
#[derive(Debug, LuaDeviceConfig, Clone)]
|
||||
pub struct DebugBridgeConfig {
|
||||
identifier: String,
|
||||
pub identifier: String,
|
||||
#[device_config(flatten)]
|
||||
pub mqtt: MqttDeviceConfig,
|
||||
#[device_config(from_lua)]
|
||||
client: WrappedAsyncClient,
|
||||
pub client: WrappedAsyncClient,
|
||||
}
|
||||
|
||||
#[derive(Debug, LuaDevice)]
|
||||
|
|
|
@ -18,8 +18,8 @@ pub enum Flag {
|
|||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct FlagIDs {
|
||||
pub presence: isize,
|
||||
pub darkness: isize,
|
||||
presence: isize,
|
||||
darkness: isize,
|
||||
}
|
||||
|
||||
#[derive(Debug, LuaDeviceConfig, Clone)]
|
||||
|
|
|
@ -18,7 +18,7 @@ use crate::traits::Timeout;
|
|||
|
||||
#[derive(Debug, Clone, LuaDeviceConfig)]
|
||||
pub struct HueGroupConfig {
|
||||
identifier: String,
|
||||
pub identifier: String,
|
||||
#[device_config(rename("ip"), with(|ip| SocketAddr::new(ip, 80)))]
|
||||
pub addr: SocketAddr,
|
||||
pub login: String,
|
||||
|
@ -28,7 +28,7 @@ pub struct HueGroupConfig {
|
|||
#[device_config(default)]
|
||||
pub remotes: Vec<MqttDeviceConfig>,
|
||||
#[device_config(from_lua)]
|
||||
client: WrappedAsyncClient,
|
||||
pub client: WrappedAsyncClient,
|
||||
}
|
||||
|
||||
#[derive(Debug, LuaDevice)]
|
||||
|
|
|
@ -31,18 +31,18 @@ pub enum OutletType {
|
|||
#[derive(Debug, Clone, LuaDeviceConfig)]
|
||||
pub struct IkeaOutletConfig {
|
||||
#[device_config(flatten)]
|
||||
info: InfoConfig,
|
||||
pub info: InfoConfig,
|
||||
#[device_config(flatten)]
|
||||
mqtt: MqttDeviceConfig,
|
||||
pub mqtt: MqttDeviceConfig,
|
||||
#[device_config(default(OutletType::Outlet))]
|
||||
outlet_type: OutletType,
|
||||
pub outlet_type: OutletType,
|
||||
#[device_config(default, with(|t: Option<_>| t.map(Duration::from_secs)))]
|
||||
timeout: Option<Duration>,
|
||||
pub timeout: Option<Duration>,
|
||||
#[device_config(default)]
|
||||
pub remotes: Vec<MqttDeviceConfig>,
|
||||
|
||||
#[device_config(from_lua)]
|
||||
client: WrappedAsyncClient,
|
||||
pub client: WrappedAsyncClient,
|
||||
}
|
||||
|
||||
#[derive(Debug, LuaDevice)]
|
||||
|
|
|
@ -17,9 +17,9 @@ use super::{Device, LuaDeviceCreate};
|
|||
|
||||
#[derive(Debug, Clone, LuaDeviceConfig)]
|
||||
pub struct KasaOutletConfig {
|
||||
identifier: String,
|
||||
pub identifier: String,
|
||||
#[device_config(rename("ip"), with(|ip| SocketAddr::new(ip, 9999)))]
|
||||
addr: SocketAddr,
|
||||
pub addr: SocketAddr,
|
||||
}
|
||||
|
||||
#[derive(Debug, LuaDevice)]
|
||||
|
|
|
@ -12,7 +12,7 @@ use crate::mqtt::WrappedAsyncClient;
|
|||
|
||||
#[derive(Debug, Clone, LuaDeviceConfig)]
|
||||
pub struct LightSensorConfig {
|
||||
identifier: String,
|
||||
pub identifier: String,
|
||||
#[device_config(flatten)]
|
||||
pub mqtt: MqttDeviceConfig,
|
||||
pub min: isize,
|
||||
|
@ -20,10 +20,10 @@ pub struct LightSensorConfig {
|
|||
#[device_config(rename("event_channel"), from_lua, with(|ec: EventChannel| ec.get_tx()))]
|
||||
pub tx: event::Sender,
|
||||
#[device_config(from_lua)]
|
||||
client: WrappedAsyncClient,
|
||||
pub client: WrappedAsyncClient,
|
||||
}
|
||||
|
||||
pub const DEFAULT: bool = false;
|
||||
const DEFAULT: bool = false;
|
||||
|
||||
#[derive(Debug, LuaDevice)]
|
||||
pub struct LightSensor {
|
||||
|
|
|
@ -35,9 +35,9 @@ pub enum ActionType {
|
|||
#[derive(Debug, Serialize, Clone)]
|
||||
pub struct Action {
|
||||
#[serde(flatten)]
|
||||
action: ActionType,
|
||||
label: String,
|
||||
clear: Option<bool>,
|
||||
pub action: ActionType,
|
||||
pub label: String,
|
||||
pub clear: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
|
@ -114,10 +114,10 @@ impl Default for Notification {
|
|||
#[derive(Debug, LuaDeviceConfig)]
|
||||
pub struct NtfyConfig {
|
||||
#[device_config(default("https://ntfy.sh".into()))]
|
||||
url: String,
|
||||
topic: String,
|
||||
pub url: String,
|
||||
pub topic: String,
|
||||
#[device_config(rename("event_channel"), from_lua, with(|ec: EventChannel| ec.get_tx()))]
|
||||
tx: event::Sender,
|
||||
pub tx: event::Sender,
|
||||
}
|
||||
|
||||
#[derive(Debug, LuaDevice)]
|
||||
|
|
|
@ -17,9 +17,9 @@ pub struct PresenceConfig {
|
|||
#[device_config(flatten)]
|
||||
pub mqtt: MqttDeviceConfig,
|
||||
#[device_config(from_lua, rename("event_channel"), with(|ec: EventChannel| ec.get_tx()))]
|
||||
tx: event::Sender,
|
||||
pub tx: event::Sender,
|
||||
#[device_config(from_lua)]
|
||||
client: WrappedAsyncClient,
|
||||
pub client: WrappedAsyncClient,
|
||||
}
|
||||
|
||||
pub const DEFAULT_PRESENCE: bool = false;
|
||||
|
|
|
@ -19,14 +19,14 @@ use crate::mqtt::WrappedAsyncClient;
|
|||
#[derive(Debug, Clone, LuaDeviceConfig)]
|
||||
pub struct WakeOnLANConfig {
|
||||
#[device_config(flatten)]
|
||||
info: InfoConfig,
|
||||
pub info: InfoConfig,
|
||||
#[device_config(flatten)]
|
||||
mqtt: MqttDeviceConfig,
|
||||
mac_address: MacAddress,
|
||||
pub mqtt: MqttDeviceConfig,
|
||||
pub mac_address: MacAddress,
|
||||
#[device_config(default(Ipv4Addr::new(255, 255, 255, 255)))]
|
||||
broadcast_ip: Ipv4Addr,
|
||||
pub broadcast_ip: Ipv4Addr,
|
||||
#[device_config(from_lua)]
|
||||
client: WrappedAsyncClient,
|
||||
pub client: WrappedAsyncClient,
|
||||
}
|
||||
|
||||
#[derive(Debug, LuaDevice)]
|
||||
|
|
|
@ -12,15 +12,15 @@ use crate::mqtt::WrappedAsyncClient;
|
|||
|
||||
#[derive(Debug, Clone, LuaDeviceConfig)]
|
||||
pub struct WasherConfig {
|
||||
identifier: String,
|
||||
pub identifier: String,
|
||||
#[device_config(flatten)]
|
||||
mqtt: MqttDeviceConfig,
|
||||
pub mqtt: MqttDeviceConfig,
|
||||
// Power in Watt
|
||||
threshold: f32,
|
||||
pub threshold: f32,
|
||||
#[device_config(rename("event_channel"), from_lua, with(|ec: EventChannel| ec.get_tx()))]
|
||||
pub tx: event::Sender,
|
||||
#[device_config(from_lua)]
|
||||
client: WrappedAsyncClient,
|
||||
pub client: WrappedAsyncClient,
|
||||
}
|
||||
|
||||
// TODO: Add google home integration
|
||||
|
|
Loading…
Reference in New Issue
Block a user