pub struct Mqtt {
pub host: String,
pub port: u16,
pub user: String,
pub password: String,
pub registration_prefix: String,
pub update_period: u64,
pub entity: String,
}
Expand description
Contains the configuration for communicating with the MQTT broker
Fields§
§host: String
Hostname or IP address. Default: localhost
port: u16
Port of the connection to the broker. Default: 1883
user: String
Username for the connection to the broker. Default: empty
password: String
Password for the connection to the broker. Default: empty
registration_prefix: String
Prefix for the registration topic sent to Home Assistant. Default: homeassistant
This must match the configuration of the MQTT integration in Home Assistant
See https://www.home-assistant.io/integrations/mqtt#discovery-options
update_period: u64
Delay between each sensor report in seconds. Default: 10 seconds
entity: String
Name of the device entity. It should be unique in Home Assistant. Default: machine hostname
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Mqtt
impl<'de> Deserialize<'de> for Mqtt
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Mqtt
impl RefUnwindSafe for Mqtt
impl Send for Mqtt
impl Sync for Mqtt
impl Unpin for Mqtt
impl UnwindSafe for Mqtt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more