Struct razberry::Device
[−]
[src]
pub struct Device { pub id: String, pub name: String, pub last_contacted: DateTime<UTC>, pub command_classes: HashMap<CommandClasses, CommandClass>, }
A Z-Wave Device.
Fields
id: String
The string (integer?) ID of the device in Z Way.
name: String
The user-defined name of the device; reported as "givenName".
last_contacted: DateTime<UTC>
The last time the device was contacted by the Z Way controller. This is the value of "data.lastReceived.updateTime"
command_classes: HashMap<CommandClasses, CommandClass>
Command classes associated with the device.
Methods
impl Device
[src]
fn initialize_from_json(
device_id: &str,
json: &Json
) -> Result<Device, RazberryError>
device_id: &str,
json: &Json
) -> Result<Device, RazberryError>
Construct a device from a JSON subset taken from the full device payload endpoint, '/ZWaveAPI/Data/'. (This is not the delta update endpoint!)
fn process_updates(
&mut self,
updates: Vec<DeviceUpdate>
) -> Result<(), RazberryError>
&mut self,
updates: Vec<DeviceUpdate>
) -> Result<(), RazberryError>
Update the device from a JSON delta payload taken from the endpoint, '/ZWaveAPI/Data/{timestamp}'.