diff --git a/homeassistant-mqtt-discovery/src/integrations.rs b/homeassistant-mqtt-discovery/src/integrations.rs index 569e04f..57795f0 100644 --- a/homeassistant-mqtt-discovery/src/integrations.rs +++ b/homeassistant-mqtt-discovery/src/integrations.rs @@ -1,11 +1,16 @@ -mod alarm_control_panel { - #[derive(Debug, PartialEq, Eq, Clone)] - #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] - struct Discovery { - /// The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`. - #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))] - pub availability_topic: Option, +use crate::{Device, Template}; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; +// TODO: +pub type Icon = (); + +pub mod alarm_control_panel { + use super::*; + + #[derive(Debug, PartialEq, Clone)] + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + pub struct Discovery { /// If defined, specifies a code to enable or disable the alarm in the frontend. Note that the code is validated locally and blocks sending MQTT messages to the remote device. For remote code validation, the code can be configured to either of the special values `REMOTE_CODE` (numeric code) or `REMOTE_CODE_TEXT` (text code). In this case, local code validation is bypassed but the frontend will still show a numeric or text code dialog. Use `command_template` to send the code to the remote device. Example configurations for remote code validation [can be found here](#configurations-with-remote-code-validation). #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))] pub code: Option, @@ -112,41 +117,17 @@ mod alarm_control_panel { #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))] pub supported_features: Option>, - #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))] - pub unique_id: Option, - /// Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the value. #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))] pub value_template: Option