Exemplo n.º 1
0
        public CreateTemplateCode CreateNodeTemplate(Guid uid, string name, string description, string key,
                                                     Guid needsInterface,
                                                     Guid providesInterface, bool defaultCreated, bool isReadable, bool isReadableFixed, bool isWriteable,
                                                     bool isWriteableFixed, NodeDataType dataType, int maxInstances, bool isAdapterInterface, bool deleteAble)
        {
            var nodeTemplate = new NodeTemplate {
                ObjId = uid
            };

            nodeTemplate.Name        = name;
            nodeTemplate.Description = description;
            nodeTemplate.Key         = key;
            nodeTemplate.NeedsInterface2InterfacesType   = needsInterface;
            nodeTemplate.ProvidesInterface2InterfaceType = providesInterface;
            nodeTemplate.DefaultCreated     = defaultCreated;
            nodeTemplate.IsReadable         = isReadable;
            nodeTemplate.IsReadableFixed    = isReadableFixed;
            nodeTemplate.IsWriteable        = isWriteable;
            nodeTemplate.IsWriteableFixed   = isWriteableFixed;
            nodeTemplate.This2NodeDataType  = (long)dataType;
            nodeTemplate.MaxInstances       = maxInstances;
            nodeTemplate.IsAdapterInterface = isAdapterInterface;
            nodeTemplate.IsDeleteable       = deleteAble;

            if (!_nodeTemplates.ContainsKey(uid))
            {
                _nodeTemplates.Add(uid, nodeTemplate);
            }

            return(CreateTemplateCode.Created);
        }
Exemplo n.º 2
0
 public CreateTemplateCode CreateNodeTemplate(Guid uid, string name, string description, string key, Guid needsInterface,
                                              Guid providesInterface, bool defaultCreated, bool isReadable, bool isReadableFixed, bool isWriteable,
                                              bool isWriteableFixed, NodeDataType dataType, int maxInstances, bool isAdapterInterface)
 {
     return(CreateNodeTemplate(uid, name, description, key, needsInterface, providesInterface, defaultCreated,
                               isReadable, isReadableFixed, isWriteable, isWriteableFixed, dataType, maxInstances, isAdapterInterface,
                               true));
 }
Exemplo n.º 3
0
 private void CreateAction(INodeTemplateFactory factory, Guid guid, string name, bool writeAble, bool readAble, NodeDataType dataType)
 {
     factory.CreateNodeTemplate(guid, $"SONOS.{name.ToUpperInvariant()}.NAME",
                                $"SONOS.{name.ToUpperInvariant()}.DESCRIPTION", name.ToLowerInvariant(), SonosDeviceInterfaceGuid,
                                GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, readAble, true, writeAble, true,
                                dataType, 1, false);
 }