pub struct Device {
Show 19 fields pub id: String, pub homie_version: String, pub name: Option<String>, pub state: State, pub implementation: Option<String>, pub nodes: HashMap<String, Node>, pub extensions: Vec<Extension>, pub local_ip: Option<String>, pub mac: Option<String>, pub firmware_name: Option<String>, pub firmware_version: Option<String>, pub stats_interval: Option<Duration>, pub stats_uptime: Option<Duration>, pub stats_signal: Option<i64>, pub stats_cputemp: Option<f64>, pub stats_cpuload: Option<i64>, pub stats_battery: Option<i64>, pub stats_freeheap: Option<u64>, pub stats_supply: Option<f64>,
}
Expand description

A Homie device which has been discovered.

The id, homie_version, name and state are required, but might not be available immediately when the device is first discovered. The implementation is optional.

Fields

id: String

The subtopic ID of the device. This is unique per Homie base topic, and should follow the Homie ID format.

homie_version: String

The version of the Homie convention which the device implements.

name: Option<String>

The human-readable name of the device. This is a required attribute, but might not be available as soon as the device is first discovered.

state: State

The current state of the device according to the Homie device lifecycle.

implementation: Option<String>

An identifier for the Homie implementation which the device uses.

nodes: HashMap<String, Node>

The nodes of the device, keyed by their IDs.

extensions: Vec<Extension>

The Homie extensions implemented by the device.

local_ip: Option<String>

The IP address of the device on the local network.

mac: Option<String>

The MAC address of the device’s network interface.

firmware_name: Option<String>

The name of the firmware running on the device.

firmware_version: Option<String>

The version of the firware running on the device.

stats_interval: Option<Duration>

The interval at which the device refreshes its stats.

stats_uptime: Option<Duration>

The amount of time since the device booted.

stats_signal: Option<i64>

The device’s signal strength in %.

stats_cputemp: Option<f64>

The device’s CPU temperature in °C.

stats_cpuload: Option<i64>

The device’s CPU load in %, averaged across all CPUs over the last stats_interval.

stats_battery: Option<i64>

The device’s battery level in %.

stats_freeheap: Option<u64>

The device’s free heap space in bytes.

stats_supply: Option<f64>

The device’s power supply voltage in volts.

Implementations

Returns whether all the required attributes of the device and all its nodes and properties are filled in.

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.