pub enum Event {
    DeviceUpdated {
        device_id: String,
        has_required_attributes: bool,
    },
    NodeUpdated {
        device_id: String,
        node_id: String,
        has_required_attributes: bool,
    },
    PropertyUpdated {
        device_id: String,
        node_id: String,
        property_id: String,
        has_required_attributes: bool,
    },
    PropertyValueChanged {
        device_id: String,
        node_id: String,
        property_id: String,
        value: String,
        fresh: bool,
    },
    Connected,
}
Expand description

An event from a Homie device, either because of a property change or because something new has been discovered.

Variants

DeviceUpdated

Fields

device_id: String
has_required_attributes: bool

A new device has been discovered, or an attribute of the device has been updated.

NodeUpdated

Fields

device_id: String
node_id: String
has_required_attributes: bool

An attribute of a node on a device has been updated.

PropertyUpdated

Fields

device_id: String
node_id: String
property_id: String
has_required_attributes: bool

An attribute of a property on a node has been updated.

PropertyValueChanged

Fields

device_id: String
node_id: String
property_id: String
value: String

The new value.

fresh: bool

Whether the new value is fresh, i.e. it has just been sent by the device, as opposed to being the initial value because the controller just connected to the MQTT broker.

The value of a property has changed.

Connected

Connected to the MQTT broker. This could be either the initial connection or a reconnection after the connection was dropped for some reason.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.