use crate::commands::property_control::PropertyControlCommand; /// Returns a PropertyControl command. impl Into> for PropertyControlCommand { fn into(self) -> Vec { match self { PropertyControlCommand::Register { property_name, data_type, read_only } => { let mut vec = vec![]; vec.extend(property_name.into_bytes()); vec.push(data_type); vec.push(read_only as u8); vec }, PropertyControlCommand::Remove { property_name } => property_name.into_bytes(), PropertyControlCommand::Get { property_name, data } => { let mut v = vec![]; v.extend(property_name.into_bytes()); v.extend(Into::>::into(data)); v }, PropertyControlCommand::Set { property_name, data } => { let mut v = vec![]; v.extend(property_name.into_bytes()); v.extend(Into::>::into(data)); v }, PropertyControlCommand::Reset { property_name } => property_name.into_bytes(), PropertyControlCommand::Subscribe { device_id, property_name } => { let mut v = vec![]; v.extend(device_id.bytes); v.extend(property_name.into_bytes()); v }, PropertyControlCommand::Unsubscribe { device_id, property_name } => { let mut v = vec![]; v.extend(device_id.bytes); v.extend(property_name.into_bytes()); v } } } }