Exemplo n.º 1
0
        //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);
        }
Exemplo n.º 2
0
 internal NewDeviceData(HsDevice device, List <HsFeature> features)
 {
     Device      = device.Changes;
     FeatureData = features?.Select(f => f.Changes).ToList() ?? new List <Dictionary <EProperty, object> >();
 }
Exemplo n.º 3
-1
        /// <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);
        }