pub struct PayloadDevice {
pub id: String,
pub device_type: Type,
pub traits: Vec<Trait>,
pub name: PayloadDeviceName,
pub will_report_state: bool,
pub notification_supported_by_agent: bool,
pub room_hint: Option<String>,
pub device_info: Option<PayloadDeviceInfo>,
pub attributes: Attributes,
pub custom_data: Option<Map<String, Value>>,
pub other_device_ids: Option<Vec<PayloadOtherDeviceID>>,
}Expand description
Device execution result.
Fields§
§id: StringThe ID of the device in the developer’s cloud. This must be unique for the user and for the developer, as in cases of sharing we may use this to dedupe multiple views of the same device. It should be immutable for the device; if it changes, the Assistant will treat it as a new device.
device_type: TypeThe hardware type of device.
traits: Vec<Trait>List of traits this device has. This defines the commands, attributes, and states that the device supports.
name: PayloadDeviceNameNames of this device.
will_report_state: boolIndicates whether this device will have its states updated by the Real Time Feed. true to use the Real Time Feed for reporting state, and false to use the polling model.
notification_supported_by_agent: boolIndicates whether notifications are enabled for the device.
room_hint: Option<String>Provides the current room of the device in the user’s home to simplify setup.
device_info: Option<PayloadDeviceInfo>Contains fields describing the device for use in one-off logic if needed (e.g. ‘broken firmware version X of light Y requires adjusting color’, or ‘security flaw requires notifying all users of firmware Z’).
attributes: AttributesAligned with per-trait attributes described in each trait schema reference.
custom_data: Option<Map<String, Value>>Object defined by the developer which will be attached to future QUERY and EXECUTE requests, maximum of 512 bytes per device. Use this object to store additional information about the device your cloud service may need, such as the global region of the device. Data in this object has a few constraints: No sensitive information, including but not limited to Personally Identifiable Information.
other_device_ids: Option<Vec<PayloadOtherDeviceID>>List of alternate IDs used to identify a cloud synced device for local execution.
Trait Implementations§
Source§impl Clone for PayloadDevice
impl Clone for PayloadDevice
Source§fn clone(&self) -> PayloadDevice
fn clone(&self) -> PayloadDevice
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more