//Create public static DeviceFactory CreateDevice(string pluginId) { var df = new DeviceFactory(); var device = new HsDevice { Relationship = ERelationship.Device, Interface = pluginId }; device.Changes.Add(EProperty.Misc, (uint)EMiscFlag.ShowValues); device.Changes.Add(EProperty.UserAccess, "Any"); device.Changes.Add(EProperty.Location2, "Plugin"); device.Changes.Add(EProperty.Location, pluginId); df._device = device; return(df); }
internal NewDeviceData(HsDevice device, List <HsFeature> features) { Device = device.Changes; FeatureData = features?.Select(f => f.Changes).ToList() ?? new List <Dictionary <EProperty, object> >(); }
/// <summary> /// Make a copy of the device with a different unique ID. /// <para> /// This will not duplicate features associated with the device. /// </para> /// </summary> /// <param name="deviceRef">The new unique ID for the copy</param> /// <returns>A copy of the device with a new reference ID</returns> public HsDevice Duplicate(int deviceRef) { var dev = new HsDevice(deviceRef) { _address = Address, _assDevices = AssociatedDevices, _typeInfo = TypeInfo, _image = Image, _interface = Interface, _lastChange = LastChange, _location = Location, _location2 = Location2, _misc = Misc, _name = Name, _plugExtraData = PlugExtraData, _relationship = Relationship, _status = Status, _userAccess = UserAccess, _userNote = UserNote, _value = Value, _voiceCommand = VoiceCommand }; return(dev); }