private void CreateOrUpdateNode(Gateways.MySensors.Node node)
 {
     MySensorsNode oldNode = GetMySensorsNode(node.Id);
     if (oldNode == null)
     {
         MySensorsNode newMySensorsNode = new MySensorsNode(node);
         engine.AddNode(newMySensorsNode);
     }
     else
     {
         oldNode.Settings["Name"].Value = node.GetSimpleName2();
         engine.UpdateNodeInEditor(oldNode);
         engine.UpdateNodeInDb(oldNode);
     }
 }
        public List<MySensorsNode> CreateAndAddMySensorsNodes()
        {
            var list = new List<MySensorsNode>();

            foreach (var node in gateway.GetNodes())
            {
                if (GetMySensorsNode(node.Id) != null)
                    continue;

                MySensorsNode newMySensorsNode = new MySensorsNode(node);
                list.Add(newMySensorsNode);
                engine.AddNode(newMySensorsNode);
            }
            return list;
        }