示例#1
0
        //TOCHECK
        public static void ChangeShield(this Node node, ShieldTypes newShield)
        {
            //Unlink all home devices
            node.UnlinkAllConnectors();

            //Delete connectors
            node.Connectors.Clear();

            //Create new connectors
            foreach (var item in ProductConfiguration.GetShieldDictionary(newShield))
            {
                node.Connectors.Add(BusinessConnector.CreateConnector(item.Key, item.Value.Item1));
            }
        }
示例#2
0
        public static Node CreateNode(BaseTypes baseType, ShieldTypes shieldType)
        {
            Node node = new Node
            {
                Base           = baseType,
                Shield         = shieldType,
                NetworkRetries = 3,
            };

            foreach (var item in ProductConfiguration.GetShieldDictionary(shieldType))
            {
                if (item.Value.Item1 != DataLayer.Entities.Enums.ConnectorTypes.DimmerPassZero)
                {
                    node.Connectors.Add(BusinessConnector.CreateConnector(item.Key, item.Value.Item1));
                }
            }

            return(node);
        }