Struct homie_controller::Device
source · 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§
source§impl Device
impl Device
sourcepub fn has_required_attributes(&self) -> bool
pub fn has_required_attributes(&self) -> bool
Returns whether all the required attributes of the device and all its nodes and properties are filled in.